diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2009-11-04 13:44:29 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2009-11-04 13:44:29 -0800 |
commit | 802e61bb121077c16e55cbab2f569cca3269c1fe (patch) | |
tree | 37820fe279a766d55a8977d27aa5135e7bd3af3f /Makefile | |
parent | 25af1192809b7be30ed521f5ae22e543a75f6ca4 (diff) | |
download | txr-802e61bb121077c16e55cbab2f569cca3269c1fe.tar.gz txr-802e61bb121077c16e55cbab2f569cca3269c1fe.tar.bz2 txr-802e61bb121077c16e55cbab2f569cca3269c1fe.zip |
Got "make tests" working in separate build directory,
with .out files going to local tests/ tree.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -39,7 +39,7 @@ $(PROG): $(OBJS) VPATH := $(top_srcdir) --include dep.mk +-include $(top_srcdir)/dep.mk lex.yy.c: parser.l $(LEX) $(LEX_DBG_FLAGS) $< @@ -55,23 +55,27 @@ distclean: clean rm -f config.make depend: $(PROG) - $(PROG) depend.txr > dep.mk + $(PROG) $(top_srcdir)/depend.txr > $(top_srcdir)/dep.mk -TESTS := $(patsubst %.txr,%.ok,$(shell find tests -name '*.txr' | sort)) +TESTS := $(patsubst $(top_srcdir)/%.txr,./%.ok,\ + $(shell find $(top_srcdir)/tests -name '*.txr' | sort)) + +$(warning $(TESTS)) tests: $(PROG) $(TESTS) @echo "** tests passed!" -tests/001/%: TXR_ARGS := tests/001/data -tests/002/%: TXR_OPTS := -DTESTDIR=tests/002 +tests/001/%: TXR_ARGS := $(top_srcdir)/tests/001/data +tests/002/%: TXR_OPTS := -DTESTDIR=$(top_srcdir)/tests/002 tests/004/%: TXR_ARGS := -a 123 -b -c %.ok: %.txr - ./txr $(TXR_DBG_OPTS) $(TXR_OPTS) $^ $(TXR_ARGS) > $(@:.ok=.out) - diff $(@:.ok=.expected) $(@:.ok=.out) + mkdir -p $(dir $@) + $(PROG) $(TXR_DBG_OPTS) $(TXR_OPTS) $^ $(TXR_ARGS) > $(@:.ok=.out) + diff $(^:.txr=.expected) $(@:.ok=.out) %.expected: %.txr - ./txr $(TXR_OPTS) $^ $(TXR_ARGS) > $@ + $(PROG) $(TXR_OPTS) $^ $(TXR_ARGS) > $@ install: $(PROG) mkdir -p $(install_prefix)$(bindir) |