diff --git a/Makefile b/Makefile index 26532ef3..5fdb6ea7 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,30 @@ HTML_LIBS = $(MODULE_DOCS:%=doc/lib/chibi/%.html) include Makefile.libs +######################################################################## +# Library config. +# +# This is to allow "make SEXP_USE_BOEHM=1" and "make SEXP_USE_DL=0" to +# automatically include the necessary compiler and linker flags in +# addition to setting those features. If not using GNU make just +# comment out the ifs and use the else branches for the defaults. + +ifeq ($(SEXP_USE_BOEHM),1) +GCLDFLAGS := -lgc +XCPPFLAGS := $(CPPFLAGS) -Iinclude $(D:%=-DSEXP_USE_%) -DSEXP_USE_BOEHM=1 +else +GCLDFLAGS := +XCPPFLAGS := $(CPPFLAGS) -Iinclude $(D:%=-DSEXP_USE_%) +endif + +ifeq ($(SEXP_USE_DL),0) +XLDFLAGS := $(LDFLAGS) $(RLDFLAGS) $(GCLDFLAGS) -lm +XCFLAGS := -Wall -DSEXP_USE_DL=0 -g -g3 -Os $(CFLAGS) +else +XLDFLAGS := $(LDFLAGS) $(RLDFLAGS) $(GCLDFLAGS) $(LIBDL) -lm +XCFLAGS := -Wall -g -g3 -Os $(CFLAGS) +endif + ######################################################################## all: chibi-scheme$(EXE) all-libs lib/chibi/ast$(SO) diff --git a/Makefile.libs b/Makefile.libs index 4c186282..6767d386 100644 --- a/Makefile.libs +++ b/Makefile.libs @@ -42,30 +42,6 @@ CHIBI_DOC ?= chibi-doc include Makefile.detect -######################################################################## -# Library config. -# -# This is to allow "make SEXP_USE_BOEHM=1" and "make SEXP_USE_DL=0" to -# automatically include the necessary compiler and linker flags in -# addition to setting those features. If not using GNU make just -# comment out the ifs and use the else branches for the defaults. - -ifeq ($(SEXP_USE_BOEHM),1) -GCLDFLAGS := -lgc -XCPPFLAGS := $(CPPFLAGS) -Iinclude $(D:%=-DSEXP_USE_%) -DSEXP_USE_BOEHM=1 -else -GCLDFLAGS := -XCPPFLAGS := $(CPPFLAGS) -Iinclude $(D:%=-DSEXP_USE_%) -endif - -ifeq ($(SEXP_USE_DL),0) -XLDFLAGS := $(LDFLAGS) $(RLDFLAGS) $(GCLDFLAGS) -lm -XCFLAGS := -Wall -DSEXP_USE_DL=0 -g -g3 -Os $(CFLAGS) -else -XLDFLAGS := $(LDFLAGS) $(RLDFLAGS) $(GCLDFLAGS) $(LIBDL) -lm -XCFLAGS := -Wall -g -g3 -Os $(CFLAGS) -endif - ######################################################################## all-libs: $(COMPILED_LIBS)