forked from golded-plus/golded-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakef.def
242 lines (223 loc) · 4.9 KB
/
GNUmakef.def
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
# -*- makefile -*-
# $Id$
# Include file for GNU C++ build
ifndef PLATFORM
ifeq ($(TERM),cygwin)
MINGW=true
PLATFORM=cyg
else
ifeq ($(OSTYPE),msys)
MINGW=true
PLATFORM=cyg
endif
endif
ifeq ($(findstring EMX, $(PATH)), EMX)
PLATFORM=emx
endif
ifneq ($(DJGPP),) # DJGPP build (enviroment variable 'DJGPP' is defined)
PLATFORM=djg
endif
ifeq ($(OSTYPE),beos) # BeOS build
PLATFORM=be
endif
ifeq ($(findstring solaris, $(OSTYPE)), solaris)
PLATFORM=sun
endif
ifeq ($(findstring darwin, $(OSTYPE)), darwin)
PLATFORM=osx
endif
endif # ifndef PLATFORM
ifeq ($(PLATFORM),cyg)
CAT=cat
SED=sed
GREP=grep
CC=gcc -mno-cygwin
CXX=g++ -mno-cygwin
AR=ar
RANLIB=ranlib
WINDRES=windres
EXEEXT=.exe
OBJEXT=.o
LIBEXT=.a
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
else
ifeq ($(PLATFORM),emx)
CAT=cat
SED=sed
GREP=grep
CC=gcc
AR=ar
RANLIB=ar s
SHELL=bash
EXEEXT=.exe
OBJEXT=.o
LIBEXT=.a
#CC=gcc -Zomf
#AR=emxomfar
#RANLIB=emxomfar s
#PLATFORM=emx
#SHELL=bash
#EXEEXT=.exe
#OBJEXT=.obj
#LIBEXT=.lib
CXX=g++
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
LNKFLAGS+=-s
else
ifeq ($(PLATFORM),djg)
CAT=command.com /c type
SED=sed
GREP=grep
CC=gcc
CXX=gxx
AR=ar
RANLIB=ranlib
SHELL=sh
EXEEXT=.exe
OBJEXT=.o
LIBEXT=.a
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
else
ifeq ($(PLATFORM),be)
CAT=cat
SED=sed
GREP=grep
CC=gcc
CXX=g++
AR=ar
RANLIB=ranlib
EXEEXT=
OBJEXT=.o
LIBEXT=.a
LNKFLAGS+=-lbe -ltextencoding
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
else
ifeq ($(PLATFORM),sun) # SUN Solaris
CAT=cat
SED=gsed
GREP=ggrep
CC=gcc
CXX=g++
AR=ar
RANLIB=ranlib
EXEEXT=
OBJEXT=.o
LIBEXT=.a
CFLAGS+=-D__SUNOS__ -D__UNIX__ -DUNIX
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
ifeq ($(WIDE_NCURSES),1)
LIBCURSES=-L/opt/csw/lib -lncursesw
else
LIBCURSES=-L/opt/csw/lib -lncurses
endif
else
ifeq ($(PLATFORM),osx) # Mac OSX
CAT=cat
SED=sed
GREP=grep
ifndef CC
CC=gcc
endif
ifndef CXX
CXX=g++
endif
AR=ar
RANLIB=ranlib
PLATFORM=osx
EXEEXT=
OBJEXT=.o
LIBEXT=.a
ifeq ($(WIDE_NCURSES),1)
LIBCURSES=-lncursesw
else
LIBCURSES=-lncurses
endif
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
else # Linux, *BSD or another unix-like OS
CAT=cat
SED=sed
GREP=grep
ifndef CC
CC=gcc
endif
ifndef CXX
CXX=g++
endif
AR=ar
RANLIB=ranlib
PLATFORM=lnx
EXEEXT=
OBJEXT=.o
LIBEXT=.a
CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DHAVE_STDARG_H
ifeq ($(WIDE_NCURSES),1)
CFLAGS+=-I/usr/include/ncursesw/
LIBCURSES=-lncursesw
else
LIBCURSES=-lncurses
endif
endif
endif
endif
endif
endif
endif
ifeq ($(DEBUG),1)
CFLAGS+=-funsigned-char -g -Og $(INCS) -Wall -Wno-long-long -Wno-sign-compare -pedantic -DPRAGMA_PACK # -fomit-frame-pointer
else
CFLAGS+=-funsigned-char -g -O2 $(INCS) -Wall -Wno-long-long -Wno-sign-compare -pedantic -DPRAGMA_PACK # -fomit-frame-pointer
endif
LNKFLAGS+=-g
CPPFLAGS+=$(CFLAGS)
# Run `make USE_NCURSES=0` if you dislike ncurses
# Run `make BUGGY_NCURSES=1` if your build requires additional keypresses to
# pass areascan
# NOTE: lnx is active for any *NIX system and only ncurses mode is portable
USE_NCURSES?=1
BUGGY_NCURSES?=0
ifeq ($(PLATFORM),lnx)
ifeq ($(USE_NCURSES),1)
CPPFLAGS+=-D__USE_NCURSES__
ifeq ($(BUGGY_NCURSES),1)
CPPFLAGS+=-DBUGGY_NCURSES
endif
endif
endif
ifeq ($(PLATFORM),sun)
ifeq ($(USE_NCURSES),1)
CPPFLAGS+=-D__USE_NCURSES__
endif
endif
ifeq ($(PLATFORM),osx)
ifeq ($(USE_NCURSES),1)
CPPFLAGS+=-D__USE_NCURSES__
endif
endif
# uncomment the next line for better koi-8 support. do not do it for
# international builds since latin-1 support will be broken.
ifeq ($(PLATFORM),lnx)
ifeq ($(KOI8),1)
CPPFLAGS+=-DKOI8
endif
endif
ifeq "$(ICONV)" "1"
CFLAGS+=-DHAS_ICONV
endif
#uncomment the following line if you build version to be used
#on BONE-powered systems(Dan0 etc.) This improves some operations ...
ifeq ($(PLATFORM),be)
CPPFLAGS+=#-DBEOS_BONE_BUILD
endif
# force not to use coprocessor features in DOS, if you have one you may remove this
ifeq ($(PLATFORM),djg)
#CFLAGS+=-mcpu=i386 # GCC v2.x.x
CFLAGS+=-march=i386 #-mtune=i686 # GCC v3.x.x
STDLIBS+=-llocal
endif
# force not to use coprocessor features in DOS, if you have one you may remove this
ifeq ($(PLATFORM),djg)
#STDLIBS+= -lwmemu
endif
BIN=bin
OBJPATH=obj
LIBPATH=lib