diff --git a/Examples/Makefile.in b/Examples/Makefile.in index e895062a4..94d008b13 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -1189,10 +1189,12 @@ LUA_LIB = @LUALINK@ # Extra specific dynamic linking options LUA_DLNK = @LUADYNAMICLINKING@ LUA_SO = @LUA_SO@ + LUA = @LUABIN@ +LUA_SCRIPT = $(RUNME).lua # Extra code for lua static link -LUA_INTERP = ../lua.c +LUA_INTERP = ../lua.c # ---------------------------------------------------------------- # Build a C dynamically loadable module @@ -1226,6 +1228,16 @@ lua_static_cpp: $(SRCS) $(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(LUA_INTERP) $(INCLUDES) \ $(LUA_INCLUDE) $(LIBS) $(LUA_LIB) -o $(TARGET) +# ----------------------------------------------------------------- +# Run Lua example +# ----------------------------------------------------------------- + +lua_run: + $(RUNTOOL) $(LUA) $(LUA_SCRIPT) $(RUNPIPE) + +lua_embed_run: + $(RUNTOOL) ./$(TARGET) $(RUNPIPE) + # ----------------------------------------------------------------- # Version display # ----------------------------------------------------------------- diff --git a/Examples/lua/arrays/Makefile b/Examples/lua/arrays/Makefile index f181818a6..d398dffea 100644 --- a/Examples/lua/arrays/Makefile +++ b/Examples/lua/arrays/Makefile @@ -4,15 +4,16 @@ SRCS = example.c TARGET = example INTERFACE = example.i -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua -static:: +static: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all diff --git a/Examples/lua/class/Makefile b/Examples/lua/class/Makefile index 44888f66f..c39e8acdf 100644 --- a/Examples/lua/class/Makefile +++ b/Examples/lua/class/Makefile @@ -5,15 +5,16 @@ TARGET = example INTERFACE = example.i LIBS = -lm -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua_cpp -static:: +static: $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_cpp_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all diff --git a/Examples/lua/constants/Makefile b/Examples/lua/constants/Makefile index 4204545b8..51b83be2e 100644 --- a/Examples/lua/constants/Makefile +++ b/Examples/lua/constants/Makefile @@ -5,15 +5,16 @@ TARGET = example INTERFACE = example.i LIBS = -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua -static:: +static: $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all diff --git a/Examples/lua/dual/Makefile b/Examples/lua/dual/Makefile index b4e28f331..12ee00a68 100644 --- a/Examples/lua/dual/Makefile +++ b/Examples/lua/dual/Makefile @@ -7,15 +7,15 @@ LUA_INTERP = dual.cpp # This is a little different to normal as we need to static link two modules and a custom interpreter # We need the external runtime, then swig examples2, and build the module as normal -all:: +check: build + $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' lua_embed_run + +build: $(SWIG) -lua -external-runtime $(SWIG) -c++ -lua $(SWIGOPT) example2.i $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='example.i' LUA_INTERP='$(LUA_INTERP)' lua_static_cpp -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - rm -f swigluarun.h - -check: all - + rm -f swigluarun.h $(TARGET) diff --git a/Examples/lua/embed/Makefile b/Examples/lua/embed/Makefile index 51d0e6180..df1f8fa04 100644 --- a/Examples/lua/embed/Makefile +++ b/Examples/lua/embed/Makefile @@ -1,18 +1,19 @@ TOP = ../.. SWIG = $(TOP)/../preinst-swig TARGET = embed -SRCS = example.c +SRCS = example.c INTERFACE = example.i LUA_INTERP = embed.c # this is a little different to normal as we have our own special interpreter # which we want to static link -all:: +check: build + $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' lua_embed_run + +build: $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='example.i' LUA_INTERP='$(LUA_INTERP)' lua_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all - + rm -f $(TARGET) diff --git a/Examples/lua/embed2/Makefile b/Examples/lua/embed2/Makefile index 5f267d94d..fc309ac7e 100644 --- a/Examples/lua/embed2/Makefile +++ b/Examples/lua/embed2/Makefile @@ -1,18 +1,19 @@ TOP = ../.. SWIG = $(TOP)/../preinst-swig TARGET = embed2 -SRCS = example.c +SRCS = example.c INTERFACE = example.i LUA_INTERP = embed2.c # this is a little different to normal as we have our own special interpreter # which we want to static link -all:: +check: build + $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' lua_embed_run + +build: $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='example.i' LUA_INTERP='$(LUA_INTERP)' lua_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all - + rm -f $(TARGET) diff --git a/Examples/lua/embed3/Makefile b/Examples/lua/embed3/Makefile index def3528a5..8cfa97454 100644 --- a/Examples/lua/embed3/Makefile +++ b/Examples/lua/embed3/Makefile @@ -1,20 +1,21 @@ TOP = ../.. SWIG = $(TOP)/../preinst-swig TARGET = embed3 -SRCS = example.cpp +SRCS = example.cpp INTERFACE = example.i LUA_INTERP = embed3.cpp # this is a little different to normal as we have our own special interpreter # which we want to static link # we also need the external runtime, so we can get access to certain internals of SWIG -all:: +check: build + $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' lua_embed_run + +build: $(SWIG) -c++ -lua $(SWIGOPT) -external-runtime swigluarun.h $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='example.i' LUA_INTERP='$(LUA_INTERP)' lua_static_cpp -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all - + rm -f swigluarun.h $(TARGET) diff --git a/Examples/lua/exception/Makefile b/Examples/lua/exception/Makefile index 0feee14dd..01bee5c6a 100644 --- a/Examples/lua/exception/Makefile +++ b/Examples/lua/exception/Makefile @@ -5,15 +5,16 @@ TARGET = example INTERFACE = example.i LIBS = -lm -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua_cpp -static:: +static: $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_cpp_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all diff --git a/Examples/lua/funcptr3/Makefile b/Examples/lua/funcptr3/Makefile index ac0fff43e..00bfe7992 100644 --- a/Examples/lua/funcptr3/Makefile +++ b/Examples/lua/funcptr3/Makefile @@ -5,15 +5,16 @@ TARGET = example INTERFACE = example.i LIBS = -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua -static:: +static: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all diff --git a/Examples/lua/functest/Makefile b/Examples/lua/functest/Makefile index ac0fff43e..00bfe7992 100644 --- a/Examples/lua/functest/Makefile +++ b/Examples/lua/functest/Makefile @@ -5,15 +5,16 @@ TARGET = example INTERFACE = example.i LIBS = -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua -static:: +static: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all diff --git a/Examples/lua/functor/Makefile b/Examples/lua/functor/Makefile index 432bfbef3..9220dfe51 100644 --- a/Examples/lua/functor/Makefile +++ b/Examples/lua/functor/Makefile @@ -6,15 +6,16 @@ INTERFACE = example.i LIBS = -lm SWIGOPT = -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua_cpp -static:: +static: $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_cpp_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all diff --git a/Examples/lua/import/Makefile b/Examples/lua/import/Makefile index 8f692d175..0bf47c1a5 100644 --- a/Examples/lua/import/Makefile +++ b/Examples/lua/import/Makefile @@ -3,7 +3,10 @@ SWIG = $(TOP)/../preinst-swig SWIGOPT = LIBS = -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='base' INTERFACE='base.i' lua_cpp $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ @@ -13,7 +16,5 @@ all:: $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='spam' INTERFACE='spam.i' lua_cpp -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all diff --git a/Examples/lua/owner/Makefile b/Examples/lua/owner/Makefile index 44888f66f..c39e8acdf 100644 --- a/Examples/lua/owner/Makefile +++ b/Examples/lua/owner/Makefile @@ -5,15 +5,16 @@ TARGET = example INTERFACE = example.i LIBS = -lm -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua_cpp -static:: +static: $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_cpp_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all diff --git a/Examples/lua/pointer/Makefile b/Examples/lua/pointer/Makefile index ac0fff43e..00bfe7992 100644 --- a/Examples/lua/pointer/Makefile +++ b/Examples/lua/pointer/Makefile @@ -5,15 +5,16 @@ TARGET = example INTERFACE = example.i LIBS = -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua -static:: +static: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all diff --git a/Examples/lua/simple/Makefile b/Examples/lua/simple/Makefile index f181818a6..d398dffea 100644 --- a/Examples/lua/simple/Makefile +++ b/Examples/lua/simple/Makefile @@ -4,15 +4,16 @@ SRCS = example.c TARGET = example INTERFACE = example.i -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua -static:: +static: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all diff --git a/Examples/lua/variables/Makefile b/Examples/lua/variables/Makefile index f181818a6..d398dffea 100644 --- a/Examples/lua/variables/Makefile +++ b/Examples/lua/variables/Makefile @@ -4,15 +4,16 @@ SRCS = example.c TARGET = example INTERFACE = example.i -all:: +check: build + $(MAKE) -f $(TOP)/Makefile lua_run + +build: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua -static:: +static: $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static -clean:: +clean: $(MAKE) -f $(TOP)/Makefile lua_clean - -check: all