Skip to content

Commit b074dee

Browse files
committed
WIP: new build system
1 parent b7c237f commit b074dee

File tree

12 files changed

+237
-86
lines changed

12 files changed

+237
-86
lines changed
File renamed without changes.

make/pre-make.r3

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,80 @@ spec: load spec-file
3737
;-- Options:
3838
verbose: off
3939

40-
c-core-files: spec/core-files
41-
c-host-files: spec/host-files
40+
root-dir: spec/root
41+
c-core-files: spec/core-files
42+
c-host-files: spec/host-files
43+
mezz-base-files: spec/mezz-base-files
44+
mezz-sys-files: spec/mezz-sys-files
45+
mezz-lib-files: spec/mezz-lib-files
46+
mezz-prot-files: spec/mezz-prot-files
47+
boot-host-files: spec/boot-host-files
48+
49+
;either file? boot-script [
50+
; if #"/" <> first boot-script [boot-script: join root-dir boot-script]
51+
; unless exists? boot-script [
52+
; print-error ["Boot script not found:" as-red boot-script]
53+
; quit/return 3
54+
; ]
55+
;][
56+
; if boot-script [
57+
; print-error ["Boot script must be a file, but is:" as-red boot-script]
58+
; quit/return 3
59+
; ]
60+
;]
4261

43-
;@@ TODO: vygenerovat get-config.h a ten pouzit misto opt-config.h
44-
;@@+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4562

4663
switch system/platform [
4764
Windows [ if block? spec/host-files-win32 [append c-host-files spec/host-files-win32] ]
4865
]
4966

67+
5068
assert [
51-
block? c-core-files not empty? c-core-files
52-
block? c-host-files not empty? c-host-files
69+
block? c-core-files
70+
block? c-host-files
71+
not empty? c-core-files
72+
not empty? c-host-files
73+
block? mezz-base-files
74+
block? mezz-sys-files
75+
block? mezz-lib-files
76+
block? mezz-prot-files
77+
]
78+
79+
absolutize-path: func[file][
80+
if #"/" <> first file/1 [insert file src-dir]
81+
file
82+
]
83+
src-dir: dirize spec/source
84+
if #"/" <> first src-dir [src-dir: join spec/root src-dir]
85+
86+
if file? src-dir [
87+
forall c-core-files [absolutize-path c-core-files/1]
88+
forall c-host-files [absolutize-path c-host-files/1]
89+
forall mezz-base-files [absolutize-path mezz-base-files/1]
90+
forall mezz-sys-files [absolutize-path mezz-sys-files/1]
91+
forall mezz-lib-files [absolutize-path mezz-lib-files/1]
92+
forall mezz-prot-files [absolutize-path mezz-prot-files/1]
5393
]
5494

