forked from garglk/garglk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jamrules
263 lines (214 loc) · 6.64 KB
/
Jamrules
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
# You will probably need to edit this file to get everything to compile.
# You may want to review the SharedLink action in Jamshared as well.
#
BUILD ?= RELEASE ;
USESDL ?= yes ;
USEBABEL ?= yes ;
BUNDLEFONTS ?= yes ;
# jam -sGUILIB=EFL
GUILIB ?= gtk+ ;
# jam -sGARGLKINI=/usr/local/etc/garglk.ini
GARGLKINI ?= /etc/garglk.ini ;
# jam -sGARGLKPRE=gargoyle-
GARGLKPRE ?= "" ;
CC ?= gcc ;
CXX ?= g++ ;
if $(CROSS)
{
CROSS = "(cross-compiling)" ;
OS = MINGW ;
SUFEXE = .exe ;
CC = i386-mingw32-gcc ;
CXX = i386-mingw32-g++ ;
AR = i386-mingw32-ar cru ;
RANLIB = i386-mingw32-ranlib ;
LINK = $(CC) ;
}
#cross compiling for Open Inkpot
#jam -sIPLINUXARCH=mipsel-ip-linux-gnu
if $(IPLINUXARCH)
{
OS = IPLINUX ;
GUILIB = EFL ;
USESDL = no ;
CC = $(IPLINUXARCH)-gcc ;
C++ = $(IPLINUXARCH)-g++ ;
CXX = $(IPLINUXARCH)-g++ ;
AR = $(IPLINUXARCH)-ar cru ;
RANLIB = $(IPLINUXARCH)-ranlib ;
LINK = $(CC) ;
}
if $(UNIVERSAL) = yes
{
AR = libtool -static -o ;
RM = touch -c ;
ALTARCH = -arch ppc ;
ALTARCH += -isysroot /Developer/SDKs/MacOSX10.4u.sdk ;
ALTARCH += -mmacosx-version-min=10.4 ;
}
switch $(OS)
{
case MINGW :
Echo "OS is MINGW (win32) $(CROSS)" ;
SUFDLL = .dll ;
LINKLIBS = -lcomdlg32 -lgdi32 -lwinmm -lm ;
SHRLINKLIBS = -lcomdlg32 -lgdi32 -lwinmm -lm ;
SHRLINKLIBS += $(TOP)/support/freetype/freetype6.dll ;
SHRLINKLIBS += $(TOP)/support/libjpeg/libjpeg-8.dll ;
SHRLINKLIBS += $(TOP)/support/libpng/libpng14-14.dll ;
SHRLINKLIBS += $(TOP)/support/zlib/zlib1.dll ;
if $(BUILD) = RELEASE || $(BUILD) = TURBO
{
SHRLINKLIBS += -mwindows ;
LINKLIBS += -mwindows ;
}
if $(USESDL) = yes
{
SHRLINKLIBS += $(TOP)/support/sdl/SDL_mixer.dll ;
SHRLINKLIBS += $(TOP)/support/sdl/SDL.dll ;
}
case LINUX :
Echo "OS is LINUX ($(GUILIB))" ;
if $(GUILIB) = EFL {
PKGCONFIG = "pkg-config freetype2 evas ecore ecore-evas elementary fontconfig" ;
} else {
PKGCONFIG = "pkg-config freetype2 gtk+-x11-2.0 gdk-x11-2.0 gobject-2.0 glib-2.0 fontconfig" ;
}
GARGLKCCFLAGS = "`$(PKGCONFIG) --cflags`" -fPIC ;
GARGLKLIBS = "`$(PKGCONFIG) --libs`" -ljpeg -lpng -lz -lrt ;
LINKLIBS = -lz -lm "`$(PKGCONFIG) --libs`" ;
if $(USESDL) = yes
{
GARGLKCCFLAGS += -I/usr/include/SDL ;
GARGLKLIBS += -lSDL_mixer -lSDL_sound -lSDL ;
}
if $(STATIC) { LINKLIBS += $(GARGLKLIBS) ; }
else { SHRLINKLIBS += $(GARGLKLIBS) ; }
case IPLINUX :
Echo "OS is IPLINUX (EFL)" ;
PKGCONFIG = "PKG_CONFIG_PATH=/usr/$(IPLINUXARCH)/lib/pkgconfig pkg-config freetype2 fontconfig libkeys libeoi eina-0 evas ecore ecore-x ecore-file ecore-evas edje" ;
GARGLKCCFLAGS = "`$(PKGCONFIG) --cflags`" -fPIC ;
GARGLKLIBS = "`$(PKGCONFIG) --libs`" -ljpeg -lpng -lm -lrt ;
LINKLIBS = -lz -lm "`$(PKGCONFIG) --libs`" ;
if $(USESDL) = yes
{
GARGLKCCFLAGS += -I/usr/include/SDL ;
GARGLKLIBS += -lSDL_mixer -lSDL_sound -lSDL ;
}
if $(STATIC) { LINKLIBS += $(GARGLKLIBS) ; }
else { SHRLINKLIBS += $(GARGLKLIBS) ; }
case SOLARIS :
Echo "OS is SOLARIS (gtk+)" ;
PKGCONFIG = "pkg-config freetype2 gtk+-x11-2.0 gdk-x11-2.0 gobject-2.0 glib-2.0 fontconfig" ;
GARGLKCCFLAGS = "`$(PKGCONFIG) --cflags`" -fPIC ;
GARGLKLIBS = "`$(PKGCONFIG) --libs`" -ljpeg -lpng -lz ;
LINKLIBS = -lz -lm "`$(PKGCONFIG) --libs`" ;
if $(USESDL) = yes
{
GARGLKCCFLAGS += -I/usr/include/SDL ;
GARGLKLIBS += -lSDL_mixer -lSDL -lsmpeg -lvorbisfile ;
}
if $(STATIC) { LINKLIBS += $(GARGLKLIBS) ; }
else { SHRLINKLIBS += $(GARGLKLIBS) ; }
case MACOSX :
Echo "OS is MACOSX (cocoa)" ;
SUFDLL = .dylib ;
MAINARCH = -arch i386 ;
CCFLAGS = -Wno-pointer-sign $(MAINARCH) $(ALTARCH) ;
PKGCONFIG = "pkg-config freetype2" ;
GARGLKCCFLAGS = "`$(PKGCONFIG) --cflags`" ;
SHRLINKLIBS += "`$(PKGCONFIG) --libs`" -ljpeg -lpng -lz ;
LINKLIBS = "`$(PKGCONFIG) --libs`" -lz -lm ;
FRAMEWORKS = -framework Cocoa -framework OpenGL ;
if $(USESDL) = yes
{
GARGLKCCFLAGS += -I/opt/local/include/SDL ;
SHRLINKLIBS += -lSDL_mixer -lSDL -lsmpeg -lvorbisfile ;
}
LINK = $(CC) -headerpad_max_install_names $(FRAMEWORKS) $(MAINARCH) $(ALTARCH) ;
case * :
Exit "Unknown target. Please edit 'Jamrules'." ;
}
switch $(BUILD)
{
case DEBUG :
Echo "BUILD is DEBUG" ;
OPTIM = -g ;
case RELEASE :
Echo "BUILD is RELEASE" ;
OPTIM = -O2 $(CFLAGS) ;
LINKFLAGS = $(LDFLAGS) ;
SHRLINKFLAGS = $(LDFLAGS) ;
case PROFILE :
Echo "BUILD is PROFILE" ;
OPTIM = -g -pg ;
LINKFLAGS = -pg ;
case * :
Exit "Unknown build:" $(BUILD) ;
}
#
# To compile windows resource files
#
rule UserObject
{
switch $(>)
{
case *.rc : WindRes $(<) : $(>) ;
case *.m : Cc $(<) : $(>) ;
case * : Echo "unknown suffix on" $(>) ;
}
}
rule WindRes
{
Depends $(<) : $(>) ;
Clean clean : $(<) ;
}
actions WindRes { windres -i $(>) -o $(<) --include-dir=$(>:D) }
#
# You shouldn't need to touch anything from here on.
#
HDRS = [ FDirName $(TOP) garglk ] ;
BTOP = [ FDirName $(TOP) build $(OS:L).$(BUILD:L) ] ;
rule ObjDir
{
LOCATE_TARGET = [ FDirName $(BTOP) $(1) ] ;
}
include [ FDirName $(TOP) Jamshared ] ;
if $(OS) = MINGW
{
LINKLIBS += $(BTOP)/garglk/icons.o ;
}
rule FPrependRoot
{
# FPrependRoot prefix : path ;
#
# Safely prepend a prefix to a path
# Use to e.g. install files into a build root
# FDirName does not allow adding a prefix to a root path
# ( e.g. [ FDirName /some/path /usr/bin ] -> /usr/bin )
#
# Care must be taken not to allow doubled separators in the path:
# this causes MkDir to fail to traverse up the directory tree
# and try to create the same directory twice
local _prefix = [ FDirName $(<) ] ;
local _path = [ FDirName $(>) ] ;
local _full ;
if $(_path) = $(_path:R=$(SLASH))
{
# _path is rooted
_full = $(_prefix) $(_path) ;
}
else
{
# _path is relative
if $(_path) = $(DOT)
{
_full = $(_prefix) ;
}
else
{
_full = $(_prefix) $(SLASH)$(_path) ;
}
}
return $(_full:J=) ;
}