File: makefile-mac

package info (click to toggle)
golly 2.3-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 10,080 kB
  • sloc: cpp: 41,951; python: 6,339; sh: 3,912; perl: 1,172; java: 49; makefile: 47
file content (308 lines) | stat: -rw-r--r-- 11,175 bytes parent folder | download
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
# Makefile for building a 64-bit Cocoa version of Golly using wxWidgets 2.9.x on Mac OS 10.6.
# It assumes you've built the wxWidgets libraries with commands like these:
#
# cd /HD/wxWidgets/wxWidgets-2.9.1
# mkdir build-osx
# cd build-osx
# ../configure --enable-unicode --disable-shared --with-osx_cocoa
# make

# In the lines below, change WX_DIR to where you installed wxWidgets,
# change BUILD_DIR to where you built the wx libraries, and change
# WX_RELEASE to match your wxWidgets version (first two digits).

WX_RELEASE = 2.9

# Set WX_DIR to where your wxWidgets source files were placed by your package
# downloader, CVS or Subversion, etc. This directory contains about 40 items
# including a directory "art" containing .xpm files, a "wxBase.spec", etc.
# For example, if you have a file at
# /home/fred/wx-trunk/docs/doxygen/images/wxmac/gauge.png
# then set WX_DIR to /home/fred/wx-trunk
WX_DIR = /Users/munafo/devt/wx-trunk

# Set BUILD_DIR to where your wxWidgets libraries and executables were
# placed during the build process (PRIOR to doing a "make install", MacPorts
# "activating wxWidgets" step, or equivalent) This directory should contain
# about 800 ".o" files, and directories called demos, lib, samples, src,
# tests and utils. For example, if you have a file at
# /home/fred/wx-trunk/build-osx/lib/libwx_osx_cocoau_core-2.9.a then
# set BUILD_DIR to /home/fred/wx-trunk/build-osx
BUILD_DIR = $(WX_DIR)/build-osx

WXINC_DIR = $(BUILD_DIR)/lib/wx/include/osx_cocoa-unicode-static-$(WX_RELEASE)
WXUNICODEFLAG = u

APP_NAME = Golly
APP_VERSION = 2.3

# for Perl script support
PERL_INCLUDE = `/usr/bin/perl -MExtUtils::Embed -e ccopts`
# PERL_LINK = `/usr/bin/perl -MExtUtils::Embed -e ldopts`
# above generates unwanted stuff (-arch i386 and -arch ppc)
PERL_LINK = -arch x86_64 -L/usr/local/lib  -L/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE -lperl -ldl -lm -lutil -lc

# for Python script support
PYTHON_INCLUDE = -I`/usr/bin/python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc()"`
PYTHON_LINK = `/usr/bin/python -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LINKFORSHARED')"`

# for building source and binary distributions:
RELEASENAME = golly-$(APP_VERSION)
SHAREDFILES = Help Patterns Scripts Rules README LICENSE
SRCFILES = BUILD TODO CMakeLists.txt makefile-gtk makefile-mac makefile-win \
   bitmaps golly.rc *.ico appicon.xpm Info.plist.in *.icns *.h *.cpp

# Variables:

LIBDIRNAME = $(BUILD_DIR)/lib
TOOLKIT = OSX_COCOA
TOOLKIT_LOWERCASE = osx_cocoa
TOOLKIT_VERSION = 

CXXC = g++ -mmacosx-version-min=10.5
### bk-deps script can be used to create *.d files containing all dependencies
### CXXC = $(BUILD_DIR)/bk-deps g++ -mmacosx-version-min=10.5

CPPFLAGS = -DWX_PRECOMP -DNO_GCC_PRAGMA \
   -I${WXINC_DIR} \
   -I${WX_DIR}/include -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES

CXXFLAGS = -arch x86_64 \
   -D__WX$(TOOLKIT)__ -DVERSION=$(APP_VERSION) $(CPPFLAGS) \
   -DZLIB -O5 -Wall -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor \
   -fno-strict-aliasing -fno-common

