-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile_cygwin
512 lines (413 loc) · 12.6 KB
/
makefile_cygwin
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
ifeq ($(OS),Windows_NT)
# modify following for your own system config
#Application name
APPLICATION:=SimFlu
#objects direction name
DIR_SRC:=./src
#objects
OBJ:= SimFluUIApp.o SimFluUIMain.o SimFluUIThread.o
SRC:= simulator.o randgen.o population.o params.o
#for rc file of application, note: no extension name
APPLICATION_RC:=resource
#if multiple rc files
RC_DIR:=./
#you wxWidgets base dir name
WXBASEDIR=C:/Users/zhaoy/Documents/wxWidgets-3.0.2
### config for gcc ###
# =========================================================================
# This configuration file was generated by
# Bakefile 0.2.9 (http://www.bakefile.org)
# rarely, you might want to modify the compiler objects such as debug, release, shared or others
# =========================================================================
# -------------------------------------------------------------------------
# These are configurable options:
# -------------------------------------------------------------------------
# Compiler flags to link shared library
LINK_DLL_FLAGS ?= -shared
# Compiler flags to link loadable module
LINK_MODULE_FLAGS ?= -shared
# C compiler
CC = gcc
# C++ compiler
CXX = g++
# Standard flags for CC
CFLAGS ?=
# Standard flags for C++
CXXFLAGS ?= -std=gnu++11 -O3 -O2 -DWITH_UI
# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?=
# Standard linker flags
LDFLAGS ?=
# The C preprocessor
CPP ?= $(CC) -E
# What type of library to build? [0,1]
SHARED ?= 1
# Build wxUniversal instead of native port? [0,1]
WXUNIV ?= 0
# Compile Unicode build of wxWidgets? [0,1]
UNICODE ?= 1
# Use MSLU library when building Unicode version. [0,1]
MSLU ?= 0
# Type of compiled binaries [debug,release]
BUILD ?= release
# Should debugging info be included in the executables? The default value
# "default" means that debug info will be included if BUILD=debug
# and not included if BUILD=release. [0,1,default]
DEBUG_INFO ?= default
# Should __WXDEBUG__ be defined? The default value "default" means that it will
# be defined if BUILD=debug and not defined if BUILD=release. [0,1,default]
DEBUG_FLAG ?= default
# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC ?= 1
# Build GUI libraries? [0,1]
USE_GUI ?= 1
# Build wxHTML library (USE_GUI must be 1)? [0,1]
USE_HTML ?= 1
# Build multimedia library (USE_GUI must be 1)? [0,1]
USE_MEDIA ?= 1
# Build wxXRC library (USE_GUI must be 1)? [0,1]
USE_XRC ?= 1
# Build wxAUI library (USE_GUI must be 1)? [0,1]
USE_AUI ?= 1
# Build wxRichTextCtrl library (USE_GUI must be 1)? [0,1]
USE_RICHTEXT ?= 1
# Build OpenGL canvas library (USE_GUI must be 1)? [0,1]
USE_OPENGL ?= 0
# Build ODBC database classes (USE_GUI must be 1)? [0,1]
USE_ODBC ?= 0
# Build quality assurance classes library (USE_GUI must be 1)? [0,1]
USE_QA ?= 0
# Enable exceptions in compiled code. [0,1]
USE_EXCEPTIONS ?= 1
# Enable run-time type information (RTTI) in compiled code. [0,1]
USE_RTTI ?= 1
# Enable threading in compiled code. [0,1]
USE_THREADS ?= 1
# Enable wxCairoContext for platforms other than Linux/GTK. [0,1]
USE_CAIRO ?= 0
# Link with gdiplus.lib? (Needed for wxGraphicsContext, will also set wxUSE_GRAPHICS_CONTEXT) [0,1]
USE_GDIPLUS ?= 0
# Is this official build by wxWidgets developers? [0,1]
OFFICIAL_BUILD ?= 0
# Use this to name your customized DLLs differently
VENDOR ?= custom
#
WX_FLAVOUR ?=
#
WX_LIB_FLAVOUR ?=
# Name of your custom configuration. This affects directory
# where object files are stored as well as the location of
# compiled .lib files and setup.h under the lib/ toplevel directory.
CFG ?=
# Compiler flags needed to compile test suite in tests directory. If you want
# to run the tests, set it so that the compiler can find CppUnit headers.
CPPUNIT_CFLAGS ?=
# Linker flags needed to link test suite in tests directory. If you want
# to run the tests, include CppUnit library here.
CPPUNIT_LIBS ?=
# Version of C runtime library to use. You can change this to
# static if SHARED=0, but it is highly recommended to not do
# it if SHARED=1 unless you know what you are doing. [dynamic,static]
RUNTIME_LIBS ?= dynamic
# Set the version of your Mingw installation here.
# "3" ...... this is for Mingw 2.0 or newer (comes with gcc3)
# "2.95" ... for Mingw 1.1 or any of the older versions [3,2.95]
GCC_VERSION ?= 3
# Test *.a file
FILE_EXT ?=
# -------------------------------------------------------------------------
### Variables: ###
CPPDEPS = -MT$@ [email protected] -MD -MP
WX_RELEASE_NODOT = 30
OBJS = \
gcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(CFG)
LIBDIRNAME = $(WXBASEDIR)/lib/gcc_$(LIBTYPE_SUFFIX)$(CFG)
SETUPHDIR = $(LIBDIRNAME)/$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)
APPLICATION_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG_2) $(__THREADSFLAG) \
$(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) \
$(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \
$(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) \
$(__MSLU_DEFINE_p) $(__GFXCTX_DEFINE_p) -DWX_PRECOMP -I $(SETUPHDIR) \
-I $(WXBASEDIR)\include \
$(____CAIRO_INCLUDEDIR_FILENAMES_p) -W -Wall -I. $(__DLLFLAG_p) \
-I $(RC_DIR) \
-DNOPCH $(__RTTIFLAG_5) $(__EXCEPTIONSFLAG_6) \
$(CPPFLAGS) $(CXXFLAGS)
APPLICATION_OBJECTS = \
$(OBJS)/$(APPLICATION_RC).o \
$(addprefix $(OBJS)/,$(OBJ)) \
$(addprefix $(OBJS)/,$(SRC))
### Conditionally set variables: ###
ifeq ($(GCC_VERSION),4.92)
GCCFLAGS = -fvtable-thunks
endif
ifeq ($(USE_GUI),0)
PORTNAME = base
endif
ifeq ($(USE_GUI),1)
PORTNAME = msw
endif
ifeq ($(BUILD),debug)
ifeq ($(DEBUG_FLAG),default)
WXDEBUGFLAG = d
endif
endif
ifeq ($(DEBUG_FLAG),1)
WXDEBUGFLAG = d
endif
ifeq ($(UNICODE),1)
WXUNICODEFLAG = u
endif
ifeq ($(WXUNIV),1)
WXUNIVNAME = univ
endif
ifeq ($(SHARED),1)
WXDLLFLAG = dll
endif
ifeq ($(SHARED),0)
LIBTYPE_SUFFIX = lib
endif
ifeq ($(SHARED),1)
LIBTYPE_SUFFIX = dll
endif
ifeq ($(MONOLITHIC),0)
EXTRALIBS_FOR_BASE =
endif
ifeq ($(MONOLITHIC),1)
EXTRALIBS_FOR_BASE =
endif
ifeq ($(BUILD),debug)
__OPTIMIZEFLAG_2 = -O0
endif
ifeq ($(BUILD),release)
__OPTIMIZEFLAG_2 = -O2
endif
ifeq ($(USE_RTTI),0)
__RTTIFLAG_5 = -fno-rtti
endif
ifeq ($(USE_RTTI),1)
__RTTIFLAG_5 =
endif
ifeq ($(USE_EXCEPTIONS),0)
__EXCEPTIONSFLAG_6 = -fno-exceptions
endif
ifeq ($(USE_EXCEPTIONS),1)
__EXCEPTIONSFLAG_6 =
endif
ifeq ($(WXUNIV),1)
__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
endif
ifeq ($(WXUNIV),1)
__WXUNIV_DEFINE_p_1 = --define __WXUNIVERSAL__
endif
ifeq ($(BUILD),debug)
ifeq ($(DEBUG_FLAG),default)
__DEBUG_DEFINE_p = -D__WXDEBUG__
endif
endif
ifeq ($(DEBUG_FLAG),1)
__DEBUG_DEFINE_p = -D__WXDEBUG__
endif
ifeq ($(BUILD),debug)
ifeq ($(DEBUG_FLAG),default)
__DEBUG_DEFINE_p_1 = --define __WXDEBUG__
endif
endif
ifeq ($(DEBUG_FLAG),1)
__DEBUG_DEFINE_p_1 = --define __WXDEBUG__
endif
ifeq ($(BUILD),release)
__NDEBUG_DEFINE_p = -DNDEBUG
endif
ifeq ($(BUILD),release)
__NDEBUG_DEFINE_p_1 = --define NDEBUG
endif
ifeq ($(USE_EXCEPTIONS),0)
__EXCEPTIONS_DEFINE_p = -DwxNO_EXCEPTIONS
endif
ifeq ($(USE_EXCEPTIONS),0)
__EXCEPTIONS_DEFINE_p_1 = --define wxNO_EXCEPTIONS
endif
ifeq ($(USE_RTTI),0)
__RTTI_DEFINE_p = -DwxNO_RTTI
endif
ifeq ($(USE_RTTI),0)
__RTTI_DEFINE_p_1 = --define wxNO_RTTI
endif
ifeq ($(USE_THREADS),0)
__THREAD_DEFINE_p = -DwxNO_THREADS
endif
ifeq ($(USE_THREADS),0)
__THREAD_DEFINE_p_1 = --define wxNO_THREADS
endif
ifeq ($(UNICODE),1)
__UNICODE_DEFINE_p = -DwxUSE_UNICODE
endif
ifeq ($(UNICODE),1)
__UNICODE_DEFINE_p_1 = --define _UNICODE
endif
ifeq ($(MSLU),1)
__MSLU_DEFINE_p = -DwxUSE_UNICODE_MSLU=1
endif
ifeq ($(MSLU),1)
__MSLU_DEFINE_p_1 = --define wxUSE_UNICODE_MSLU=1
endif
ifeq ($(USE_GDIPLUS),1)
__GFXCTX_DEFINE_p = -DwxUSE_GRAPHICS_CONTEXT=1
endif
ifeq ($(USE_GDIPLUS),1)
__GFXCTX_DEFINE_p_1 = --define wxUSE_GRAPHICS_CONTEXT=1
endif
ifeq ($(USE_CAIRO),1)
____CAIRO_INCLUDEDIR_FILENAMES_p = -I$(CAIRO_ROOT)\include\cairo
endif
ifeq ($(USE_CAIRO),1)
__CAIRO_INCLUDEDIR_p = --include-dir $(CAIRO_ROOT)\include\cairo
endif
ifeq ($(SHARED),1)
__DLLFLAG_p = -DWXUSINGDLL
endif
ifeq ($(SHARED),1)
__DLLFLAG_p_1 = --define WXUSINGDLL
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_CORE_p = \
-lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core$(FILE_EXT)
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_BASE_p = \
-lwxbase$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(FILE_EXT)
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_ADV_p = \
-lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_adv$(FILE_EXT)
endif
ifeq ($(MONOLITHIC),1)
__WXLIB_MONO_p = \
-lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)$(FILE_EXT)
endif
ifeq ($(USE_GUI),1)
__LIB_TIFF_p = -lwxtiff$(WXDEBUGFLAG)$(FILE_EXT)
endif
ifeq ($(USE_GUI),1)
__LIB_JPEG_p = -lwxjpeg$(WXDEBUGFLAG)$(FILE_EXT)
endif
ifeq ($(USE_GUI),1)
__LIB_PNG_p = -lwxpng$(WXDEBUGFLAG)$(FILE_EXT)
endif
ifeq ($(MSLU),1)
__UNICOWS_LIB_p = -lunicows
endif
ifeq ($(USE_GDIPLUS),1)
__GDIPLUS_LIB_p = -lgdiplus
endif
ifeq ($(USE_CAIRO),1)
__CAIRO_LIB_p = -lcairo
endif
ifeq ($(USE_CAIRO),1)
____CAIRO_LIBDIR_FILENAMES_p = -L$(CAIRO_ROOT)/lib
endif
ifeq ($(BUILD),debug)
ifeq ($(DEBUG_INFO),default)
__DEBUGINFO = -g
endif
endif
ifeq ($(BUILD),release)
ifeq ($(DEBUG_INFO),default)
__DEBUGINFO =
endif
endif
ifeq ($(DEBUG_INFO),0)
__DEBUGINFO =
endif
ifeq ($(DEBUG_INFO),1)
__DEBUGINFO = -g
endif
ifeq ($(USE_THREADS),0)
__THREADSFLAG =
endif
ifeq ($(USE_THREADS),1)
__THREADSFLAG = -mthreads
endif
all: $(OBJS)
$(OBJS):
-if not exist $(OBJS) mkdir $(OBJS)
### Targets: ###
all: $(OBJS)\$(APPLICATION).exe
clean:
-if exist $(OBJS)/*.o del $(OBJS)/*.o
-if exist $(OBJS)/*.d del $(OBJS)/*.d
-if exist $(OBJS)/$(APPLICATION).exe del $(OBJS)/$(APPLICATION).exe
$(OBJS)\$(APPLICATION).exe: $(APPLICATION_OBJECTS) $(OBJS)/$(APPLICATION_RC).o
$(CXX) -o $@ $(APPLICATION_OBJECTS) $(__DEBUGINFO) \
$(__THREADSFLAG) -L$(LIBDIRNAME) -L$(WXBASEDIR)/include -Wl,--subsystem,windows \
-mwindows $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS) \
$(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__WXLIB_ADV_p) \
$(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) \
-lwxzlib$(WXDEBUGFLAG)$(FILE_EXT) \
-lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(FILE_EXT) \
-lwxexpat$(WXDEBUGFLAG)$(FILE_EXT) $(EXTRALIBS_FOR_BASE) \
$(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) $(__CAIRO_LIB_p) \
$(OBJS)\$(APPLICATION_RC).o: $(APPLICATION_RC).rc
windres --use-temp-file -i$< -o$@ \
--define __WXMSW__ $(__WXUNIV_DEFINE_p_1) \
$(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) \
$(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) \
$(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) \
$(__MSLU_DEFINE_p_1) $(__GFXCTX_DEFINE_p_1) \
--include-dir $(SETUPHDIR) \
--include-dir $(WXBASEDIR)\include \
$(__CAIRO_INCLUDEDIR_p) \
--include-dir . \
$(__DLLFLAG_p_1) \
--include-dir $(RC_DIR) \
--define NOPCH
$(OBJS)/SimFluUIApp.o:./SimFluUIApp.cpp ./SimFluUIApp.h ./wx_pch.h
$(CXX) $(APPLICATION_CXXFLAGS) -c $< -o $@
$(OBJS)/SimFluUIMain.o:./SimFluUIMain.cpp ./SimFluUIMain.h ./SimFluUIThread.h src/simulator.h src/params.h ./wx_pch.h
$(CXX) $(APPLICATION_CXXFLAGS) -c $< -o $@
$(OBJS)/SimFluUIThread.o:./SimFluUIThread.cpp ./SimFluUIThread.h src/simulator.h src/params.h
$(CXX) $(APPLICATION_CXXFLAGS) -c $< -o $@
$(OBJS)/simulator.o:src/simulator.cpp src/simulator.h
$(CXX) $(APPLICATION_CXXFLAGS) -c $< -o $@
$(OBJS)/randgen.o:src/randgen.cpp src/randgen.h
$(CXX) -c -o $@ $(CXXFLAGS) $<
$(OBJS)/population.o:src/population.cpp src/population.h
$(CXX) -c -o $@ $(CXXFLAGS) $<
$(OBJS)/params.o:src/params.cpp src/params.h
$(CXX) -c -o $@ $(CXXFLAGS) $<
.PHONY: all clean
#SHELL := $(COMSPEC)
# Dependencies tracking:
-include $(OBJS)/*.d
else
PROGRAM = SimFlu
INCLUDEDIRS = $(shell wx-config --cxxflags)
LIBS = $(shell wx-config --libs)
VPATH = ./src
CXXSOURCES = SimFluUIApp.cpp SimFluUIMain.cpp SimFluUIThread.cpp \
simulator.cpp randgen.cpp population.cpp params.cpp
CXXOBJECTS = $(CXXSOURCES:.cpp=.o)
CXXFLAGS = $(INCLUDEDIRS) -std=c++11 -g -DWITH_UI
CXX = g++
LDFLAGS = $(LIBS)
all: $(PROGRAM)
$(PROGRAM): $(CXXOBJECTS)
$(CXX) -o $@ $(CXXOBJECTS) $(CXXFLAGS) $(LDFLAGS)
SimFluUIApp.o:SimFluUIApp.cpp SimFluUIApp.h wx_pch.h
$(CXX) $(CXXFLAGS) -c $<
SimFluUIMain.o:SimFluUIMain.cpp SimFluUIMain.h SimFluUIThread.h simulator.h params.h wx_pch.h
$(CXX) $(CXXFLAGS) -c $<
SimFluUIThread.o:SimFluUIThread.cpp SimFluUIThread.h simulator.h params.h
$(CXX) $(CXXFLAGS) -c $<
simulator.o:simulator.cpp simulator.h
$(CXX) $(CXXFLAGS) -c $<
randgen.o:randgen.cpp randgen.h
$(CXX) $(CXXFLAGS) -c $<
population.o:population.cpp population.h
$(CXX) $(CXXFLAGS) -c $<
params.o:params.cpp params.h
$(CXX) $(CXXFLAGS) -c $<
clean:
rm $(PROGRAM) $(CXXOBJECTS)
endif