Skip to content
Newer
Older
100644 314 lines (292 sloc) 7.11 KB
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
1 ifdef SystemRoot
2 OS = "Windows"
2eddd6f @Dav1dde updated makefile
authored Dec 11, 2011
3 STATIC_LIB_EXT = .lib
4 DYNAMIC_LIB_EXT = .dll
4258320 @Dav1dde one more makefile update
authored Dec 11, 2011
5 PATH_SEP =\
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
6 message = @(echo $1)
3166e69 @Dav1dde updated Makefile
authored Jan 18, 2012
7 SHELL = cmd.exe
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
8 Filter = %/linux/%.d %/darwin/%.d %/freebsd/%.d %/solaris/%.d
9 getSource =$(shell dir $(ROOT_SOURCE_DIR) /s /b)
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
10 else
3166e69 @Dav1dde updated Makefile
authored Jan 18, 2012
11 SHELL = sh
4258320 @Dav1dde one more makefile update
authored Dec 11, 2011
12 PATH_SEP =/
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
13 getSource =$(shell find $(ROOT_SOURCE_DIR) -name "*.d")
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
14 ifeq ($(shell uname), Linux)
15 OS = "Linux"
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
16 STATIC_LIB_EXT = .a
17 DYNAMIC_LIB_EXT = .so
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
18 message = @(echo \033[31m $1 \033[0;0m1)
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
19 Filter = %/win32/%.d %/darwin/%.d %/freebsd/%.d %/solaris/%.d
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
20 else ifeq ($(shell uname), Solaris)
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
21 STATIC_LIB_EXT = .a
22 DYNAMIC_LIB_EXT = .so
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
23 OS = "Solaris"
24 message = @(echo \033[31m $1 \033[0;0m1)
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
25 Filter = %/win32/%.d %/linux/%.d %/darwin/%.d %/freebsd/%.d
26 else ifeq ($(shell uname),Freebsd)
27 STATIC_LIB_EXT = .a
28 DYNAMIC_LIB_EXT = .so
29 OS = "Freebsd"
30 message = @(echo \033[31m $1 \033[0;0m1)
31 Filter = %/win32/%.d %/linux/%.d %/darwin/%.d %/solaris/%.d
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
32 else ifeq ($(shell uname),Darwin)
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
33 STATIC_LIB_EXT = .a
34 DYNAMIC_LIB_EXT = .so
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
35 OS = "Darwin"
36 message = @(echo \033[31m $1 \033[0;0m1)
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
37 Filter = %/win32/%.d %/linux/%.d %/freebsd/%.d %/solaris/%.d
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
38 endif
39 endif
a92915a @Dav1dde makefile update
authored Dec 13, 2011
40
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
41 # Define command for copy, remove and create file/dir
42 ifeq ($(OS),"Windows")
43 RM = del /Q
44 CP = copy /Y
45 MKDIR = mkdir
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
46 MV = move
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
47 LN = mklink
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
48 else ifeq ($(OS),"Linux")
4258320 @Dav1dde one more makefile update
authored Dec 11, 2011
49 RM = rm -fr
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
50 CP = cp -fr
51 MKDIR = mkdir -p
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
52 MV = mv
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
53 LN = ln -s
54 else ifeq ($(OS),"Freebsd")
55 RM = rm -fr
56 CP = cp -fr
57 MKDIR = mkdir -p
58 MV = mv
59 LN = ln -s
60 else ifeq ($(OS),"Solaris")
61 RM = rm -fr
62 CP = cp -fr
63 MKDIR = mkdir -p
64 MV = mv
65 LN = ln -s
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
66 else ifeq ($(OS),"Darwin")
4258320 @Dav1dde one more makefile update
authored Dec 11, 2011
67 RM = rm -fr
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
68 CP = cp -fr
69 MKDIR = mkdir -p
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
70 MV = mv
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
71 LN = ln -s
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
72 endif
a92915a @Dav1dde makefile update
authored Dec 13, 2011
73
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
74 # If compiler is not define try to find it
75 ifndef DC
76 ifneq ($(strip $(shell which dmd 2>/dev/null)),)
77 DC=dmd
78 else ifneq ($(strip $(shell which ldc 2>/dev/null)),)
79 DC=ldc
80 else ifneq ($(strip $(shell which ldc2 2>/dev/null)),)
81 DC=ldc2
82 else
83 DC=gdc
84 endif
85 endif
a92915a @Dav1dde makefile update
authored Dec 13, 2011
86
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
87 # Define flag for gdc other
88 ifeq ($(DC),gdc)
8370599 @holtrop update gdc compile flags
holtrop authored Oct 28, 2013
89 DCFLAGS = -O2
90 LINKERFLAG= -Wl,
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
91 OUTPUT = -o
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
92 HF = -fintfc-file=
93 DF = -fdoc-file=
94 NO_OBJ = -fsyntax-only
95 DDOC_MACRO= -fdoc-inc=
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
96 else
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
97 DCFLAGS = -O -d
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
98 LINKERFLAG= -L
99 OUTPUT = -of
8ed621f @Dav1dde make ddoc works now
authored Dec 5, 2011
100 HF = -Hf
101 DF = -Df
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
102 NO_OBJ = -o-
103 DDOC_MACRO=
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
104 endif
a92915a @Dav1dde makefile update
authored Dec 13, 2011
105
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
106 #define a suffix lib who inform is build with which compiler, name of phobos lib
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
107 ifeq ($(DC),gdc)
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
108 COMPILER = gdc
109 VERSION = -fversion
110 SONAME_FLAG = $(LINKERFLAG) -soname
111 PHOBOS = gphobos2
112 DRUNTIME = gdruntime
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
113 else ifeq ($(DC),gdmd)
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
114 COMPILER = gdc
115 VERSION = -fversion
116 SONAME_FLAG = $(LINKERFLAG) -soname
117 PHOBOS = gphobos2
118 DRUNTIME = gdruntime
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
119 else ifeq ($(DC),ldc)
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
120 COMPILER = ldc
121 VERSION = -d-version
122 SONAME_FLAG = -soname
123 PHOBOS = phobos-ldc
124 DRUNTIME = druntime-ldc
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
125 else ifeq ($(DC),ldc2)
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
126 COMPILER = ldc
127 VERSION = -d-version
128 SONAME_FLAG = -soname
129 PHOBOS = phobos-ldc
130 DRUNTIME = druntime-ldc
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
131 else ifeq ($(DC),ldmd)
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
132 COMPILER = ldc
133 VERSION = -d-version
134 SONAME_FLAG = -soname
135 PHOBOS = phobos2-ldc
136 DRUNTIME = druntime-ldc
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
137 else ifeq ($(DC),dmd)
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
138 COMPILER = dmd
139 VERSION = -version
140 SONAME_FLAG = $(LINKERFLAG)-soname
141 PHOBOS = phobos2
142 DRUNTIME = druntime
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
143 else ifeq ($(DC),dmd2)
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
144 COMPILER = dmd
145 VERSION = -d-version
146 SONAME_FLAG = $(LINKERFLAG)-soname
147 PHOBOS = phobos2
148 DRUNTIME = druntime
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
149 endif
a92915a @Dav1dde makefile update
authored Dec 13, 2011
150
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
151 # Define relocation model for ldc or other
152 ifneq (,$(findstring ldc,$(DC)))
153 FPIC = -relocation-model=pic
154 else
155 FPIC = -fPIC
156 endif
a92915a @Dav1dde makefile update
authored Dec 13, 2011
157
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
158 # Add -ldl flag for linux
159 ifeq ($(OS),"Linux")
1fb5a4a @Dav1dde minor makefile bugfixes introduced with pull #10
authored Aug 13, 2012
160 LDCFLAGS += $(LINKERFLAG)-ldl
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
161 endif
a92915a @Dav1dde makefile update
authored Dec 13, 2011
162
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
163 # If model are not given take the same as current system
164 ifndef ARCH
165 ifeq ($(OS),"Windows")
166 ifeq ($(PROCESSOR_ARCHITECTURE), x86)
167 ARCH = x86
168 else
169 ARCH = x86_64
170 endif
171 else
1fb5a4a @Dav1dde minor makefile bugfixes introduced with pull #10
authored Aug 13, 2012
172 ARCH = $(shell arch 2>/dev/null || uname -m)
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
173 endif
174 endif
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
175 ifndef MODEL
176 ifeq ($(ARCH), x86_64)
177 MODEL = 64
178 else
179 MODEL = 32
180 endif
181 endif
a92915a @Dav1dde makefile update
authored Dec 13, 2011
182
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
183 ifeq ($(MODEL), 64)
a92915a @Dav1dde makefile update
authored Dec 13, 2011
184 DCFLAGS += -m64
185 LDCFLAGS += -m64
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
186 else
a92915a @Dav1dde makefile update
authored Dec 13, 2011
187 DCFLAGS += -m32
188 LDCFLAGS += -m32
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
189 endif
a92915a @Dav1dde makefile update
authored Dec 13, 2011
190
3166e69 @Dav1dde updated Makefile
authored Jan 18, 2012
191 ifndef DESTDIR
192 DESTDIR =
193 endif
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
194
4258320 @Dav1dde one more makefile update
authored Dec 11, 2011
195 # Define var PREFIX, BIN_DIR, LIB_DIR, INCLUDE_DIR, DATA_DIR
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
196 ifndef PREFIX
a92915a @Dav1dde makefile update
authored Dec 13, 2011
197 ifeq ($(OS),"Windows")
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
198 PREFIX = $(PROGRAMFILES)
172fe0f @Dav1dde updated makefile
authored Dec 5, 2011
199 else ifeq ($(OS), "Linux")
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
200 PREFIX = /usr/local
172fe0f @Dav1dde updated makefile
authored Dec 5, 2011
201 else ifeq ($(OS), "Darwin")
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
202 PREFIX = /usr/local
203 endif
204 endif
4258320 @Dav1dde one more makefile update
authored Dec 11, 2011
205
206 ifndef BIN_DIR
a92915a @Dav1dde makefile update
authored Dec 13, 2011
207 ifeq ($(OS), "Windows")
4258320 @Dav1dde one more makefile update
authored Dec 11, 2011
208 BIN_DIR = $(PROGRAMFILES)\$(PROJECT_NAME)\bin
209 else ifeq ($(OS), "Linux")
210 BIN_DIR = $(PREFIX)/bin
211 else ifeq ($(OS), "Darwin")
212 BIN_DIR = $(PREFIX)/bin
213 endif
214 endif
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
215 ifndef LIB_DIR
a92915a @Dav1dde makefile update
authored Dec 13, 2011
216 ifeq ($(OS), "Windows")
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
217 LIB_DIR = $(PREFIX)\$(PROJECT_NAME)\lib
218 else ifeq ($(OS), "Linux")
219 LIB_DIR = $(PREFIX)/lib
220 else ifeq ($(OS), "Darwin")
221 LIB_DIR = $(PREFIX)/lib
222 endif
223 endif
4258320 @Dav1dde one more makefile update
authored Dec 11, 2011
224
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
225 ifndef INCLUDE_DIR
a92915a @Dav1dde makefile update
authored Dec 13, 2011
226 ifeq ($(OS), "Windows")
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
227 INCLUDE_DIR = $(PROGRAMFILES)\$(PROJECT_NAME)\import
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
228 else
229 INCLUDE_DIR = $(PREFIX)/include/d/
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
230 endif
231 endif
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
232
233 ifndef DATA_DIR
a92915a @Dav1dde makefile update
authored Dec 13, 2011
234 ifeq ($(OS), "Windows")
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
235 DATA_DIR = $(PROGRAMFILES)\$(PROJECT_NAME)\data
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
236 else
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
237 DATA_DIR = $(PREFIX)/share
238 endif
239 endif
240
241 ifndef PKGCONFIG_DIR
a92915a @Dav1dde makefile update
authored Dec 13, 2011
242 ifeq ($(OS), "Windows")
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
243 PKGCONFIG_DIR = $(PROGRAMFILES)\$(PROJECT_NAME)\data
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
244 else
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
245 PKGCONFIG_DIR = $(DATA_DIR)/pkgconfig
246 endif
247 endif
a92915a @Dav1dde makefile update
authored Dec 13, 2011
248
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
249 ifndef CC
250 CC = gcc
251 endif
a92915a @Dav1dde makefile update
authored Dec 13, 2011
252
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
253 DLIB_PATH = ./lib
254 IMPORT_PATH = ./import
255 DOC_PATH = ./doc
256 DDOC_PATH = ./ddoc
257 BUILD_PATH = ./build
a92915a @Dav1dde makefile update
authored Dec 13, 2011
258
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
259 DCFLAGS_IMPORT =
a92915a @Dav1dde makefile update
authored Dec 13, 2011
260 DCFLAGS_LINK = $(LDCFLAGS)
261
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
262 STATIC_LIBNAME = lib$(PROJECT_NAME)-$(COMPILER)$(STATIC_LIB_EXT)
263 SHARED_LIBNAME = lib$(PROJECT_NAME)-$(COMPILER)$(DYNAMIC_LIB_EXT)
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
264
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
265 PKG_CONFIG_FILE = $(PROJECT_NAME).pc
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
266
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
267 MAKE = make
268 AR = ar
269 ARFLAGS = rcs
270 RANLIB = ranlib
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
271
272 export AR
273 export ARCH
274 export ARFLAGS
4258320 @Dav1dde one more makefile update
authored Dec 11, 2011
275 export BIN_DIR
276 export BUILD_PATH
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
277 export CC
278 export COMPILER
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
279 export CP
280 export DATA_DIR
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
281 export DC
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
282 export DF
a92915a @Dav1dde makefile update
authored Dec 13, 2011
283 export DCFLAGS
284 export DCFLAGS_IMPORT
285 export DCFLAGS_LINK
3166e69 @Dav1dde updated Makefile
authored Jan 18, 2012
286 export DESTDIR
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
287 export DLIB_PATH
288 export DOC_PATH
4258320 @Dav1dde one more makefile update
authored Dec 11, 2011
289 export DDOC_PATH
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
290 export DYNAMIC_LIB_EXT
291 export FixPath
292 export HF
293 export INCLUDE_DIR
294 export IMPORT_PATH
a92915a @Dav1dde makefile update
authored Dec 13, 2011
295 export LDCFLAGS
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
296 export FPIC
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
297 export LIBNAME
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
298 export LIB_DIR
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
299 export LINKERFLAG
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
300 export message
301 export MAKE
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
302 export MKDIR
303 export MODEL
304 export MV
305 export OUTPUT
306 export OS
4258320 @Dav1dde one more makefile update
authored Dec 11, 2011
307 export PATH_SEP
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
308 export PKG_CONFIG_FILE
309 export PREFIX
260f4fd @Dav1dde added makefile
authored Dec 5, 2011
310 export RANLIB
2eddd6f @Dav1dde updated makefile
authored Dec 10, 2011
311 export RM
312 export STATIC_LIB_EXT
f33a100 @bioinfornatics fix shared lib build
bioinfornatics authored Aug 13, 2012
313 export SONAME
Something went wrong with that request. Please try again.