From 226d2e70351db8051974f6107b09f0cdfd17bb2c Mon Sep 17 00:00:00 2001 From: Andreas Zwinkau Date: Thu, 6 Aug 2015 21:27:38 +0200 Subject: [PATCH 1/2] avoid rebuilding dfmt unnecessarily for test --- makefile | 10 ++++++---- tests/test.sh | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/makefile b/makefile index bb90b5c..1c04a47 100644 --- a/makefile +++ b/makefile @@ -10,12 +10,14 @@ LDC_FLAGS := -g -w -oq $(INCLUDE_PATHS) dmd: bin/dfmt ldc: $(SRC) - ldc2 $(LDC_FLAGS) $(SRC) -ofbin/dfmt + ldc2 $(LDC_FLAGS) $^ -ofbin/dfmt -rm -f *.o -test: - dmd $(DMD_TEST_FLAGS) $(SRC) -ofbin/dfmt +test: bin/dfmt-test cd tests && ./test.sh +bin/dfmt-test: $(SRC) + dmd $(DMD_TEST_FLAGS) $^ -of$@ + bin/dfmt: $(SRC) - dmd $(DMD_FLAGS) $(SRC) -ofbin/dfmt + dmd $(DMD_FLAGS) $^ -of$@ diff --git a/tests/test.sh b/tests/test.sh index 7f11c5a..3b20a18 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -12,7 +12,7 @@ do else args= fi - ../bin/dfmt --brace_style=${braceStyle} ${args} "${source}" > "${braceStyle}/${source}.out" + ../bin/dfmt-test --brace_style=${braceStyle} ${args} "${source}" > "${braceStyle}/${source}.out" diff -u "${braceStyle}/${source}.ref" "${braceStyle}/${source}.out" done done From 827aec26f410d97d5eed7c9e11ae5b17b3f97bd4 Mon Sep 17 00:00:00 2001 From: Andreas Zwinkau Date: Thu, 6 Aug 2015 22:05:38 +0200 Subject: [PATCH 2/2] add goal for gdc --- makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 1c04a47..8e064d7 100644 --- a/makefile +++ b/makefile @@ -4,8 +4,9 @@ DMD_COMMON_FLAGS := -dip25 -w $(INCLUDE_PATHS) DMD_FLAGS := -O -inline $(DMD_COMMON_FLAGS) DMD_TEST_FLAGS := -unittest -g $(DMD_COMMON_FLAGS) LDC_FLAGS := -g -w -oq $(INCLUDE_PATHS) +GDC_FLAGS := -g -w -oq $(INCLUDE_PATHS) -.PHONY: dmd ldc test +.PHONY: dmd ldc gdc test dmd: bin/dfmt @@ -13,6 +14,9 @@ ldc: $(SRC) ldc2 $(LDC_FLAGS) $^ -ofbin/dfmt -rm -f *.o +gdc: $(SRC) + gdc $(GDC_FLAGS) $^ -obin/dfmt + test: bin/dfmt-test cd tests && ./test.sh