Skip to content
Snippets Groups Projects
Commit cd5523fa authored by Jakub Jirůtka's avatar Jakub Jirůtka
Browse files

makefile: add tasks test-debug and test-release

I've intentionally omitted dependency of test-* on build-*, to not
require building all modules when one have executables in bin-*.
However, when debug or release is invoked and RUN_TESTS is 1, then
it invokes build and test in this order.
parent f6e4ce0d
No related branches found
No related tags found
1 merge request!22makefile: add tasks test-debug and test-release
...@@ -84,14 +84,22 @@ endif ...@@ -84,14 +84,22 @@ endif
   
SUBDIRS_WITH_MAKE = $(dir $(wildcard */makefile)) SUBDIRS_WITH_MAKE = $(dir $(wildcard */makefile))
   
.PHONY: build-debug clean-debug \ .PHONY: build-debug test-debug clean-debug \
build-release clean-release \ build-release test-release clean-release \
debug release clean doc all debug release clean doc all
   
all: all:
@echo "What to do master?" @echo "What to do master?"
   
debug build-debug: ifeq ($(RUN_TESTS), 1)
debug: | build-debug test-debug
release: | build-release test-release
else
debug: build-debug
release: build-release
endif
build-debug:
for dir in $(SUBDIRS_LIBS); do \ for dir in $(SUBDIRS_LIBS); do \
$(MAKE) $@ -C $$dir || exit 1; \ $(MAKE) $@ -C $$dir || exit 1; \
done done
...@@ -114,12 +122,9 @@ debug build-debug: ...@@ -114,12 +122,9 @@ debug build-debug:
cp $$dir/bin-debug/* $(addsuffix -debug, $(BINFOLDER)); \ cp $$dir/bin-debug/* $(addsuffix -debug, $(BINFOLDER)); \
done done
cp translateAddresses $(addsuffix -debug, $(BINFOLDER)); \ cp translateAddresses $(addsuffix -debug, $(BINFOLDER)); \
cp xmlFormat $(addsuffix -debug, $(BINFOLDER)); \ cp xmlFormat $(addsuffix -debug, $(BINFOLDER))
if [ "$@" == "debug" ] && [ $(RUN_TESTS) -eq 1 ]; then for test in $(wildcard tests.*.sh); do \
./$$test debug $(JOBS); \
done; fi
   
release build-release: build-release:
for dir in $(SUBDIRS_LIBS); do \ for dir in $(SUBDIRS_LIBS); do \
$(MAKE) $@ -C $$dir || exit 1; \ $(MAKE) $@ -C $$dir || exit 1; \
done done
...@@ -142,10 +147,17 @@ release build-release: ...@@ -142,10 +147,17 @@ release build-release:
cp $$dir/bin-release/* $(addsuffix -release, $(BINFOLDER)); \ cp $$dir/bin-release/* $(addsuffix -release, $(BINFOLDER)); \
done done
cp translateAddresses $(addsuffix -release, $(BINFOLDER)); \ cp translateAddresses $(addsuffix -release, $(BINFOLDER)); \
cp xmlFormat $(addsuffix -release, $(BINFOLDER)); \ cp xmlFormat $(addsuffix -release, $(BINFOLDER))
if [ "$@" == "release" ] && [ $(RUN_TESTS) -eq 1 ]; then for test in $(wildcard tests.*.sh); do \
test-debug:
for test in $(wildcard tests.*.sh); do \
./$$test debug $(JOBS); \
done
test-release:
for test in $(wildcard tests.*.sh); do \
./$$test release $(JOBS); \ ./$$test release $(JOBS); \
done; fi done
   
clean: clean-debug clean-release clean: clean-debug clean-release
$(RM) -r bin-debug bin-release $(RM) -r bin-debug bin-release
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment