forked from lanl/APPFL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
90 lines (77 loc) · 4.07 KB
/
Makefile
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
ifdef BUILD_NTHREADS
build_flags := -j$(BUILD_NTHREADS)
endif
# APPFL haskell Prelude + Base
HSLIB_FILES := $(shell find prelude/APPFL/ -type f -name '*.hs')
build_dir := $(CURDIR)/build
.PHONY: all config setup codegen runtime test tastytest ctest _ctest clean
all: codegen runtime
config:
@(cd codegen && cabal configure)
setup: prelude/Prelude.stg prelude/Prelude.mhs options.h $(HSLIB_FILES)
@((test -d $(build_dir)) || (mkdir $(build_dir)))
@((test -d $(build_dir)/bin) || (mkdir $(build_dir)/bin))
@((test -d $(build_dir)/etc) || (mkdir $(build_dir)/etc))
@((test -d $(build_dir)/include) || (mkdir $(build_dir)/include))
@(cp -f prelude/Prelude.stg $(build_dir)/etc/)
@(cp -f prelude/Prelude.mhs $(build_dir)/etc/)
@(cp -f prelude/AppflPrelude.hs $(build_dir)/etc/)
@(cp -fr prelude/APPFL $(build_dir)/etc/)
@(cp -f options.h $(build_dir)/include/)
codegen: setup
@(cd codegen && cabal configure && cabal build $(build_flags))
@(cp -f codegen/dist/build/appfl/appfl $(build_dir)/bin/)
runtime: setup
@(cd $(build_dir); cmake $(cmake_flags) ..)
@(cd $(build_dir); $(MAKE) $(build_flags))
test: ctest
ctest: all
$(MAKE) _ctest
_ctest:
@(cd $(build_dir); cmake $(cmake_flags) ..)
@(cd $(build_dir) && ARGS="$(build_flags) -D ExperimentalTest --no-compress-output" $(MAKE) test && cp Testing/`head -n 1 Testing/TAG`/Test.xml ./CTestResults.xml)
clean:
@(cd codegen && cabal clean)
@(cd test/stg && rm -f *.stg.c 2>/dev/null)
@(cd test/stg/error && rm -f *.stg.c 2>/dev/null)
@(cd test/stg/nonstrict && rm -f *.stg.c 2>/dev/null)
@(cd test/stg/nonstrict/timeout && rm -f *.stg.c 2>/dev/null)
@(cd test/stg/nostrict2 && rm -f *.stg.c 2>/dev/null)
@(cd test/mhs && rm -f *.mhs.c 2>/dev/null)
@(cd test/hs && rm -f *.hs.c 2>/dev/null)
@(cd test/hs/error && rm -f *.hs.c 2>/dev/null)
@(rm -rf $(build_dir))
multi:
@echo "USE_ARGTYPE=0 && USE_OBJTYPE=0"
$(MAKE) clean && $(MAKE) setup
@(cd codegen && cabal configure -f useD && cabal build $(build_flags))
@(cp -f codegen/dist/build/appfl/appfl $(build_dir)/bin/)
@(cd $(build_dir); cmake $(cmake_flags) -DUSE_D:BOOL=ON ..)
@(cd $(build_dir); $(MAKE) $(build_flags))
@(echo "#undef USE_ARGTYPE\n#define USE_ARGTYPE 0\n#undef USE_OBJTYPE\n#define USE_OBJTYPE 0\n" >> $(build_dir)/include/options.h)
@(cd $(build_dir) && ARGS="$(build_flags) -D ExperimentalTest --no-compress-output" $(MAKE) test)
@echo "USE_ARGTYPE=1 && USE_OBJTYPE=0"
$(MAKE) clean && $(MAKE) setup
@(cd codegen && cabal configure -f useD -fargType && cabal build $(build_flags))
@(cp -f codegen/dist/build/appfl/appfl $(build_dir)/bin/)
@(cd $(build_dir); cmake $(cmake_flags) -DUSE_D:BOOL=ON -DUSE_ARGTYPE:BOOL=ON ..)
@(cd $(build_dir); $(MAKE) $(build_flags))
@(echo "#undef USE_ARGTYPE\n#define USE_ARGTYPE 1\n#undef USE_OBJTYPE\n#define USE_OBJTYPE 0\n" >> $(build_dir)/include/options.h)
@(cd $(build_dir) && ARGS="$(build_flags) -D ExperimentalTest --no-compress-output" $(MAKE) test)
@echo "USE_ARGTYPE=0 && USE_OBJTYPE=1"
$(MAKE) clean && $(MAKE) setup
@(cd codegen && cabal configure -f useD -fobjType && cabal build $(build_flags))
@(cp -f codegen/dist/build/appfl/appfl $(build_dir)/bin/)
@(cd $(build_dir); cmake $(cmake_flags) -DUSE_D:BOOL=ON -DUSE_OBJTYPE:BOOL=ON ..)
@(cd $(build_dir); $(MAKE) $(build_flags))
@(echo "#undef USE_ARGTYPE\n#define USE_ARGTYPE 0\n#undef USE_OBJTYPE\n#define USE_OBJTYPE 1\n" >> $(build_dir)/include/options.h)
@(cd $(build_dir) && ARGS="$(build_flags) -D ExperimentalTest --no-compress-output" $(MAKE) test)
@echo "USE_ARGTYPE=1 && USE_OBJTYPE=1"
$(MAKE) clean && $(MAKE) setup
@(cd codegen && cabal configure -f useD -fargType -fobjType && cabal build $(build_flags))
@(cp -f codegen/dist/build/appfl/appfl $(build_dir)/bin/)
@(cd $(build_dir); cmake $(cmake_flags) -DUSE_D:BOOL=ON -DUSE_ARGTYPE:BOOL=ON -DUSE_OBJTYPE:BOOL=ON ..)
@(cd $(build_dir); $(MAKE) $(build_flags))
@(echo "#undef USE_ARGTYPE\n#define USE_ARGTYPE 1\n#undef USE_OBJTYPE\n#define USE_OBJTYPE 1\n" >> $(build_dir)/include/options.h)
@(cd $(build_dir) && ARGS="$(build_flags) -D ExperimentalTest --no-compress-output" $(MAKE) test)
$(MAKE) clean