forked from GRTLCollaboration/GRChombo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
53 lines (37 loc) · 1.42 KB
/
GNUmakefile
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
define SEARCH_FOR_MAKE
$(wildcard $1/*/GNUmakefile) $(wildcard $1/*/makefile) $(wildcard $1/*/Makefile)
endef
TestDirsWithGNUmakefile := $(call SEARCH_FOR_MAKE, Tests)
TestDirs := $(dir $(TestDirsWithGNUmakefile))
RunTestDirs := $(TestDirs:%=run-%)
ExampleDirsWithGNUmakefile := $(call SEARCH_FOR_MAKE, Examples)
ExampleDirs := $(dir $(ExampleDirsWithGNUmakefile))
CleanTestDirs := $(TestDirs:%=clean-%)
CleanExampleDirs := $(ExampleDirs:%=clean-%)
RealCleanTestDirs := $(TestDirs:%=realclean-%)
RealCleanExampleDirs := $(ExampleDirs:%=realclean-%)
.PHONY: all run examples clean realclean $(TestDirs) $(ExampleDirs)
export GRCHOMBO_SOURCE = $(shell pwd)/Source
test: $(TestDirs)
run: test $(RunTestDirs)
examples: $(ExampleDirs)
all: run examples
clean: $(CleanTestDirs) $(CleanExampleDirs)
realclean: $(RealCleanTestDirs) $(RealCleanExampleDirs)
$(TestDirs):
$(info ################# Making test $@ #################)
$(MAKE) -C $@ all
$(RunTestDirs):
$(info ################# Running test $@ #################)
$(MAKE) -C $(@:run-%=%) run
$(ExampleDirs):
$(info ################# Making example $@ #################)
$(MAKE) -C $@ all
$(CleanTestDirs):
$(MAKE) -C $(@:clean-%=%) clean NODEPENDS=TRUE
$(CleanExampleDirs):
$(MAKE) -C $(@:clean-%=%) clean NODEPENDS=TRUE
$(RealCleanTestDirs):
$(MAKE) -C $(@:realclean-%=%) realclean NODEPENDS=TRUE
$(RealCleanExampleDirs):
$(MAKE) -C $(@:realclean-%=%) realclean NODEPENDS=TRUE