# This file may be used under the terms of the GNU General Public License version 3
# see LICENSE.txt
HERE:=$(CURDIR)
include../Makefile.conf
# This is done this way because we presume that users who don't have python3 installed are also not bothering with the generated parts of the test suite (i.e. non-devs).
# Tests will totally build and run without it.
# User's without python3 will skip the generated parts of the test suite. That's OK.
PY_ENV:=$(shell command -v python3 2> /dev/null)
# Since you 'include' before evaluating CURDIR, I think it's possible that CURDIR does not have the value you think it might have. Yes, make is awkward.
# KB: These are probably redundant anyway. But it is supposed to correspond to the directory in src/TestDriver.cc, which is whatever the cwd is that TestDriver is running in.
# It's a pretty trivial point anyway - it's only used in the clean target, and only really matters if tests were interrupted because of a seg fault or non-test assert;
# in that case, the test directory not being cleaned up *might* be problematic, but really probably isn't.
HERE:=$(CURDIR)
TEST_HOME=$(HERE)/pEp_test_home
TARGET=TestDriver
SRCS:=$(wildcard src/*.cc)$(wildcard src/*/*.cc)
OBJS:=$(addsuffix .o,$(basename $(SRCS)))
DEPS:=$(OBJS:.o=.d)
SRCS:=$(wildcard src/*.cc)$(wildcard src/*/*.cc)
OBJS:=$(addsuffix .o,$(basename $(SRCS)))
DEPS:=$(OBJS:.o=.d)
# Using '/usr/local/include' is very much a "works on my machine" solution to the problem. Either, the compiler search paths are enough, otherwise define a BLA_INC and BLA_LIB path to make clear to other developers what you are looking for outside the standard paths.
# KB: Sure. Then fix that - again, audience of 1-4, and we needed to make our tests work. This file tends to get hacked when settings from above don't end up in compilation.
# '+=' is a magic assignment operators. It ensures that there is exactly one space between the old value and the suffix. Yes, this means it might strip spaces. At any rate, there is no need to add a space after the operator.
# Caution: you're using tab to indent here, but none of the lines from here to 60 are recipes. Indentation should be done with spaces. This only works because Make is such a gratious tool. (Yeah, right...)
# So, if there is no python, then 'scripts' will trivially be up to date, because there is no recipe associated with this rule. That's probably not what you want.
# KB: That is totally what I want here.
.PHONY:scripts
scripts:
scripts:
ifdefPY_ENV
$(PY_ENV) genscripts.py
endif
@ -151,15 +91,13 @@ endif
.PHONY:test
test:all
$(TEST_DEBUGGER) ./$(TARGET)
.PHONY:clean
clean:
$(RM)$(TARGET)$(OBJS)$(DEPS)
$(RM)$(HERE)/*Tests msg_2.0.asc
# You know, I think we have this "compiler generates Makefiles" pattern in another makefile in the engine, but there it looks completly different. From reading just this makefile: are you sure, the compiler generated Makefiles are actually every generated? You don't have DEPS as a prerequisite anywhere. Is there some built-in rule that has %.d as a prerequisite? Without further investigation I am not convinced the %.d files are ever generated...
# KB: This might be leftover.
-include$(DEPS)
# If only the goal 'clean' is given, do not generate and include the '%.d' files.¬