File: Makefile_mingw

package info (click to toggle)
dds 2.9.0-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 56,576 kB
  • sloc: cpp: 17,621; ansic: 385; makefile: 27; xml: 11; sh: 7
file content (119 lines) | stat: -rw-r--r-- 2,955 bytes parent folder | download | duplicates (3)
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
# --------------------- INFORMATION --------------------------------

# This the test Makefile for Windows and the mingw GNU g++
# compiler.  It assumes a Unix-like setup for some commands.

# The dtest program itself does not use multi-threading, 
# but the library might, depending on how it was compiled.

# The Makefile also allows an "un-official" and ugly, but
# sometimes practical compilation of a directly integrated
# executable (i.e. not using the DLL).  For this the Makefile
# uses the source and object files in the src directory...
# Use "make itest" at your own risk.

# If you need to add something for the threading system, this is
# the place.

THREAD_LINK	= -lboost_system -lboost_thread -lgomp

# ----------------------- OFTEN OK    ------------------------------

# From here on you you don't have to change anything to CONFIGURE
# the compilation.  But you may well have to change something to 
# get it to compile.

INCL_DDS_SOURCE	= Makefiles/dds_sources.txt
INCL_OWN_SOURCE	= Makefiles/own_sources.txt
INCL_DEPENDS	= Makefiles/depends_o.txt

# If your compiler name is not given here, change it.
CC		= g++

# We compile with aggressive warnings, but we have to turn off some
# of them as they appear in libraries in great numbers...

WARN_FLAGS	= 		\
	-Wshadow 		\
	-Wsign-conversion 	\
	-pedantic -Wall -Wextra  \
	-Wcast-align -Wcast-qual \
	-Wctor-dtor-privacy 	\
	-Wdisabled-optimization \
	-Winit-self 		\
	-Wlogical-op 		\
	-Wmissing-declarations 	\
	-Wmissing-include-dirs 	\
	-Wnoexcept 		\
	-Wold-style-cast 	\
	-Woverloaded-virtual 	\
	-Wredundant-decls 	\
	-Wsign-promo 		\
	-Wstrict-null-sentinel 	\
	-Wstrict-overflow=1 	\
	-Wswitch-default -Wundef \
	-Werror 		\
	-Wno-unused 		\
	-Wno-unknown-pragmas 	\
	-Wno-long-long		\
	-Wno-format

COMPILE_FLAGS	= -O3 $(WARN_FLAGS)

DLLBASE		= dds
DLL 		= $(DLLBASE).dll
DLIB 		= $(DLLBASE).lib
EXPORTER	= Exports.def

LINK1_FLAGS	= 
LINK2_FLAGS	= 		\
	-Wl,--dynamicbase 	\
	-Wl,--nxcompat 		\
	-Wl,--no-seh 		\
	-Wl,--enable-stdcall-fixup \
	$(THREAD_LINK) \
	-L. -l$(DLLBASE)

# This is in addition to $(DTEST).cpp

include $(INCL_OWN_SOURCE)

DTEST_OBJ_FILES	= $(subst .cpp,.o,$(DTEST_SOURCE_FILES)) $(DTEST).o

DTEST		= dtest
ITEST		= itest

# These are the files that we steal from the src directory.

include $(INCL_DDS_SOURCE)

ITEST_SOURCE_FILES	=	\
	$(DDS_SOURCE_FILES)	\
	$(DTEST_SOURCE_FILES)	\
	itest.cpp

ITEST_OBJ_FILES	= $(subst .cpp,.o,$(ITEST_SOURCE_FILES))

dtest:	$(DTEST_OBJ_FILES)
	$(CC) $(COMPILE_FLAGS) $(LINK1_FLAGS) $(DTEST_OBJ_FILES) \
	$(LINK2_FLAGS) -o $(DTEST)

itest:	$(ITEST_OBJ_FILES)
	$(CC) $(COMPILE_FLAGS) $(LINK1_FLAGS) $(ITEST_OBJ_FILES) \
	$(LINK2_FLAGS) -o $(ITEST)

%.o:	%.cpp
	$(CC) $(COMPILE_FLAGS) -c $< -o $*.o

depend:
	makedepend -Y -- $(ITEST_SOURCE_FILES) $(DTEST).cpp

clean:
	rm -f *.o *.exe $(DLLBASE).def $(DLL)

# If you don't have a Linux-like setup, use "del" instead of "rm".

include $(INCL_DEPENDS)

# DO NOT DELETE