Guile example makefiles tweaks for consistency with other languages. 'make check' still incomplete.

This commit is contained in:
William S Fulton 2013-04-15 22:13:27 +01:00
commit 2e48e5b852
9 changed files with 43 additions and 38 deletions

View file

@ -459,6 +459,8 @@ GUILE_INCLUDE = @GUILEINCLUDE@
GUILE_LIB = @GUILELIB@ GUILE_LIB = @GUILELIB@
GUILE_SO = @GUILE_SO@ GUILE_SO = @GUILE_SO@
GUILE_LIBPREFIX = lib GUILE_LIBPREFIX = lib
GUILE_LIBOPTS = @GUILELINK@ @LIBS@ $(SYSLIBS)
GUILE_SCRIPT = $(RUNME).scm
#------------------------------------------------------------------ #------------------------------------------------------------------
# Build a dynamically loaded module with passive linkage and the scm interface # Build a dynamically loaded module with passive linkage and the scm interface
@ -507,8 +509,6 @@ guile_passive_cpp: $(SRCS)
# Build statically linked Guile interpreter # Build statically linked Guile interpreter
# ----------------------------------------------------------------- # -----------------------------------------------------------------
GUILE_LIBOPTS = @GUILELINK@ @LIBS@ $(SYSLIBS)
guile_static: $(SRCS) guile_static: $(SRCS)
$(SWIG) -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) $(INTERFACEPATH) $(SWIG) -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) $(INTERFACEPATH)
$(CC) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) \ $(CC) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) \
@ -531,6 +531,13 @@ guile_simple_cpp: $(SRCS)
$(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \ $(CXX) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \
$(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile $(GUILE_INCLUDE) $(LIBS) -L$(GUILE_LIB) $(GUILE_LIBOPTS) -o $(TARGET)-guile
# -----------------------------------------------------------------
# Running a Guile example
# -----------------------------------------------------------------
guile_run:
$(RUNTOOL) $(GUILE) -l $(GUILE_SCRIPT) $(RUNPIPE)
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# Version display # Version display
# ----------------------------------------------------------------- # -----------------------------------------------------------------

View file

@ -19,7 +19,7 @@ SO = @SO@
all: all:
for d in $(subdirs) ; do (cd $$d ; $(MAKE)) ; done for d in $(subdirs) ; do (cd $$d ; $(MAKE)) ; done
clean:: clean:
for d in $(subdirs) ; do (cd $$d ; $(MAKE) clean) ; done for d in $(subdirs) ; do (cd $$d ; $(MAKE) clean) ; done
rm -f *~ .~* rm -f *~ .~*
@ -29,11 +29,11 @@ guile_clean:
# This is meant to be used w/ "make -f ../Makefile" from subdirs. # This is meant to be used w/ "make -f ../Makefile" from subdirs.
# Doesn't make sense to use it from here. # Doesn't make sense to use it from here.
sub-all:: sub-all:
$(SWIG) -guile $(SWIGOPT) $(IFILE) $(SWIG) -guile $(SWIGOPT) $(IFILE)
$(CC) $(CFLAGS) -o $(TARGET) $(SRCS) $(WRAP) $(GUILEINCLUDE) $(GUILELINK) $(CC) $(CFLAGS) -o $(TARGET) $(SRCS) $(WRAP) $(GUILEINCLUDE) $(GUILELINK)
sub-all-cxx:: sub-all-cxx:
$(SWIG) -c++ -guile $(SWIGOPT) $(IFILE) $(SWIG) -c++ -guile $(SWIGOPT) $(IFILE)
$(CXX) $(CFLAGS) -o $(TARGET) $(SRCS) $(CXXWRAP) $(GUILEINCLUDE) $(GUILELINK) $(CXX) $(CFLAGS) -o $(TARGET) $(SRCS) $(CXXWRAP) $(GUILEINCLUDE) $(GUILELINK)

View file

@ -3,15 +3,15 @@ TARGET = my-guile
IFILE = example.i IFILE = example.i
MKDIR = .. MKDIR = ..
all:: check: build
./my-guile -s constants.scm
build:
$(MAKE) -f $(MKDIR)/Makefile \ $(MAKE) -f $(MKDIR)/Makefile \
SRCS='$(SRCS)' \ SRCS='$(SRCS)' \
TARGET=$(TARGET) \ TARGET=$(TARGET) \
IFILE=$(IFILE) \ IFILE=$(IFILE) \
sub-all sub-all
clean:: clean:
$(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean $(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean
check: all
./my-guile -s constants.scm

View file

@ -3,8 +3,9 @@ TARGET = matrix
IFILE = package.i IFILE = package.i
MKDIR = .. MKDIR = ..
check: build
all:: build:
$(MAKE) -f $(MKDIR)/Makefile \ $(MAKE) -f $(MKDIR)/Makefile \
SRCS='$(SRCS)' \ SRCS='$(SRCS)' \
TARGET=$(TARGET) \ TARGET=$(TARGET) \
@ -12,7 +13,5 @@ all::
MODULE=$(MODULE) \ MODULE=$(MODULE) \
sub-all sub-all
clean:: clean:
$(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean $(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean
check: all

View file

@ -4,15 +4,15 @@ SRCS = example.c
TARGET = example TARGET = example
INTERFACE = example.i INTERFACE = example.i
all:: check: build
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile
static:: static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static
clean:: clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean
check: all

View file

@ -4,15 +4,15 @@ SRCS = example.c
TARGET = example TARGET = example
INTERFACE = example.i INTERFACE = example.i
all:: check: build
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile
static:: static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static
clean:: clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean
check: all

View file

@ -3,8 +3,9 @@ TARGET = port
IFILE = port.i IFILE = port.i
MKDIR = .. MKDIR = ..
check: build
all:: build:
$(MAKE) -f $(MKDIR)/Makefile \ $(MAKE) -f $(MKDIR)/Makefile \
SRCS='$(SRCS)' \ SRCS='$(SRCS)' \
TARGET=$(TARGET) \ TARGET=$(TARGET) \
@ -12,7 +13,5 @@ all::
MODULE=$(MODULE) \ MODULE=$(MODULE) \
sub-all sub-all
clean:: clean:
$(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean $(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean
check: all

View file

@ -3,7 +3,10 @@ TARGET = my-guile
IFILE = example.i IFILE = example.i
MKDIR = .. MKDIR = ..
all: $(TARGET) check: $(TARGET)
./$(TARGET) -s example.scm
build: $(TARGET)
$(TARGET): $(TARGET):
$(MAKE) -f $(MKDIR)/Makefile \ $(MAKE) -f $(MKDIR)/Makefile \
@ -12,8 +15,5 @@ $(TARGET):
IFILE=$(IFILE) \ IFILE=$(IFILE) \
sub-all sub-all
clean:: clean:
$(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean $(MAKE) -f $(MKDIR)/Makefile TARGET='$(TARGET)' guile_clean
check: $(TARGET)
./$(TARGET) -s example.scm > /dev/null

View file

@ -4,15 +4,15 @@ SRCS =
TARGET = example TARGET = example
INTERFACE = example.i INTERFACE = example.i
all:: check: build
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_cpp TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_cpp
static:: static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static_cpp TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static_cpp
clean:: clean:
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean
check: all