diff options
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | Makefile | 20 | ||||
-rwxr-xr-x | configure | 4 |
3 files changed, 26 insertions, 12 deletions
@@ -1,5 +1,19 @@ 2009-10-22 Kaz Kylheku <kkylheku@gmail.com> + Got "make tests" working in separate build directory, + with .out files going to local tests/ tree. + + * Makefile (depend): Refer to depend.txr and dep.mk + using $top_srcdir; no need for symlinks. + Changed a few more ./txr references to use $(PROG). + (TESTS): Path munging to generate targets with local paths. + (%.ok): Fixed diff logic to compare between .expected file + in $(top_srcdir) and local .out file. + + * configure: Don't generate symlinks for tests and dep.mk. + +2009-10-22 Kaz Kylheku <kkylheku@gmail.com> + Got "make install" working. * Makefile (install): New target. @@ -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) @@ -392,10 +392,6 @@ esac if [ "$source_dir" != "." ] ; then printf "symlinking Makefile -> $source_dir/Makefile\n" ln -sf "$source_dir/Makefile" . - printf "symlinking tests -> $source_dir/tests\n" - ln -sf "$source_dir/tests" . - printf "symlinking dep.mk -> $source_dir/dep.mk\n" - ln -sf "$source_dir/dep.mk" . else printf "warning: its recommended to build in a separate directory\n" fi |