Skip to content

Commit e5638c0

Browse files
committed
FEAT: does not CLEAN on each build command (for faster re-compilation)
1 parent 0e88843 commit e5638c0

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

make/make.r3

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ attempt [do %make-settings.r]
1111
cmd-menu: {^/^[[1;33;49mPlease choose version to build:^[[0m^/}
1212

1313
cmd-actions: [
14+
"c" [val: none eval-cmd [{make TOOLS=} TOOLS { clean}]]
1415
"q" [quit]
1516
"" [val: none]
1617
]
@@ -72,6 +73,7 @@ foreach [name data] settings [
7273
]
7374
i: i + 1
7475
]
76+
append cmd-menu {^-^[[1;32;49mc^[[0m: Clean^/}
7577
append cmd-menu {^-^[[1;32;49mq^[[0m: Quit^/}
7678

7779
eval-cmd: func[cmd [string! block!] /local err][
@@ -89,8 +91,10 @@ move-file: func[file [file!] dir [file!]][
8991
]
9092

9193
menu?: true
94+
prev: none
9295
forever [
9396
if menu? [print cmd-menu]
97+
9498
error? try [val: trim/head/tail ask "^[[1;32;49mBuild version: ^[[0m"]
9599
switch/default val cmd-actions [
96100
print "What?"
@@ -99,6 +103,11 @@ forever [
99103

100104
if val [
101105
eval-cmd [rebol-tool " -qs ../src/tools/make-make.r " OS_ID]
106+
if prev <> val [
107+
;clean if making different target or for the first run
108+
eval-cmd [{make TOOLS=} TOOLS { clean}]
109+
prev: val
110+
]
102111
eval-cmd [{make TOOLS=} TOOLS { all}]
103112
make-dir/deep BUILD_DIR
104113

src/tools/make-make.r

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ make:
105105
$(REBOL) $T/make-make.r $(OS_ID)
106106
107107
clean:
108-
$(RM) libr3$(LIB_SUFFIX) objs $(RES)
108+
$(RM) $(RES)
109+
$(RM) objs
109110
110111
all:
111-
$(MAKE) clean
112112
$(MAKE) prep
113113
$(MAKE) r3$(BIN_SUFFIX)
114114
$(MAKE) lib
@@ -411,7 +411,7 @@ unless flag? -SP [ ; Use standard paths:
411411
either flag? EXE [
412412
macro+ BIN_SUFFIX %.exe
413413
macro+ LIB_SUFFIX %.dll
414-
macro+ RES {"objs/r3.res"}
414+
macro+ RES {"objs\r3.res"}
415415
macro+ RM "DEL /s /q"
416416
][
417417
macro+ LIB_SUFFIX %.so

0 commit comments

Comments
 (0)