-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
116 lines (98 loc) · 3.71 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#
# Makefile for CRAVA
#
include Makeheader
DIRS = src libs libs/lib libs/boost libs/fft/fftw libs/fft/rfftw rplib
OBJDIR = obj
OBJLIBDIR = obj/libs/lib
OBJFFTDIR = obj/libs/fft
OBJFLENSDIR = obj/libs/flens
OBJBOOSTDIR = obj/libs/boost
OBJNRLIBDIR = obj/libs/nrlib
OBJGRAMMAR = findgrammar/findgrammar.o \
$(OBJNRLIBDIR)/iotools/fileio.o \
$(OBJNRLIBDIR)/tinyxml/tinyxml.o \
$(OBJNRLIBDIR)/tinyxml/tinyxmlerror.o \
$(OBJNRLIBDIR)/tinyxml/tinyxmlparser.o \
$(OBJBOOSTDIR)/system/error_code.o \
$(OBJBOOSTDIR)/filesystem/path.o \
$(OBJBOOSTDIR)/filesystem/operations.o \
$(OBJBOOSTDIR)/filesystem/portability.o
OBJCOMPARE = compare_storm_binary_volumes/compare.o \
$(OBJNRLIBDIR)/iotools/fileio.o \
$(OBJNRLIBDIR)/iotools/stringtools.o \
$(OBJNRLIBDIR)/stormgrid/stormcontgrid.o \
$(OBJNRLIBDIR)/volume/volume.o \
$(OBJNRLIBDIR)/surface/surfaceio.o \
$(OBJNRLIBDIR)/math/constants.o \
$(OBJBOOSTDIR)/system/error_code.o \
$(OBJBOOSTDIR)/filesystem/path.o \
$(OBJBOOSTDIR)/filesystem/operations.o \
$(OBJBOOSTDIR)/filesystem/portability.o
INCLUDE = -I. -I./libs -I./libs/nrlib -I./libs/flens -I./libs/fft/include
CPPFLAGS += $(INCLUDE)
all: $(PROGRAM)
comp: $(COMPARE)
$(PROGRAM): $(DIRS) main.o
$(PURIFY) $(CXX) $(OBJDIR)/*.o $(OBJLIBDIR)/*.o $(OBJNRLIBDIR)/*/*.o $(OBJFFTDIR)/*.o $(OBJBOOSTDIR)/*/*.o $(OBJFLENSDIR)/*.o main.o $(LFLAGS) -o $@
$(GRAMMAR): findgrammar/findgrammar.o
$(PURIFY) $(CXX) $(OBJGRAMMAR) $(LFLAGS) -o $@
$(COMPARE): compare_storm_binary_volumes/compare.o
$(PURIFY) $(CXX) $(OBJCOMPARE) $(LFLAGS) -o $@
$(OBJDIR):
install -d $(OBJDIR)
$(OBJFFTDIR):
install -d $(OBJFFTDIR)
.PHONY: clean $(DIRS)
$(DIRS): $(OBJDIR) $(OBJFFTDIR)
cd $@ && $(MAKE)
clean:
rm -f $(OBJDIR)/*.o
rm -f $(PROGRAM) main.o
cleanlib:
rm -f $(OBJDIR)/*.o
rm -f $(OBJLIBDIR)/*.o
rm -f $(OBJNRLIBDIR)/*/*.o
rm -f $(OBJBOOSTDIR)/*/*.o
rm -f $(OBJFLENSDIR)/*.o
rm -f $(PROGRAM) main.o
cleanall:
rm -f $(OBJDIR)/*.o
rm -f $(OBJLIBDIR)/*.o
rm -f $(OBJFFTDIR)/*.o
rm -f $(OBJNRLIBDIR)/*/*.o
rm -f $(OBJBOOSTDIR)/*/*.o
rm -f $(OBJFLENSDIR)/*.o
rm -f $(OBJGRAMMAR)/*.o
rm -f $(OBJCOMPARE)/*.o
rm -f $(GRAMMAR) findgrammar/findgrammar.o
rm -f $(COMPARE) compare_storm_binary_volumes/compare.o
rm -f $(PROGRAM) main.o
test: $(PROGRAM) $(GRAMMAR) $(COMPARE)
cd test_suite; chmod +x TestScript.pl; perl -s ./TestScript.pl ../$(PROGRAM) $(passive) $(case); cd ..
help:
@echo ''
@echo 'Usage: make type [mode=...] [case=...] [passive=...] [at=...]'
@echo ''
@echo 'types'
@echo ' clean : Remove object files generated from src'
@echo ' cleanlib : Remove object files generated from src + boost + flens + NRLib'
@echo ' cleanall : Remove object files generated from src + boost + flens + NRLib + fft'
@echo ' test : Run CRAVA in test suite'
@echo ' all : Make CRAVA'
@echo ''
@echo 'modes'
@echo ' debug : Compile and link with -g -O0'
@echo ' profile : Compile and link with -g -pg'
@echo ' purify : Compile and link with -g -p0 and link with purify. Executable becomes cravarun.purify'
@echo ''
@echo 'passive'
@echo ' yes : Run test suite in passive mode (do not run CRAVA)'
@echo ''
@echo 'parallel'
@echo ' yes : Compile for parallelization'
@echo ''
@echo 'case'
@echo ' n : Comma-separated list of test case numbers (number given first in the test case'
@echo ' directory name) or a range give as 1-5'
@echo ''