LDFLAGS = -arch x86_64 \
   -Wl,-dead_strip -Wl,-S \
   -framework IOKit -framework Carbon -framework Cocoa -framework System 

# for bgolly
CXXBASE = -arch x86_64 \
   -DVERSION=$(APP_VERSION) -DZLIB -O5 -Wall -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor \
   -fno-strict-aliasing -fno-common
LDBASE = -arch x86_64 -lz

EXTRALIBS = -lz -lpthread -liconv
EXTRALIBS_GUI = -framework WebKit -framework OpenGL -framework AudioToolbox

OBJDIR = ObjOSX
BASEH = bigint.h ghashbase.h hlifealgo.h jvnalgo.h lifealgo.h lifepoll.h \
   liferender.h liferules.h platform.h qlifealgo.h readpattern.h util.h viewport.h \
   writepattern.h ruletreealgo.h generationsalgo.h ruletable_algo.h
BASEOBJ = $(OBJDIR)/bigint.o $(OBJDIR)/lifealgo.o $(OBJDIR)/hlifealgo.o \
   $(OBJDIR)/hlifedraw.o $(OBJDIR)/qlifealgo.o $(OBJDIR)/qlifedraw.o \
   $(OBJDIR)/jvnalgo.o $(OBJDIR)/ruletreealgo.o \
   $(OBJDIR)/ruletable_algo.o \
   $(OBJDIR)/ghashbase.o $(OBJDIR)/ghashdraw.o $(OBJDIR)/readpattern.o \
   $(OBJDIR)/writepattern.o $(OBJDIR)/liferules.o $(OBJDIR)/util.o \
   $(OBJDIR)/liferender.o $(OBJDIR)/viewport.o $(OBJDIR)/lifepoll.o \
   $(OBJDIR)/generationsalgo.o
WXH = wxalgos.h wxedit.h wxgolly.h wxhelp.h wxinfo.h wxlayer.h wxmain.h \
   wxperl.h wxprefs.h wxpython.h wxrender.h wxrule.h wxscript.h wxselect.h wxstatus.h \
   wxtimeline.h wxundo.h wxutils.h wxview.h
WXOBJ = $(OBJDIR)/wxutils.o $(OBJDIR)/wxprefs.o $(OBJDIR)/wxalgos.o $(OBJDIR)/wxrule.o \
   $(OBJDIR)/wxinfo.o $(OBJDIR)/wxhelp.o $(OBJDIR)/wxstatus.o $(OBJDIR)/wxview.o \
   $(OBJDIR)/wxrender.o $(OBJDIR)/wxscript.o $(OBJDIR)/wxperl.o $(OBJDIR)/wxpython.o \
   $(OBJDIR)/wxfile.o $(OBJDIR)/wxedit.o $(OBJDIR)/wxcontrol.o $(OBJDIR)/wxtimeline.o \
   $(OBJDIR)/wxundo.o $(OBJDIR)/wxselect.o $(OBJDIR)/wxlayer.o $(OBJDIR)/wxmain.o $(OBJDIR)/wxgolly.o

PORTNAME = $(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION)
###WXBASEPORT = _carbon
###WXDEBUGFLAG = d
__WXLIB_HTML_p = -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_html-$(WX_RELEASE)
__WXLIB_ADV_p = -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_adv-$(WX_RELEASE)
__WXLIB_CORE_p = -lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_core-$(WX_RELEASE)
__WXLIB_BASE_p = -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-$(WX_RELEASE)
__WXLIB_NET_p = -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_net-$(WX_RELEASE)
__LIB_TIFF_p = -lwxtiff$(WXDEBUGFLAG)-$(WX_RELEASE)
__LIB_PNG_p = -lwxpng$(WXDEBUGFLAG)-$(WX_RELEASE)
###__LIB_JPEG_p = -lwxjpeg$(WXDEBUGFLAG)-$(WX_RELEASE)

