reworking test Makefile sync
authorVolker Birk <vb@pep-project.org>
Sat, 06 Apr 2019 19:46:20 +0200
branchsync
changeset 3449b50ed154ee86
parent 3448 191306b90981
child 3450 653411a537d5
reworking test Makefile
test/Makefile
     1.1 --- a/test/Makefile	Sat Apr 06 19:00:48 2019 +0200
     1.2 +++ b/test/Makefile	Sat Apr 06 19:46:20 2019 +0200
     1.3 @@ -96,17 +96,12 @@
     1.4  TEST_CMD_PFX=
     1.5  
     1.6  
     1.7 -.PHONY: all
     1.8 -all: suitemaker $(TARGET) scripts
     1.9 +all: .suitemaker $(TARGET) .scripts
    1.10  
    1.11  %.d: %.cc
    1.12  	$(CXX) -MM $(CPPFLAGS) $(CXXFLAGS) $< | sed -e 's,\($*\)\.o[ :]*,\1.o $@: ,g' > $@
    1.13  
    1.14 -$(TARGET): $(OBJS)
    1.15 -	$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@
    1.16 -
    1.17 -.PHONY: suitemaker
    1.18 -suitemaker:
    1.19 +.suitemaker: gensuitemaker.py
    1.20  ifndef PY_ENV
    1.21  	@echo "WARNING: Can't find python3 - this is fine unless you're adding test suites. If so, please install python3."
    1.22  else
    1.23 @@ -116,22 +111,25 @@
    1.24  	# Comma-separated list, no spaces
    1.25  	$(PY_ENV) gensuitemaker.py --exclude=$(EXCLUDE)
    1.26  endif
    1.27 +	touch .suitemaker
    1.28  endif
    1.29  
    1.30 -.PHONY: scripts
    1.31 -scripts:
    1.32 +$(TARGET): $(OBJS) .suitemaker
    1.33 +	$(LINK.cc) $(OBJS) $(LOADLIBES) $(LDLIBS) -o $@
    1.34 +
    1.35 +.scripts:
    1.36  ifdef PY_ENV
    1.37  	$(PY_ENV) genscripts.py
    1.38 +	touch .scripts
    1.39  endif
    1.40  
    1.41 -.PHONY: test
    1.42  test: all
    1.43  	$(TEST_CMD_PFX) $(TEST_DEBUGGER) ./$(TARGET)
    1.44  
    1.45  .PHONY: clean
    1.46  clean:
    1.47  	$(RM) $(TARGET) $(TARGET).o $(TARGET).d $(OBJS) $(notdir $(basename $(OBJS))) $(DEPS)
    1.48 -	$(RM) $(HERE)/*Tests msg_2.0.asc $(HERE)/pEp_test_home
    1.49 +	$(RM) $(HERE)/*Tests msg_2.0.asc $(HERE)/pEp_test_home .suitemaker .scripts
    1.50  
    1.51  # If only the goal 'clean' is given, do not generate and include the '%.d' files.¬
    1.52  ifneq ($(MAKECMDGOALS),clean)