forked from gphilippot/purebasic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
345 lines (278 loc) · 9.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
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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# shared with debugger makefile for simplicity
TARGET = $(PB_BUILDTARGET)/ide
ifeq ($(PB_JAVASCRIPT),1)
HOME=$(SPIDERBASIC_HOME)
IDENAME=SpiderBasic
STARTUPIMAGE=data/SpiderBasic/SplashScreen.png
ABOUTIMAGE=data/SpiderBasic/About.bmp
ICOFILE=data/SpiderBasic/Logo.ico
ICOSOURCEFILE=data/SpiderBasic/Logo.ico
OSXICOFILE=data/SpiderBasic/Logo.icns
else
HOME=$(PUREBASIC_HOME)
IDENAME=PureBasic
STARTUPIMAGE=data/startuplogo.png
ABOUTIMAGE=data/purebasiclogo.bmp
ICOFILE=data/PBLogoBig.ico
ICOSOURCEFILE=data/PBSourceFile.ico
OSXICOFILE=data/logo/PB 3D Mac Icon.icns
endif
ifeq ($(PB_WINDOWS),1)
PBCOMPILER = pbcompiler /QUIET
IDE = $(HOME)/$(IDENAME).exe
IDEFLAGS = /THREAD /UNICODE /XP /USER /ICON "$(ICOFILE)" /DPIAWARE
MAKEEXE = /EXE
PBPACK = $(TARGET)/pbpack.exe
MAKEBUILDINFO = $(TARGET)/makebuildinfo.exe
PBPACKFLAGS = /LINENUMBERING /CONSOLE
DEBUGFLAGS = /LINENUMBERING /DEBUGGER /CONSOLE
VERSIONFLAG = /RESOURCE $(TARGET)/VersionInfo.rc
CONSTANT = /CONSTANT
PURIFIER = /PURIFIER
DEBUGSYMBOLS =
CPUMONITORLIB =
DIALOGCOMPILER = $(PB_BUILDTARGET)/dialogcompiler/DialogCompiler.exe
MACPLIST =
MACPLISTCOMMAND =
ONERROR = /LINENUMBERING
NETWORKSUPPORT = $(TARGET)/NetworkSupport.obj
LIBMBA = $(TARGET)/libmba/libmba.lib
DOMAINSOCKET =
COLORTABLE = $(HOME)/Catalogs/ColorTable.xml
ECHOQUOTE =
ICON = ico
THEMEFOLDER = $(HOME)/Themes
else
PBCOMPILER = pbcompiler -q
ifeq ($(PB_MACOS),1)
IDE = $(HOME)/$(IDENAME).app
IDEFLAGS = --thread --unicode -n "$(OSXICOFILE)"
MACPLIST = $(TARGET)/macplist
MACPLISTCOMMAND = $(TARGET)/macplist $(HOME)/$(IDENAME).app
ifeq ($(PB_CARBON),1)
IDEFLAGS += --subsystem carbon
endif
else
IDENAME_LOWERCASE = $(shell echo $(IDENAME) | tr A-Z a-z)
IDE = $(HOME)/compilers/$(IDENAME_LOWERCASE)
IDEFLAGS = --thread --unicode --subsystem gtk2
MACPLIST =
MACPLISTCOMMAND =
endif
CONSTANT = --constant
PURIFIER = --purifier
MAKEEXE = -e
PBPACK = $(TARGET)/pbpack
MAKEBUILDINFO = $(TARGET)/makebuildinfo
PBPACKFLAGS =
DEBUGFLAGS = -d
DEBUGSYMBOLS = -ds
VERSIONFLAG =
CPUMONITORLIB =
DIALOGCOMPILER = $(PB_BUILDTARGET)/dialogcompiler/dialogcompiler
ONERROR = --linenumbering
NETWORKSUPPORT = $(TARGET)/NetworkSupport.o
DOMAINSOCKET = $(TARGET)/AutomationDomainSocket.o
LIBMBA = $(TARGET)/libmba/libmba.a
COLORTABLE = $(HOME)/catalogs/ColorTable.xml
ECHOQUOTE = "
ICON = png
THEMEFOLDER = $(HOME)/themes
endif
PACKLEVEL = -q -l4
THEMES = \
$(TARGET)/DefaultTheme.zip \
$(THEMEFOLDER)/SilkTheme.zip
PROFILERICONS = \
$(TARGET)/arrow.$(ICON) \
$(TARGET)/select.$(ICON) \
$(TARGET)/zoomin.$(ICON) \
$(TARGET)/zoomout.$(ICON) \
$(TARGET)/zoomall.$(ICON) \
$(TARGET)/cross.$(ICON)
DIALOGS = \
$(TARGET)/Find.pb \
$(TARGET)/Grep.pb \
$(TARGET)/Goto.pb \
$(TARGET)/CompilerOptions.pb \
$(TARGET)/AddTools.pb \
$(TARGET)/About.pb \
$(TARGET)/Preferences.pb \
$(TARGET)/Templates.pb \
$(TARGET)/StructureViewer.pb \
$(TARGET)/Projects.pb \
$(TARGET)/Build.pb \
$(TARGET)/Diff.pb \
$(TARGET)/FileMonitor.pb \
$(TARGET)/History.pb \
$(TARGET)/HistoryShutdown.pb \
$(TARGET)/CreateApp.pb \
$(TARGET)/Updates.pb
DEPENDENCIES = \
$(COLORTABLE) \
$(TARGET)/images.pak \
*.pb \
../PureBasicDebugger/*.pb \
$(DIALOGS) \
$(VERSIONINFO) \
$(CPUMONITORLIB) \
$(MACPLIST) \
$(PROFILERICONS) \
$(THEMES) \
$(MAKEBUILDINFO) \
$(NETWORKSUPPORT) \
$(DOMAINSOCKET)
ifeq ($(PB_JAVASCRIPT),1)
IDEFLAGS+=$(CONSTANT) SpiderBasic=1
endif
#
# default target
#
ide : VERSION $(DEPENDENCIES)
make --directory libmba
$(MAKEBUILDINFO) $(TARGET)
$(PBCOMPILER) PureBasic.pb $(MAKEEXE) $(IDE) $(IDEFLAGS) $(VERSIONFLAG) $(CONSTANT) BUILD_DIRECTORY=$(TARGET)/
$(MACPLISTCOMMAND)
#
# demo version of the IDE
#
demo : VERSION_DEMO $(DEPENDENCIES)
make --directory libmba
$(MAKEBUILDINFO) $(TARGET)
$(PBCOMPILER) PureBasic.pb $(MAKEEXE) $(IDE) $(IDEFLAGS) $(VERSIONFLAG) $(CONSTANT) DEMO=1 $(CONSTANT) BUILD_DIRECTORY=$(TARGET)/
$(MACPLISTCOMMAND)
#
# debug version (with linenumbering / gtk error messages)
#
debug : VERSION_DEBUG $(DEPENDENCIES)
make --directory libmba
$(MAKEBUILDINFO) $(TARGET)
$(PBCOMPILER) PureBasic.pb $(MAKEEXE) $(IDE) $(IDEFLAGS) $(DEBUGFLAGS) $(DEBUGSYMBOLS) $(VERSIONFLAG) $(CONSTANT) DEBUG=1 $(CONSTANT) BUILD_DIRECTORY=$(TARGET)/
$(MACPLISTCOMMAND)
#
# debug version + Purifier
#
purifier : VERSION_DEBUG $(DEPENDENCIES)
make --directory libmba
$(MAKEBUILDINFO) $(TARGET)
$(PBCOMPILER) PureBasic.pb $(MAKEEXE) $(IDE) $(IDEFLAGS) $(DEBUGFLAGS) $(DEBUGSYMBOLS) $(PURIFIER) $(VERSIONFLAG) $(CONSTANT) DEBUG=1 $(CONSTANT) BUILD_DIRECTORY=$(TARGET)/
$(MACPLISTCOMMAND)
#
# default target, but without stripping debug symbols (for gdk debugging)
#
symbols : VERSION $(DEPENDENCIES)
make --directory libmba
$(MAKEBUILDINFO) $(TARGET)
$(PBCOMPILER) PureBasic.pb $(MAKEEXE) $(IDE) $(IDEFLAGS) $(DEBUGSYMBOLS) $(VERSIONFLAG) $(CONSTANT) BUILD_DIRECTORY=$(TARGET)/
$(MACPLISTCOMMAND)
#
# default target, but with onerror support
#
onerror : VERSION $(DEPENDENCIES)
make --directory libmba
$(MAKEBUILDINFO) $(TARGET)
$(PBCOMPILER) PureBasic.pb $(MAKEEXE) $(IDE) $(IDEFLAGS) $(VERSIONFLAG) $(ONERROR) $(CONSTANT) BUILD_DIRECTORY=$(TARGET)/
$(MACPLISTCOMMAND)
#
# special target to build all needed files, but not the IDE itself. (good for testing from inside the ide)
#
nocompile : $(TARGET)/dummy VERSION $(DEPENDENCIES)
make --directory libmba
$(MAKEBUILDINFO) $(TARGET)
#
# required other targets
#
$(TARGET)/images.pak : $(TARGET)/dummy $(STARTUPIMAGE) $(ABOUTIMAGE) $(TARGET)/ToolsPanelRight.$(ICON) $(TARGET)/ToolsPanelLeft.$(ICON) $(TARGET)/CloseButton.$(ICON) data/EmptySpace.png data/MissingIcon.png $(PBPACK)
$(PBPACK) $(PACKLEVEL) $(TARGET)/images.pak $(STARTUPIMAGE) $(ABOUTIMAGE) $(TARGET)/ToolsPanelRight.$(ICON) $(TARGET)/ToolsPanelLeft.$(ICON) $(TARGET)/CloseButton.$(ICON) data/EmptySpace.png data/MissingIcon.png
$(PBPACK) : tools/pbpack.pb $(TARGET)/dummy
$(PBCOMPILER) tools/pbpack.pb $(MAKEEXE) $(PBPACK) $(PBPACKFLAGS)
$(MAKEBUILDINFO) : tools/makebuildinfo.pb $(TARGET)/dummy
$(PBCOMPILER) tools/makebuildinfo.pb $(MAKEEXE) $(MAKEBUILDINFO) $(PBPACKFLAGS)
$(TARGET)/%.ico : ../PureBasicDebugger/Data/%.png $(TARGET)/dummy
tools/png2ico.exe $@ $<
$(TARGET)/%.ico : data/%.png $(TARGET)/dummy
tools/png2ico.exe $@ $<
# for a few png, we simply copy them to make it easier. (the single cases in images.pak like $(TARGET)/ToolsPanelRight.$(ICON))
$(TARGET)/%.png : data/%.png $(TARGET)/dummy
cp $< $@
$(TARGET)/%.png : ../PureBasicDebugger/Data/%.png $(TARGET)/dummy
cp $< $@
$(TARGET)/%.pb : dialogs/%.xml $(DIALOGCOMPILER) $(TARGET)/dummy
$(DIALOGCOMPILER) $< $@
# theme targets (-mkdir suppresses errors if the directory exists)
#
$(TARGET)/DefaultTheme.zip: data/DefaultTheme/*
rm -f $(TARGET)/DefaultTheme.zip
zip -jq $(TARGET)/DefaultTheme.zip data/DefaultTheme/*
$(THEMEFOLDER)/SilkTheme.zip: data/SilkTheme/*
-mkdir "$(THEMEFOLDER)"
rm -f $(THEMEFOLDER)/SilkTheme.zip
zip -jq $(THEMEFOLDER)/SilkTheme.zip data/SilkTheme/*
$(COLORTABLE): data/ColorTable.xml
cp -f data/ColorTable.xml $(COLORTABLE)
# this also works on windows
#
$(DIALOGCOMPILER) : ../DialogManager/DialogCompiler.pb $(TARGET)/dummy
make --directory ../DialogManager
#
# Windows only: create version information resource
#
ifeq ($(PB_WINDOWS),1)
$(TARGET)/makeversion.exe : tools/makeversion.pb $(TARGET)/dummy
$(PBCOMPILER) tools/makeversion.pb /EXE $(TARGET)/makeversion.exe /CONSOLE
VERSION: $(TARGET)/makeversion.exe $(TARGET)/dummy
$(TARGET)/makeversion.exe ide $(TARGET)/VersionInfo.rc $(shell PWD)/$(ICOSOURCEFILE)
VERSION_DEBUG: $(TARGET)/makeversion.exe $(TARGET)/dummy
$(TARGET)/makeversion.exe debug $(TARGET)/VersionInfo.rc $(shell PWD)/$(ICOSOURCEFILE)
VERSION_DEMO: $(TARGET)/makeversion.exe $(TARGET)/dummy
$(TARGET)/makeversion.exe demo $(TARGET)/VersionInfo.rc $(shell PWD)/$(ICOSOURCEFILE)
# Windows only: Syntax highlighting dll
dll : tools/HighlightingDll.pb
$(PBCOMPILER) tools/HighlightingDll.pb /dll /exe "$(HOME)/SDK/Syntax Highlighting/SyntaxHighlighting.dll" /CONSTANT MAKEFILE=1
cp "tools\HighlightingDll_example.pb" "$(HOME)/SDK/Syntax Highlighting/Example.pb"
# (Currently windows only, later hopefully crossplatform)
# IDE Automation sdk (dll + examples)
automation_sdk : sdk/Example.pb sdk/Automation.pb AutomationLibrary.pb FileSystem.pb RemoteProcedureCall.pb CompilerFlags.pb Macro.pb
-mkdir "$(HOME)/SDK/Automation"
$(PBCOMPILER) AutomationLibrary.pb /dll /exe "$(HOME)/SDK/Automation/Automation.dll"
$(PBCOMPILER) AutomationLibrary.pb /dll /exe "$(HOME)/SDK/Automation/AutomationUnicode.dll" /UNICODE
cp sdk/Automation.pb "$(HOME)/SDK/Automation/Automation.pb"
cp sdk/Example.pb "$(HOME)/SDK/Automation/Example.pb"
#
# For other os: dummy version targets
#
else
VERSION:
VERSION_DEBUG:
VERSION_DEMO:
dll:
sdk:
endif
#
# Special target for the program that creates the Info.plist for mac.
# On the other OS this is not needed
#
ifeq ($(PB_MACOS),1)
$(MACPLIST) : tools/macplist.pb $(TARGET)/dummy
$(PBCOMPILER) tools/macplist.pb -e $(MACPLIST)
endif
# compile the NetworkSupport.c
#
ifeq ($(PB_WINDOWS),1)
$(NETWORKSUPPORT) : ../PureBasicDebugger/NetworkSupport.c $(PB_LIBRARIES)/Debugger/DebuggerInternal.h $(PB_LIBRARIES)/Debugger/OSSpecific.h
$(PB_VC8_ANSI) /O1 /c $< /Fo$@
# not needed on Windows
$(DOMAINSOCKET):
else
$(NETWORKSUPPORT) : ../PureBasicDebugger/NetworkSupport.c $(PB_LIBRARIES)/Debugger/DebuggerInternal.h $(PB_LIBRARIES)/Debugger/OSSpecific.h
$(PB_GCC_ANSI) $(PB_OPT_SPEED) -c $< -o $@
# domain socket function for IDE automation
$(DOMAINSOCKET) : AutomationDomainSocket.c
$(PB_GCC_ANSI) $(PB_OPT_SPEED) -c $< -o $@
endif
$(TARGET)/dummy:
mkdir "$(TARGET)"
touch $(TARGET)/dummy
clean:
rm -rf $(TARGET)
make clean --directory ../DialogManager