From bdccbad1c7da40d80f976858582574eb3c76dd40 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 4 Nov 2009 12:10:24 -0800 Subject: Build configuration via configure script, with cross compiling support. (Tested by cross-compiling txr on an x86 GNU/Linux system to run on a MIPS-based GNU/Linux system). --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 55adb34f..c4eac356 100644 --- a/Makefile +++ b/Makefile @@ -26,19 +26,13 @@ # Test data in the tests/ directory is in the public domain, # unless it contains notices to the contrary. -OPT_FLAGS := -O2 -LANG_FLAGS := -ansi -D_GNU_SOURCE -DIAG_FLAGS := -Wall -DBG_FLAGS := -g -LEX_DBG_FLAGS := -TXR_DBG_OPTS := --gc-debug -LEXLIB := fl +-include config.make CFLAGS := $(LANG_FLAGS) $(DIAG_FLAGS) $(OPT_FLAGS) $(DBG_FLAGS) OBJS := txr.o lex.yy.o y.tab.o match.o lib.o regex.o gc.o unwind.o stream.o txr: $(OBJS) - $(CC) $(CFLAGS) -o $@ $^ -l$(LEXLIB) + $(CC) $(CFLAGS) -o $@ $^ $(LEXLIB) -include dep.mk @@ -52,6 +46,9 @@ clean: rm -f txr $(OBJS) \ y.tab.c lex.yy.c y.tab.h y.output $(TESTS:.ok=.out) +distclean: clean + rm -f config.make + depend: txr ./txr depend.txr > dep.mk @@ -71,3 +68,7 @@ tests/004/%: TXR_ARGS := -a 123 -b -c %.expected: %.txr ./txr $(TXR_OPTS) $^ $(TXR_ARGS) > $@ + +config.make: + @echo "config.make missing: you didn't run ./configure" + @exit 1 -- cgit v1.2.3