55-
if file? src-dir: dirize spec/source [
56-
forall c-core-files [insert c-core-files/1 src-dir]
57-
forall c-host-files [insert c-host-files/1 src-dir]
95+
c-core-files: unique c-core-files
96+
c-host-files: unique c-host-files
97+
98+
mezz-files: reduce [
99+
;Boot Mezzanine Functions
100+
unique mezz-base-files
101+
unique mezz-sys-files
102+
unique mezz-lib-files
103+
unique mezz-prot-files
58104
]
59105

106+
60107
version: any [spec/version 3.5.0]
61108
platform: any [spec/platform system/platform]
62109
target: any [spec/target spec/os-target spec/configuration]
63110
os-base: 'win32
64111
product: any [spec/product 'Core]
112+
configs: unique any [spec/config copy []]
113+
65114

66115
unless target [
67116
; if configuration is not fully provided, try to compose it
@@ -145,9 +194,7 @@ str-version: reform [
145194
ver3: version ver3/4: none ; trimmed version to just 3 parts
146195
lib-version: version/1
147196

148-
protect [spec version c-core-files c-host-files]
149-
150-
root-dir: spec/root
197+
protect [spec version c-core-files c-host-files mezz-files configs]
151198

152199
;change-dir root-dir
153200

make/r3-view.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
101 ICON "r3.ico"
1+
101 ICON "icon/r3.ico"
22

33
1 VERSIONINFO
44
FILEVERSION 3,5,0,0

make/r3.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
101 ICON "r3.ico"
1+
101 ICON "icon/r3.ico"
22

33
1 VERSIONINFO
44
FILEVERSION 3,5,0,0

make/rebol3.reb-seed

Lines changed: 99 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: %Rebol
33
group: %rebol
44
compiler: clang
5-
strip: on
5+
strip: off
66
upx: off
77

88
root: %../
@@ -188,7 +188,7 @@ host-files-view: [
188188
%os/win32/sys-utils.c
189189
%os/win32/sys-codecs.cpp
190190
%os/win32/sys-d2d.cpp
191-
%os/win32/host-image.c
191+
;%os/win32/host-image.c
192192
;%win32/sys-codecs-ini.c
193193

194194
%os/win32/host-event.c
@@ -198,6 +198,72 @@ host-files-view: [
198198
]
199199
]
200200

201+
mezz-base-files: [
202+
;-- base: low-level boot in lib context:
203+
%mezz/base-constants.reb
204+
%mezz/base-funcs.reb
205+
%mezz/base-series.reb
206+
%mezz/base-files.reb
207+
%mezz/base-debug.reb
208+
%mezz/base-defs.reb
209+
%mezz/base-collected.reb ; contains automatically collected code from C files
210+
]
211+
mezz-sys-files: [
212+
;-- sys: low-level sys context:
213+
%mezz/sys-base.reb
214+
%mezz/sys-ports.reb
215+
%mezz/sys-codec.reb ; export to lib!
216+
%mezz/sys-load.reb
217+
%mezz/sys-start.reb
218+
]
219+
mezz-lib-files: [
220+
;-- lib: mid-level lib context:
221+
%mezz/mezz-secure.reb
222+
%mezz/mezz-types.reb
223+
%mezz/mezz-func.reb
224+
%mezz/mezz-debug.reb
225+
%mezz/mezz-control.reb
226+
%mezz/mezz-save.reb
227+
%mezz/mezz-series.reb
228+
%mezz/mezz-files.reb
229+
%mezz/mezz-shell.reb
230+
%mezz/mezz-math.reb
231+
%mezz/mezz-help.reb ; move dump-obj!
232+
%mezz/mezz-banner.reb
233+
%mezz/mezz-colors.reb
234+
%mezz/mezz-date.reb ; Internet date support
235+
; %mezz/mezz-tag.reb ; build-tag
236+
%mezz/mezz-tail.reb
237+
; %mezz/codec-unixtime.reb
238+
;-- cryptographic
239+
; %mezz/codec-utc-time.reb
240+
; %mezz/codec-pkix.reb
241+
; %mezz/codec-der.reb
242+
; %mezz/codec-crt.reb
243+
; %mezz/codec-ppk.reb
244+
; %mezz/codec-ssh-key.reb
245+
;-- compression
246+
; %mezz/codec-gzip.reb
247+
; %mezz/codec-zip.reb
248+
; %mezz/codec-tar.reb
249+
;-- other
250+
; %mezz/%codec-bbcode.reb
251+
; %mezz/%codec-json.reb
252+
; %mezz/%codec-xml.reb
253+
; %mezz/%codec-html-entities.reb
254+
; %mezz/%codec-wav.reb
255+
; %mezz/%codec-swf.reb
256+
; %mezz/%codec-image.reb ; included using: include-image-os-codec (windows only so far)
257+
; %mezz/%codec-image-ext.reb ; image codec extensions (codecs/png/size?)
258+
]
259+
mezz-prot-files: [
260+
;-- protocols:
261+
; %mezz/prot-http.reb
262+
; %mezz/prot-tls.reb
263+
; %mezz/prot-whois.reb
264+
; %mezz/prot-mysql.reb
265+
]
266+
201267
config: [ ;- this is list of configuration (optional) defines
202268
INCLUDE_MBEDTLS ;- replaced original checksum implementations
203269

@@ -233,13 +299,22 @@ config: [ ;- this is list of configuration (optional) defines
233299
;MUNGWALL ; "MungWall"-style sentinels for REBNODEs (missing Mung_Check function, not ok!) Amiga only?
234300
]
235301

302+
;-------------------------------------------------------------------------------
303+
;- Include definitions (fine-tunning products)
304+
;-------------------------------------------------------------------------------
305+
236306
include-native-bmp-codec: [config: INCLUDE_BMP_CODEC core-files: %core/u-bmp.c]
237307
include-native-png-codec: [config: INCLUDE_PNG_CODEC core-files: %core/u-png.c]
238308
include-native-jpg-codec: [config: INCLUDE_JPG_CODEC core-files: %core/u-jpg.c]
239309
include-native-gif-codec: [config: INCLUDE_GIF_CODEC core-files: %core/u-gif.c]
240-
;@@ on Windows it's better to use system image codec
310+
311+
;@@ on Windows it's better to use system image codec (ability to use more types)
241312
include-image-os-codec: [
242-
#if Windows? [config: USE_OS_IMAGE_CODECS] ;@@ rename?
313+
#if Windows? [
314+
config: INCLUDE_IMAGE_OS_CODEC
315+
host-files: %os/win32/host-image.c
316+
mezz-lib-files: %codec-image.reb
317+
]
243318
]
244319

245320
include-image-natives: [
@@ -248,7 +323,7 @@ include-image-natives: [
248323
; on Windows also: image as common entry to os image codec (if enabled)
249324
config: INCLUDE_IMAGE_NATIVES
250325
core-files: %core/n-image.c
251-
core-files: %core/n-image-resize.c
326+
core-files: %core/u-image-resize.c
252327
]
253328

254329
include-optional-checksums: [
@@ -328,9 +403,9 @@ all-includes: [
328403
common: [
329404
files: :core-files
330405
clean: %core/b-init.c ;make-boot.reb modifies embedded native code, so b-init.c must be always recompiled
331-
clean: %core/b-boot.c
332406

333-
define: :config
407+
;define: :config
408+
define: {REBOL_OPTIONS_FILE=\"gen-config.h\"}
334409

335410
;cflags: [-ffast-math]
336411

@@ -403,13 +478,15 @@ arch-x86: [
403478
;-------------------------------------------------------------------------------
404479
;- Action definitions (experimantal so far!)
405480
;-------------------------------------------------------------------------------
406-
probe-spec: action ["Probe current spec structure"][do [? spec]]
481+
probe-spec: action ["Probe current spec structure"][
482+
do [? spec]
483+
]
407484
pre-make: action ["Pre-make headers and boot code"][
408485
do %make/pre-make.r3 "$TEMP_SEED_SPEC"
409486
]
410487

411488
;-------------------------------------------------------------------------------
412-
;- List of all possible compilation targets
489+
;- All possible compilation targets and commands
413490
;-------------------------------------------------------------------------------
414491
targets: [
415492
#if Windows? [
@@ -420,10 +497,22 @@ targets: [
420497
:all-includes
421498
pre-make
422499
]
500+
"Rebol/Base x86-win32 (gcc)" [
501+
target: x86-win32
502+
product: 'Base
503+
name: %rebol3-x86-base-gcc
504+
compiler: gcc
505+
pre-make
506+
:common
507+
:common-host
508+
:arch-x86
509+
defines: [REB_EXE]
510+
]
423511
"Rebol Win-x86 exe" [
424512
target: x86-win32
425513
name: %rebol3-x86-core
426-
compiler: gcc
514+
compiler: clang
515+
:all-includes
427516
:common
428517
:common-host
429518
:arch-x86

0 commit comments

Comments
 (0)