-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
104 lines (83 loc) · 2.06 KB
/
Makefile
File metadata and controls
104 lines (83 loc) · 2.06 KB
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
.SUFFIXES: .cd .d $(SUFFIXES)
OS=$(shell uname)
ifdef MXE
MXE_32bit=$(shell if which i686-w64-mingw32.static-g++>&/dev/null; then echo 1; fi)
MXE_64bit_static=$(shell if which x86_64-w64-mingw32.static-g++>&/dev/null; then echo 1; fi)
MXE_64bit_shared=$(shell if which x86_64-w64-mingw32.shared-g++>&/dev/null; then echo 1; fi)
ifeq ($(MXE_32bit),1)
MXE_PREFIX=i686-w64-mingw32.static
else
ifeq ($(MXE_64bit_static),1) # prefer static to shared
MXE_PREFIX=x86_64-w64-mingw32.static
else
ifeq ($(MXE_64bit_shared),1)
MXE_PREFIX=x86_64-w64-mingw32.shared
else
$(error "MXE compiler not found")
endif
endif
endif
CC=$(MXE_PREFIX)-gcc
CXX=$(MXE_PREFIX)-g++
FLAGS=-DWIN32
else
ifdef CPLUSPLUS
CXX=$(CPLUSPLUS)
else
CXX=g++
endif
CC=gcc
FLAGS=-fPIC -isystem /usr/local/include -isystem /opt/local/include
endif #ifdef MXE
RAVELRELEASE=$(shell git describe)
export FPIC=1
export CPLUSPLUS
export CLASSDESC
export EXTRA_FLAGS
export DEBUG
ifneq ($(MAKECMDGOALS),clean)
$(warning $(MAKE) $(JOBS) $(MAKEOVERRIDES))
build_civita:=$(shell if cd civita && $(MAKE) $(JOBS) $(MAKEOVERRIDES) >build.log 2>&1; then echo civita built; fi)
$(warning $(build_civita))
ifneq ($(strip $(build_civita)),civita built)
$(error Making Civita failed; check civita/build.log)
endif
endif
FLAGS+=-Icivita
CXXFLAGS=-std=c++17
VPATH=civita
ifeq ($(OS),Darwin)
FLAGS+=-isystem /usr/local/include -isystem /opt/local/include
endif
ifdef DEBUG
OPT=-g
else
OPT=-O3 -DNDEBUG
endif
ifdef FPIC
OPT+=-fPIC
endif
ifdef GCOV
FLAGS+=-fprofile-arcs -ftest-coverage
endif
OBJS=ravelState.o CSVTools.o dynamicRavelCAPI.o
all: testCAPI.o libravelCAPI.a civita/libcivita.a
libravelCAPI.a: $(OBJS)
ar r $@ $^
civita/libcivita.a:
cd civita && $(MAKE) $(MAKEOVERRIDES)
.cc.o:
$(CXX) -c $(FLAGS) $(CXXFLAGS) $(OPT) -o $@ $<
.c.o:
$(CC) -c $(FLAGS) $(OPT) -o $@ $<
.c.d:
$(CC) $(FLAGS) -MM -MG $< >$@
.cc.d:
$(CXX) $(FLAGS) $(CXXFLAGS) -MM -MG $< >$@
ifneq ($(MAKECMDGOALS),clean)
include $(OBJS:.o=.d)
include testCAPI.d
endif
clean:
-rm *.o *.d *.cd *.a *~ \#*
cd civita && $(MAKE) clean