|
1 # -*- makefile -*- |
|
2 # |
|
3 # This Source Code Form is subject to the terms of the Mozilla Public |
|
4 # License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
5 # You can obtain one at http://mozilla.org/MPL/2.0/. |
|
6 |
|
7 STANDALONE_MAKEFILE := 1 |
|
8 USE_AUTOTARGETS_MK = 1 |
|
9 MAKEUTILS_UNIT_TEST = 1 |
|
10 include $(topsrcdir)/config/makefiles/makeutils.mk |
|
11 |
|
12 dir-ts = .deps/test |
|
13 check-arglist = $(dir-ts)/arglist.ts |
|
14 check-autotargets = $(dir-ts)/autotargets_mk.ts |
|
15 check-XinY = $(dir-ts)/check_XinY_mk.ts |
|
16 check-tests =\ |
|
17 $(check-arglist) \ |
|
18 $(check-autotargets) \ |
|
19 $(check-XinY) \ |
|
20 $(NULL) |
|
21 |
|
22 |
|
23 ##------------------_## |
|
24 ##---] TARGETS [---## |
|
25 ##------------------_## |
|
26 all:: |
|
27 |
|
28 clean: |
|
29 $(RM) $(check-tests) |
|
30 |
|
31 ########################################################################### |
|
32 ## Logic processed at compile time so be selective about when to test |
|
33 ## $(MAKE) check VERBOSE=1 |
|
34 ifneq ($(NULL),$(findstring check,$(MAKECMDGOALS))) # |
|
35 |
|
36 check-preqs =\ |
|
37 $(call mkdir_deps,$(dir-ts)) \ |
|
38 $(check-tests) \ |
|
39 $(NULL) |
|
40 |
|
41 check:: $(check-preqs) |
|
42 @true |
|
43 |
|
44 |
|
45 ifdef VERBOSE #{ gmake check VERBOSE=1 |
|
46 $(info ===========================================================================) |
|
47 $(info Running test: $(MAKECMDGOALS): pwd=$(CURDIR)) |
|
48 $(info ===========================================================================) |
|
49 endif #} |
|
50 |
|
51 ifndef requiredfunction |
|
52 $(error requiredfunction is not defined) |
|
53 endif |
|
54 |
|
55 |
|
56 ################## |
|
57 check-XinY-preqs=\ |
|
58 $(call mkdir_deps,$(dir-ts)) \ |
|
59 $(topsrcdir)/config/makefiles/makeutils.mk \ |
|
60 $(srcdir)/check_XinY.mk \ |
|
61 $(eval include $(srcdir)/check_XinY.mk) \ |
|
62 $(NULL) |
|
63 |
|
64 $(check-XinY): $(check-XinY-preqs) |
|
65 @$(TOUCH) $@ |
|
66 # </check-XinY.mk> |
|
67 |
|
68 |
|
69 ########################################################################### |
|
70 ## check-arglist.mk always invoked as a compile time test |
|
71 ## maintain real file dependencies for use later on. |
|
72 check-arglist-preqs=\ |
|
73 $(call mkdir_deps,$(dir-ts)) \ |
|
74 $(topsrcdir)/config/makefiles/makeutils.mk \ |
|
75 $(srcdir)/check-arglist.mk \ |
|
76 $(eval include $(srcdir)/check-arglist.mk) \ |
|
77 $(NULL) |
|
78 |
|
79 $(check-arglist): $(check-arglist-preqs) |
|
80 @$(TOUCH) $@ |
|
81 # </check-arglist.mk> |
|
82 |
|
83 |
|
84 ########################################################################### |
|
85 # <CHECK: autotargets.mk> |
|
86 check-autotargets-preqs=\ |
|
87 $(call mkdir_deps,$(dir-ts)) \ |
|
88 $(topsrcdir)/config/makefiles/makeutils.mk \ |
|
89 $(topsrcdir)/config/makefiles/autotargets.mk \ |
|
90 $(srcdir)/check-autotargets.mk \ |
|
91 $(eval include $(srcdir)/check-autotargets.mk) \ |
|
92 $(NULL) |
|
93 |
|
94 $(check-autotargets): $(check-autotargets-preqs) |
|
95 @$(TOUCH) $@ |
|
96 # </CHECK: autotargets.mk> |
|
97 |
|
98 endif #} findstring MAKECMDGOAL |