forked from root-project/roottest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.template
62 lines (45 loc) · 2.3 KB
/
Makefile.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# This is a template for all makefiles.
#Set the list of files to be deleted by clean (Targets can also be specified).:
CLEAN_TARGETS += $(ALL_LIBRARIES) *.log *.clog
# Set the list of target to make while testing. By default, mytest is the
# only target added. If the name of the target is changed in the rules then
# the name should be changed accordingly in this list.
TEST_TARGETS += mytest
# Search for Rules.mk in roottest/scripts
# Algorithm: Find the current working directory and remove everything after
# '*roottest/'. Append the path for Rules.mk from within roottest, which
# should be 'scripts/Rules.mk'. The roottest path is saved in the
# ROOTTEST_HOME variable for use by the SUBDIRECTORIES variable and is
# exported to eliminate the overhead of findding the path again during
# recursive calls of gmake.
# Since all makefiles should be under roottest or one of its
# subdirectories and all recursions of gmake are called by
# 'cd [DIR]; gmake ...'
# this algorithm should not fail in finding /roottest/ in the
# current working directory.
# Issues: This algorithm will fail if a makefile is called from outside the
# roottest folder, as in executing 'gmake -f ~/roottest/Makefile' from
# the home directory.
ifeq ($(strip $(ROOTTEST_HOME)),)
export ROOTTEST_HOME:=$(shell expr $(CURDIR) : '\(.*/roottest/\)')
endif
include $(ROOTTEST_HOME)/scripts/Rules.mk
# The name of this target should be changed according to the test being run. Any name changes
# should also be reflected in the TEST_TARGETS variable above.
mytest:
$(CMDECHO) echo mytest > /dev/null
# Outputs a message if the FAIL variable is null
testWithFailure:
ifeq ($(FAIL),)
$(WarnFailTest)
endif
# Remember that sometest.log can be made automatically from
# from runsometest.C
# This target attempts to create a log file (which should be the output of running the test), and
# compares its output with a prebuilt reference file. The reference file should be copied from
# the log files produced during what is considered a successful run of the test. The testWithDiff
# files should be renamed according to the test being run.
# By default the TestDiff variable is set to compare the .log and .ref files
# To run a diff and ignore whitespacing use $(TestDiffW)
testWithDiff: testWithDiff.log testWithDiff.ref
$(TestDiff)