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