-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile.global
More file actions
199 lines (152 loc) · 4.18 KB
/
Makefile.global
File metadata and controls
199 lines (152 loc) · 4.18 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#--*- makefile -*--------------------------------------------------------------
#
# Standard makefile - global information
#
# This file should be included in all other Makefiles
# used in the project. It contains such important
# information as which compiler to use etc.
#
# The idea is, that the user may call in his makefile:
# * "make" or
# "make debug=1" to make a debug version of the project
# * "make fast=1" to make a fast version without debug information
# * "make profile=1" to make a version with profiling information
# * "make verbose=1" to make with different levels of verbosity
# "make verbose=2"
# "make verbose=3"
# "make test=1" to compile unit tests as well
#------------------------------------------------------------------------------
#
# Compiler and path to compiler
#
# specifies the version of the compiler to use
#
CC=g++
#
# Important compile flags
#
# These flags should always be used.
STANDARDFLAGS = -Wall -ansi -pedantic -DNEXCEPTIONS -DLINUX -c
DEBUGFLAGS = -g
NORMALFLAGS = $(DEBUGFLAGS)
FASTFLAGS = -O3 -ffast-math -DNDEBUG -ftemplate-depth-36
QUICKFLAGS = -DNDEBUG
USERFLAGS = $(STANDARDFLAGS) $(NORMALFLAGS)
ifdef profile
PROFILE = -pg -fno-inline -DNDEBUG
USERFLAGS = $(STANDARDFLAGS) $(DEBUGFLAGS) $(PROFILE)
else
ifdef fast
USERFLAGS = $(STANDARDFLAGS) $(FASTFLAGS)
else
ifdef debug
USERFLAGS = $(STANDARDFLAGS) $(DEBUGFLAGS)
else
ifdef nopost
USERFLAGS += -DNOPOST
else
USERFLAGS = $(STANDARDFLAGS) $(FASTFLAGS)
endif
endif
endif
endif
ifdef static
USERFLAGS += -static
endif
ifeq ($(verbose), 1)
USERFLAGS += -DVERBOSE=1
endif
ifeq ($(verbose), 2)
USERFLAGS += -DVERBOSE=2
endif
ifeq ($(verbose), 3)
USERFLAGS += -DVERBOSE=3
endif
CFLAGS = $(USERFLAGS)
#
# Tools
#
ARCHIVER = ar
ARCHIVEFLAGS = rvs
MAKE = make
MAKEDEPEND = $(CC) -M
#
# Remove
#
RM = /bin/rm -f
RMDIR = /bin/rm -rf
#
# Global libraries and paths
#
# Path to subdirectories.
SUBDIRS += _dummy_
LIB_PATH += -L$(UPDIR)/lib
INC_PATH += -I$(UPDIR)/tools -I$(UPDIR)/Energy/Sources -I$(UPDIR)/Biopool/Sources -I$(UPDIR)/Energy/Sources/TorsionPotential -I$(UPDIR)/Lobo/Sources -I$(UPDIR)/Align2/Sources -I$(UPDIR)/Biopool/APPS -I$(UPDIR)/Energy/APPS -I$(UPDIR)/Align2/APPS -I$(UPDIR)/Lobo/APPS
ifdef test
INC_PATH += -I$(UPDIR)/Biopool/Tests -I$(UPDIR)/Energy/Tests -I$(UPDIR)/Align2/Tests -I$(UPDIR)/Lobo/Tests
SUBDIRS = Biopool/Tests Energy/Tests Align2/Tests Lobo/Tests
endif
####### Implicit rules
.SUFFIXES: .c .cc .cpp
.cc.o:
$(CC) $(CFLAGS) $(INC_PATH) -c $< -o $*.o -Wno-reorder -Wno-uninitialized -Wno-write-strings -Wno-narrowing
.c.o:
$(CC) $(CFLAGS) $(INC_PATH) -c $< -o $*.o -Wno-reorder -Wno-uninitialized -Wno-write-strings -Wno-narrowing
.cpp.o:
$(CC) $(CFLAGS) $(INC_PATH) -c $< -o $*.o -Wno-reorder -Wno-uninitialized -Wno-write-strings -Wno-narrowing
######## Build rules
all: $(LIBRARY) $(TARGETS)
$(TARGETS): %: %.o $(LIBRARY)
$(CC) $(PROFILE) $@.o -o $@ $(LIB_PATH) $(LIBS) -Wno-reorder -Wno-uninitialized -Wno-write-strings
$(LIBRARY): $(OBJECTS)
$(ARCHIVER) $(ARCHIVEFLAGS) $(LIBRARY) $(OBJECTS)
.PHONY: clean
clean:
$(RM) *~ *.bak *.o *.a core $(TARGETS)
Depend:
touch Depend
depend:
$(MAKEDEPEND) $(CFLAGS) $(INC_PATH) $(SOURCES) > Depend
subdirs:
@for i in $(SUBDIRS) ; do \
if [ $$i = "_dummy_" ]; then \
continue ; \
fi; \
$(MAKE) -C $$i "SUBDIR = $$i"; \
done
subdepend:
@for i in $(SUBDIRS) ; do \
if [ $$i = "_dummy_" ]; then \
continue ; \
fi; \
echo $$i; \
$(MAKE) -C $$i "SUBDIR = $$i" depend; \
done
subclean:
@for i in $(SUBDIRS) ; do \
if [ $$i = "_dummy_" ]; then \
continue ; \
fi; \
$(MAKE) -C $$i "SUBDIR = $$i" clean; \
done
$(RM) -rf lib
$(RM) -rf bin
$(RM) -f ./Biopool/data/*
$(RM) -f ./Energy/data/*
$(RM) -fr ./Lobo/data/*
$(RM) -fr ./Energy/data
$(RM) -fr ./Lobo/data
$(RM) -fr ./Biopool/data
subinstall:
@for i in $(SUBDIRS) ; do \
if [ $$i = "_dummy_" ]; then \
continue ; \
fi; \
$(MAKE) -C $$i "SUBDIR = $$i" install; \
done
#
# Export all variables to sub-makes by default
#
#
# Include dependencies
#