diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rwxr-xr-x | configure | 14 |
3 files changed, 26 insertions, 2 deletions
@@ -1,3 +1,14 @@ +2014-12-07 Kaz Kylheku <kaz@kylheku.com> + + Debug builds optional with --debug-also config option. + + * Makefile (PROG): Variable removed, now set in config.make. + (all): Target now depends on $(BUILD_TARGETS) variable, set + in config.make. + + * configure (debug_also) New variable. + (gen_config_make): Generate PROG and BUILD_TARGETS variables. + 2014-12-05 Kaz Kylheku <kaz@kylheku.com> * arith.c (tofloat, toint): Handle characters. @@ -60,7 +60,6 @@ OBJS += $(MPI_OBJS) DBG_OBJS = $(call ADD_CONF,dbg,$(OBJS) $(OBJS-y)) OPT_OBJS = $(call ADD_CONF,opt,$(OBJS) $(OBJS-y)) -PROG := txr TXR := ./$(PROG) .SUFFIXES: @@ -77,7 +76,7 @@ opt/%.o: %.c %.o: %.c $(CC) $(OPT_FLAGS) $(CFLAGS) -c -o $@ $< -all: $(PROG) $(PROG)-dbg +all: $(BUILD_TARGETS) $(PROG): $(OPT_OBJS) $(CC) $(OPT_FLAGS) $(CFLAGS) -o $@ $^ -lm @@ -99,6 +99,7 @@ opt_flags=-O2 lang_flags='-ansi -D_XOPEN_SOURCE=600' diag_flags='-Wall -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=strict-prototypes' debug_flags=-g +debug_also= inline= platform_flags= remove_flags= @@ -353,6 +354,13 @@ debug-flags [$debug_flags] Specifies flags for requesting that debugging information be retained in the compile and link. +debug-also [$debug_also] + + Specifies that a debugging version of TXR is to be built at the + same time. This means that "make" will always update two sets + of object files compiled with different optimization flags, + and produce two binaries: txr and txr-dbg. + platform-flags [$platform_flags] Specify additional compiler flags for anything else, such as CPU tuning, @@ -624,10 +632,16 @@ LEX := $lex YACC := $yacc NM := $nm +PROG := txr + OPT_FLAGS := $opt_flags LANG_FLAGS := $lang_flags DIAG_FLAGS := $diag_flags DBG_FLAGS := $debug_flags +BUILD_TARGETS := $(if [ $debug_also ] ; then + echo '$(PROG) $(PROG)-dbg' + else + echo '$(PROG)'; fi) PLATFORM_FLAGS := $platform_flags REMOVE_FLAGS := $remove_flags LEX_DBG_FLAGS := $lex_dbg_flags |