-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
183 lines (164 loc) · 6.9 KB
/
GNUmakefile
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
##---------------------------------------------------------------------
# GNUmakefile for wxWidgets
# Call Makefile to do the work, but for the install case, unpack the
# tarball to create the project source directory. The wxPythonSrc
# tarball contains both wxWidgets and wxPython
##---------------------------------------------------------------------
PROJECT = wxWidgets
NAME = wxPython-src
VERSION = 2.8.8.1
export CURRENT_VERSION = $(shell echo $(VERSION) | sed 's/\.[^.]*$$//')
export BASE_VERSION = $(shell echo $(CURRENT_VERSION) | sed 's/\.[^.]*$$//')
export COMPATIBILITY_VERSION = 2.6
NAMEVERS = $(NAME)-$(VERSION)
TARBALL = $(NAMEVERS).tar.bz2
FAKEBIN = $(OBJROOT)/bin
WXWIDGETSTOP = $(OBJROOT)/$(PROJECT)
WXWIDGETSBUILD = $(WXWIDGETSTOP)/darwin
PYTHONPROJECT = python
VERSIONERDIR = /usr/local/versioner
PYTHONVERSIONS = $(VERSIONERDIR)/$(PYTHONPROJECT)/versions
INCOMPATIBLE = 3.0
DEFAULT := $(shell sed -n '/^DEFAULT = /s///p' $(PYTHONVERSIONS))
VERSIONS := $(filter-out $(INCOMPATIBLE), $(shell grep '^[0-9]' $(PYTHONVERSIONS)))
ORDEREDVERS := $(DEFAULT) $(filter-out $(DEFAULT),$(VERSIONS))
TESTOK := -f $(shell echo $(foreach vers,$(VERSIONS),$(OBJROOT)/$(vers)/.ok) | sed 's/ / -a -f /g')
WXPYTHONPROJECT = wxPython
WXPYTHONPROJECTVERS = $(WXPYTHONPROJECT)-$(VERSION)
WXPYTHONBUILD = $(OBJROOT)/$(PROJECT)/$(WXPYTHONPROJECT)
WXPYTHONDEFAULT = $(OBJROOT)/$(DEFAULT)
DOC = $(DSTROOT)/Developer/Documentation
DOCPYTHON = $(DOC)/Python
DOCPYTHONWXPYTHON = $(DOCPYTHON)/$(WXPYTHONPROJECT)
DOCWXWIDGETS = $(DOC)/$(PROJECT)
DOCWXWIDGETSWXPYTHON = $(DOCWXWIDGETS)/$(WXPYTHONPROJECT)
EXAMPLES = $(DSTROOT)/Developer/Examples
EXAMPLESPYTHON = $(EXAMPLES)/Python
EXAMPLESPYTHONWXPYTHON = $(EXAMPLESPYTHON)/$(WXPYTHONPROJECT)
EXAMPLESWXWIDGETS = $(EXAMPLES)/$(PROJECT)
EXAMPLESWXWIDGETSWXPYTHON = $(EXAMPLESWXWIDGETS)/$(WXPYTHONPROJECT)
OSV = $(DSTROOT)/usr/local/OpenSourceVersions
OSL = $(DSTROOT)/usr/local/OpenSourceLicenses
ifndef LD_TWOLEVEL_NAMESPACE
export LD_TWOLEVEL_NAMESPACE = YES
endif
ifndef MACOSX_DEPLOYMENT_TARGET
export MACOSX_DEPLOYMENT_TARGET = 10.5
endif
no_target: $(PROJECT) $(WXPYTHONPROJECT)
$(PROJECT): $(WXWIDGETSBUILD)
$(MAKE) -C $(OBJROOT) -f Makefile \
SRCROOT=$(OBJROOT) OBJROOT=$(WXWIDGETSBUILD)
$(WXPYTHONPROJECT): $(WXWIDGETSBUILD) $(FAKEBIN)/wx-config
$(MAKE) -C $(OBJROOT) -f Makefile.wxPython \
OBJROOT=$(WXPYTHONBUILD) FAKEBIN=$(FAKEBIN)
$(FAKEBIN)/wx-config:
mkdir -p $(FAKEBIN)
cp $(DSTROOT)/usr/bin/wx-config $(FAKEBIN)/wx-config
sed 's,XXXDSTROOTXXX,$(DSTROOT),' $(SRCROOT)/fix/wx-config.ed | ed - $(FAKEBIN)/wx-config
$(WXWIDGETSBUILD):
rsync -a $(SRCROOT)/ $(OBJROOT)
@set -x && \
cd $(OBJROOT) && \
gnutar xjf $(TARBALL) && \
rm -rf $(PROJECT) && \
mv $(NAMEVERS) $(PROJECT) && \
chmod a-x $(PROJECT)/wxPython/demo/bmp_source/customcontrol.png && \
ed - $(PROJECT)/configure < fix/configure.ed && \
ed - $(PROJECT)/Makefile.in < fix/Makefile.in.ed && \
ed - $(PROJECT)/include/wx/platform.h < fix/platform.h.ed && \
ed - $(PROJECT)/src/mac/carbon/morefilex/MoreFilesX.c < fix/MoreFilesX.ed && \
ed - $(PROJECT)/src/mac/carbon/morefilex/MoreFilesX.h < fix/MoreFilesX.ed && \
ex - $(PROJECT)/wxPython/config.py < fix/O3.ex && \
cp -f fix/anykey.wav $(PROJECT)/wxPython/demo/data/anykey.wav && \
for i in `find $(PROJECT) -name Makefile.in | xargs fgrep -l -e -compatibility_version`; do \
ed - $$i < fix/compatibility_version.ed || exit 1; \
done
find $(OBJROOT) -type f -perm +111 \( -name '*.h' -o -name '*.cpp' -o -name '*.icns' -o -name '*.png' -o -name '*.txt' \) | xargs chmod -v a-x
mkdir $(WXWIDGETSBUILD)
install: $(PROJECT)install $(WXPYTHONPROJECT)install
install -d $(OSV)
install $(SRCROOT)/$(PROJECT).plist $(OSV)
install -d $(OSL)
install $(OBJROOT)/$(PROJECT)/docs/licence.txt $(OSL)/$(PROJECT).txt
$(PROJECT)install: $(WXWIDGETSBUILD)
$(MAKE) -C $(OBJROOT) -f Makefile install \
SRCROOT=$(OBJROOT) OBJROOT=$(WXWIDGETSBUILD)
rm -rf $(DSTROOT)/usr/share/locale
install -d -g admin -m 0775 $(DOCWXWIDGETS)
rsync -rlt $(WXWIDGETSTOP)/docs $(DOCWXWIDGETS)
-chown -R root:admin $(DOCWXWIDGETS)
-chmod -R g+w $(DOCWXWIDGETS)
strip $(DSTROOT)/usr/bin/wxrc-2.8
rm -f $(DSTROOT)/Developer/Documentation/wxWidgets/docs/html/wx/wx.cn1
$(WXPYTHONPROJECT)install: $(WXWIDGETSBUILD) $(FAKEBIN)/wx-config
@set -x && \
mv -f '$(WXPYTHONBUILD)' '$(OBJROOT)/$(DEFAULT)' && \
for vers in $(filter-out $(DEFAULT),$(VERSIONS)); do \
ditto '$(OBJROOT)/$(DEFAULT)' "$(OBJROOT)/$$vers" || exit 1; \
done && \
for vers in $(VERSIONS); do \
mkdir -p "$(SYMROOT)/$$vers" && \
mkdir -p "$(OBJROOT)/$$vers/DSTROOT" || exit 1; \
(echo "######## Building $$vers:" `date` '########' > "$(SYMROOT)/$$vers/LOG" 2>&1 && \
TOPSRCROOT='$(SRCROOT)' \
VERSIONER_PYTHON_VERSION=$$vers \
VERSIONER_PYTHON_PREFER_32_BIT=yes \
$(MAKE) -C $(OBJROOT) -f Makefile.wxPython install \
OBJROOT="$(OBJROOT)/$$vers" FAKEBIN=$(FAKEBIN) \
DSTROOT="$(OBJROOT)/$$vers/DSTROOT" \
SYMROOT="$(SYMROOT)/$$vers" >> "$(SYMROOT)/$$vers/LOG" 2>&1 && \
touch "$(OBJROOT)/$$vers/.ok" && \
echo "######## Finished $$vers:" `date` '########' >> "$(SYMROOT)/$$vers/LOG" 2>&1 \
) & \
done && \
wait && \
for vers in $(VERSIONS); do \
cat $(SYMROOT)/$$vers/LOG && \
rm -f $(SYMROOT)/$$vers/LOG || exit 1; \
done && \
if [ $(TESTOK) ]; then \
$(MAKE) merge; \
else \
echo '#### error detected, not merging'; \
exit 1; \
fi
merge: mergebegin mergeversions mergefinish
mergebegin:
@echo '####### Merging #######'
# Normally, the versioned DSTROOT directories should each have /usr/include,
# but setup.py has been hacked to install into "wx-config --prefix"
# (= $(DSTROOT)/usr). This means the multiple versions are overwriting each
# other. The hack is in wx/build/config.py, but it isn't clear how to get
# it to do the right thing, so we just leave it for now.
#MERGEDEFAULT = \
# usr
#mergedefault:
# cd $(OBJROOT)/$(DEFAULT)/DSTROOT && rsync -Ra $(MERGEDEFAULT) $(DSTROOT)
MERGEVERSIONS = \
System
mergeversions:
@set -x && \
for vers in $(VERSIONS); do \
cd $(OBJROOT)/$$vers/DSTROOT && \
rsync -Ra $(MERGEVERSIONS) $(DSTROOT) || exit 1; \
done
mergefinish:
install -d -g admin -m 0775 $(EXAMPLESWXWIDGETSWXPYTHON)
rsync -rlt $(WXPYTHONDEFAULT)/demo $(WXPYTHONDEFAULT)/samples $(EXAMPLESWXWIDGETSWXPYTHON)
-chown -R root:admin $(EXAMPLESWXWIDGETSWXPYTHON)
-chmod -R g+w $(EXAMPLESWXWIDGETSWXPYTHON)
install -d -g admin -m 0775 $(EXAMPLESPYTHON)
ln -s ../$(PROJECT)/$(WXPYTHONPROJECT) $(EXAMPLESPYTHONWXPYTHON)
install -d -g admin -m 0775 $(DOCWXWIDGETSWXPYTHON)
rsync -rlt $(WXPYTHONDEFAULT)/docs/ $(DOCWXWIDGETSWXPYTHON)
-chown -R root:admin $(DOCWXWIDGETSWXPYTHON)
-chmod -R g+w $(DOCWXWIDGETSWXPYTHON)
install -d -g admin -m 0775 $(DOCPYTHON)
ln -s ../$(PROJECT)/$(WXPYTHONPROJECT) $(DOCPYTHONWXPYTHON)
for i in `find $(EXAMPLESWXWIDGETSWXPYTHON) -name __init__.py -size 0c`; do \
echo $$i && \
echo '#' > $$i || exit 1; \
done
.DEFAULT:
@$(MAKE) -f Makefile $@