# Targets:

all: $(OBJDIR) app.bin app_bundle bgolly RuleTableToTree

$(BASEOBJ): $(BASEH)
$(WXOBJ): $(BASEH) $(WXH) *.xpm bitmaps/*.xpm

$(OBJDIR):
	mkdir -p $(OBJDIR)

clean:
	rm -f $(OBJDIR)/*.o bgolly RuleTableToTree
	rm -rf $(APP_NAME).app

bgolly: $(BASEOBJ) $(OBJDIR)/bgolly.o
	$(CXXC) $(CXXBASE) -o bgolly $(BASEOBJ) $(OBJDIR)/bgolly.o $(LDBASE)

RuleTableToTree: $(BASEOBJ) $(OBJDIR)/RuleTableToTree.o
	$(CXXC) $(CXXBASE) -o RuleTableToTree $(BASEOBJ) $(OBJDIR)/RuleTableToTree.o $(LDBASE)

$(OBJDIR)/bgolly.o: bgolly.cpp
	$(CXXC) $(CXXBASE) -c -o $@ bgolly.cpp

$(OBJDIR)/RuleTableToTree.o: RuleTableToTree.cpp
	$(CXXC) $(CXXBASE) -c -o $@ RuleTableToTree.cpp

app.bin: $(BASEOBJ) $(WXOBJ)
	$(CXXC) -o $@ $(BASEOBJ) $(WXOBJ) $(LDFLAGS) -L$(LIBDIRNAME) $(__WXLIB_HTML_p) $(__WXLIB_ADV_p) \
   $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_NET_p) $(__LIB_TIFF_p) $(__LIB_PNG_p) \
   $(EXTRALIBS) $(EXTRALIBS_GUI) $(PERL_LINK) $(PYTHON_LINK)

$(APP_NAME).app/Contents/PkgInfo: app.bin Info.plist.in \
app.icns file-mc.icns file-rle.icns
	mkdir -p $(APP_NAME).app/Contents
	mkdir -p $(APP_NAME).app/Contents/MacOS
	mkdir -p $(APP_NAME).app/Contents/Resources
	
	sed -e "s/VERSION/$(APP_VERSION)/" \
	Info.plist.in >$(APP_NAME).app/Contents/Info.plist
	
	echo -n "APPLGoLy" >$(APP_NAME).app/Contents/PkgInfo
	
	mv -f app.bin $(APP_NAME).app/Contents/MacOS/$(APP_NAME)
	
	cp -f *.icns $(APP_NAME).app/Contents/Resources

app_bundle: $(APP_NAME).app/Contents/PkgInfo

$(OBJDIR)/bigint.o: bigint.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ bigint.cpp

$(OBJDIR)/lifealgo.o: lifealgo.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ lifealgo.cpp

$(OBJDIR)/hlifealgo.o: hlifealgo.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ hlifealgo.cpp

$(OBJDIR)/hlifedraw.o: hlifedraw.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ hlifedraw.cpp

$(OBJDIR)/qlifealgo.o: qlifealgo.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ qlifealgo.cpp

$(OBJDIR)/qlifedraw.o: qlifedraw.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ qlifedraw.cpp

$(OBJDIR)/jvnalgo.o: jvnalgo.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ jvnalgo.cpp

$(OBJDIR)/ruletable_algo.o: ruletable_algo.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ ruletable_algo.cpp

$(OBJDIR)/ruletreealgo.o: ruletreealgo.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ ruletreealgo.cpp

$(OBJDIR)/generationsalgo.o: generationsalgo.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ generationsalgo.cpp

$(OBJDIR)/ghashbase.o: ghashbase.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ ghashbase.cpp

$(OBJDIR)/ghashdraw.o: ghashdraw.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ ghashdraw.cpp

$(OBJDIR)/liferules.o: liferules.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ liferules.cpp

$(OBJDIR)/liferender.o: liferender.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ liferender.cpp

$(OBJDIR)/readpattern.o: readpattern.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ readpattern.cpp

$(OBJDIR)/writepattern.o: writepattern.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ writepattern.cpp

$(OBJDIR)/util.o: util.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ util.cpp

$(OBJDIR)/viewport.o: viewport.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ viewport.cpp

$(OBJDIR)/lifepoll.o: lifepoll.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ lifepoll.cpp

$(OBJDIR)/wxutils.o: wxutils.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxutils.cpp

$(OBJDIR)/wxprefs.o: wxprefs.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxprefs.cpp

$(OBJDIR)/wxalgos.o: wxalgos.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxalgos.cpp

$(OBJDIR)/wxrule.o: wxrule.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxrule.cpp

$(OBJDIR)/wxinfo.o: wxinfo.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxinfo.cpp

$(OBJDIR)/wxhelp.o: wxhelp.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxhelp.cpp

$(OBJDIR)/wxstatus.o: wxstatus.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxstatus.cpp

$(OBJDIR)/wxview.o: wxview.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxview.cpp

$(OBJDIR)/wxrender.o: wxrender.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxrender.cpp

$(OBJDIR)/wxperl.o: wxperl.cpp
	$(CXXC) $(CXXFLAGS) $(PERL_INCLUDE) -c -o $@ wxperl.cpp

$(OBJDIR)/wxpython.o: wxpython.cpp
	$(CXXC) $(CXXFLAGS) $(PYTHON_INCLUDE) -c -o $@ wxpython.cpp

$(OBJDIR)/wxscript.o: wxscript.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxscript.cpp

$(OBJDIR)/wxfile.o: wxfile.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxfile.cpp

$(OBJDIR)/wxedit.o: wxedit.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxedit.cpp

$(OBJDIR)/wxselect.o: wxselect.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxselect.cpp

$(OBJDIR)/wxcontrol.o: wxcontrol.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxcontrol.cpp

$(OBJDIR)/wxtimeline.o: wxtimeline.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxtimeline.cpp

$(OBJDIR)/wxundo.o: wxundo.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxundo.cpp

$(OBJDIR)/wxlayer.o: wxlayer.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxlayer.cpp

$(OBJDIR)/wxmain.o: wxmain.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxmain.cpp

$(OBJDIR)/wxgolly.o: wxgolly.cpp
	$(CXXC) $(CXXFLAGS) -c -o $@ wxgolly.cpp

srcdist:
	-rm -rf $(RELEASENAME)-src
	mkdir $(RELEASENAME)-src
	cp -rp $(SRCFILES) $(SHAREDFILES) $(RELEASENAME)-src
	find $(RELEASENAME)-src -name CVS | xargs rm -rf
	find $(RELEASENAME)-src -name '.[^.]*' -delete
	find $(RELEASENAME)-src/Scripts/Python -name '*.pyc' -delete
	tar -cf - ./$(RELEASENAME)-src | gzip > $(RELEASENAME)-src.tar.gz

bindist: all
	-rm -rf $(RELEASENAME)-mac
	mkdir $(RELEASENAME)-mac
	cp -rp $(APP_NAME).app bgolly RuleTableToTree $(SHAREDFILES) $(RELEASENAME)-mac
	find $(RELEASENAME)-mac -name CVS | xargs rm -rf
	find $(RELEASENAME)-mac -name '.[^.]*' -delete
	find $(RELEASENAME)-mac/Scripts/Python -name '*.pyc' -delete
	/Developer/Tools/SetFile -c ttxt -t TEXT $(RELEASENAME)-mac/README
	/Developer/Tools/SetFile -c ttxt -t TEXT $(RELEASENAME)-mac/LICENSE
	echo Now create zip archive of $(RELEASENAME)-mac
###tar -cf - ./$(RELEASENAME)-mac | gzip > $(RELEASENAME)-mac.tar.gz