-
Notifications
You must be signed in to change notification settings - Fork 343
/
Makefile
151 lines (131 loc) · 4.58 KB
/
Makefile
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
# Copyright 2009,2016,2017 Ronald S. Burkey <info@sandroid.org>
#
# This file is part of yaAGC.
#
# yaAGC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# yaAGC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with yaAGC; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Filename: Makefile
# Purpose: This makefile is used to build the yaDSKY2 program.
# Mods: 2009-03-06 RSB Wrote.
# 2009-05-02 RSB Added DEV_STATIC.
# 2016-07-17 RSB Added a -lX11 to some build targets.
# 2016-08-06 RSB A number of programs have previously been set
# This had been set to build statically-linked
# for USERNAME=rburkey (me!) and dynamically-linked
# for everyone else, for the purpose of making it
# easier to create installers. I am in the process
# of changing all such Linux executables that use
# agc_utilities.c to be always dynamically-linked,
# because with newer system libraries, some portions
# of agc_utilities.c doesn't work when statically
# linked. These changes affect nobody else's builds
# except mine, and only affect the Linux versions of
# the executables.
# 2016-08-24 RSB Added wxFLAGS.
APPNAME=yaDSKY2
# For cross-platform building --- i.e., for building Win32 and Mac OS X versions
# of ${APPNAME} on a Linux platform --- it is assumed that the IMCROSS
# environment (www.sandroid.org/imcross) is installed. It is further supposed
# that the IMCROSS installation directory is ~/IMCROSS and that ~/IMCROSS/bin
# is in the PATH. The following variables just reflect the default setup for
# IMCROSS.
# IMCROSS compilation is default but also allow native builds
# To build native on a platform set the NATIVE environment variable
# to either WIN32,MACOSX or LINUX
PREFIX_WIN=i386-mingw32-
PREFIX_MAC=powerpc-apple-darwin9-
BIN_WIN=${HOME}/IMCROSS/i386-mingw32/bin/
BIN_MAC=${HOME}/IMCROSS/mac/bin/
INC_MAC=${HOME}/IMCROSS/mac/include
SDK_MAC=${HOME}/IMCROSS/mac/SDKs/MacOSX10.4u.sdk
# This is just so that when I build it, I can insure that it will be statically or
# dynamically linked in the binary installers, according to my current whims.
# For anybody else, it will just accept whatever your wxWidgets default library is.
ifeq "${USER}" "rburkey"
ifdef DEV_STATIC
WXSTATIC=--static
else
EXTRA_WIN_LIBS=-lwsock32
endif
endif
ifndef WIN32
LIBS2+=-lX11
endif
.PHONY: default
default: Linux
.PHONY: all-archs
all-archs: Linux Win32 MacOsX
.PHONY: Linux
Linux: ${APPNAME}
.PHONY: Win32
Win32: ${APPNAME}.exe
.PHONY: MacOsX
MacOsX: ${APPNAME}-macosx
.PHONY: clean
clean:
rm -rf temp
rm -f *~ *.bak ${APPNAME} *.exe *-macosx*
SOURCES:=${APPNAME}.cpp
SOURCESc:=\
../yaAGC/agc_utilities.c \
../yaAGC/agc_engine.c \
../yaAGC/Backtrace.c \
../yaAGC/random.c \
../yaAGC/SocketAPI.c \
../yaAGC/rfopen.c
HEADERS:=${APPNAME}.h
${APPNAME}: ${SOURCES} ${SOURCESc} ${HEADERS}
${CC} \
`wx-config --cxxflags` ${wxFLAGS} \
-o $@ ${SOURCES} ${DASHX} ${SOURCESc} \
`wx-config --libs` \
${LIBS2}
strip $@${EXT}
${APPNAME}.exe: ${SOURCES} ${SOURCESc} ${HEADERS}
${PREFIX_WIN}${CC} \
`${BIN_WIN}wx-config ${WXSTATIC} --cxxflags` \
-o $@ ${SOURCES} ${DASHX} ${SOURCESc} \
`${BIN_WIN}wx-config ${WXSTATIC} --libs` \
${EXTRA_WIN_LIBS}
${PREFIX_WIN}strip $@
${APPNAME}-macosx: ${SOURCES} ${SOURCESc} ${HEADERS}
powerpc-apple-darwin9-${CC} \
-arch ppc -I${INC_MAC} -isysroot ${SDK_MAC} \
-I${SDK_MAC}/usr/include/c++/4.0.0 \
-I${SDK_MAC}/usr/include/c++/4.0.0/powerpc-apple-darwin9 \
`${BIN_MAC}/wx-config ${WXSTATIC} --cxxflags` \
-o $@-ppc ${SOURCES} ${DASHX} ${SOURCESc} \
`${BIN_MAC}/wx-config ${WXSTATIC} --libs`
powerpc-apple-darwin9-lipo \
$@-ppc \
-remove i386 \
-output $@-ppc-a
i686-apple-darwin9-${CC} \
-arch i386 -I${INC_MAC} -isysroot ${SDK_MAC} \
-I${SDK_MAC}/usr/include/c++/4.0.0 \
-I${SDK_MAC}/usr/include/c++/4.0.0/i686-apple-darwin9 \
`${BIN_MAC}/wx-config ${WXSTATIC} --cxxflags` \
-o $@-i386 ${SOURCES} ${DASHX} ${SOURCESc} \
`${BIN_MAC}/wx-config ${WXSTATIC} --libs`
i686-apple-darwin9-lipo \
$@-i386 \
-remove ppc \
-output $@-i386-a
${PREFIX_MAC}lipo \
$@-ppc-a \
$@-i386-a \
-create \
-output $@
${PREFIX_MAC}strip $@