From d96a1fa869072053d943badb6e3904a7d7a2d4de Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 4 Nov 2009 12:29:52 -0800 Subject: Got build to work in separate build directory. --- Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c4eac356..ffa9f2ac 100644 --- a/Makefile +++ b/Makefile @@ -28,12 +28,17 @@ -include config.make -CFLAGS := $(LANG_FLAGS) $(DIAG_FLAGS) $(OPT_FLAGS) $(DBG_FLAGS) +CFLAGS := -I$(top_srcdir) $(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) + +PROG := ./txr + +$(PROG): $(OBJS) $(CC) $(CFLAGS) -o $@ $^ $(LEXLIB) +VPATH := $(top_srcdir) + -include dep.mk lex.yy.c: parser.l @@ -43,18 +48,18 @@ y.tab.c y.tab.h: parser.y if $(YACC) -v -d $< ; then true ; else rm $@ ; false ; fi clean: - rm -f txr $(OBJS) \ + rm -f $(PROG) $(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 +depend: $(PROG) + $(PROG) depend.txr > dep.mk TESTS := $(patsubst %.txr,%.ok,$(shell find tests -name '*.txr' | sort)) -tests: txr $(TESTS) +tests: $(PROG) $(TESTS) @echo "** tests passed!" tests/001/%: TXR_ARGS := tests/001/data -- cgit v1.2.3