|
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 |
|
8 ########################################################################### |
|
9 ## Intent: Standalone unit tests for makefile rules and target logic |
|
10 ########################################################################### |
|
11 |
|
12 deps =$(NULL) |
|
13 tgts =$(NULL) |
|
14 |
|
15 ifdef VERBOSE |
|
16 tgts += show |
|
17 endif |
|
18 |
|
19 # Define macros |
|
20 include $(topsrcdir)/config/makefiles/makeutils.mk |
|
21 include $(topsrcdir)/config/makefiles/autotargets.mk |
|
22 |
|
23 ########################## |
|
24 ## Verify threadsafe mkdir |
|
25 ########################## |
|
26 ifdef deps_mkdir_bycall |
|
27 deps += $(call mkdir_deps,deps_mkdir_bycall) |
|
28 tgts += check_mkdir |
|
29 endif |
|
30 ifdef deps_mkdir_bydep |
|
31 deps += $(foreach dir,$(deps_mkdir_bydep),$(dir)/.mkdir.done) |
|
32 tgts += check_mkdir |
|
33 endif |
|
34 ifdef deps_mkdir_bygen |
|
35 GENERATED_DIRS += $(deps_mkdir_bygen) |
|
36 tgts += check_mkdir |
|
37 endif |
|
38 |
|
39 ########################### |
|
40 ## Minimal environment load |
|
41 ########################### |
|
42 MKDIR ?= mkdir -p |
|
43 TOUCH ?= touch |
|
44 |
|
45 INCLUDED_CONFIG_MK = 1 |
|
46 include $(topsrcdir)/config/rules.mk |
|
47 |
|
48 ##-------------------## |
|
49 ##---] TARGETS [---## |
|
50 ##-------------------## |
|
51 all:: |
|
52 |
|
53 # Quarks: |
|
54 # o Use of 'all' would trigger export target processing |
|
55 checkup: $(tgts) |
|
56 |
|
57 # AUTO_DEPS - verify GENERATED_DIRS |
|
58 check_mkdir: $(deps) $(AUTO_DEPS) |
|
59 |
|
60 show: |
|
61 @echo "tgts=[$(tgts)]" |
|
62 @echo "deps=[$(deps)]" |
|
63 find $(dir $(deps)) -print |