1
- # REBOL Makefile -- Generated by make-make.r (do not edit) on 18 -Oct-2017/17:55:17 +2:00
1
+ # REBOL Makefile -- Generated by make-make.r (do not edit) on 19 -Oct-2017/17:44:15 +2:00
2
2
# This makefile is intentional kept simple to make builds possible on
3
3
# a wider range of target platforms.
4
4
@@ -24,6 +24,8 @@ STRIP= $(TOOLS)strip
24
24
CP = cp
25
25
# LS allows different ls progs:
26
26
LS = dir
27
+ # RM allows different RM progs:
28
+ RM = DEL /s /q
27
29
# UP - some systems do not use ../
28
30
UP = ..
29
31
# CD - some systems do not use ./
@@ -40,6 +42,8 @@ I= -I$(INCL) -I$S/include/
40
42
TO_OS? = TO_WIN32
41
43
OS_ID? = 0.3.1
42
44
BIN_SUFFIX = .exe
45
+ LIB_SUFFIX = .dll
46
+ RES = objs\r3.res
43
47
RAPI_FLAGS = -O2 -DUNICODE
44
48
HOST_FLAGS = -DREB_EXE -O2 -DUNICODE -D_FILE_OFFSET_BITS=64
45
49
RLIB_FLAGS =
@@ -50,7 +54,7 @@ HFLAGS= -c -D$(TO_OS) -DREB_CORE $(HOST_FLAGS) $I
50
54
CLIB = -lwsock32 -lcomdlg32 -mconsole -Wl,--stack=4194300 -lm
51
55
52
56
# REBOL is needed to build various include files:
53
- REBOL_TOOL = r3-make
57
+ REBOL_TOOL = r3-make$( BIN_SUFFIX )
54
58
REBOL = $(CD )$(REBOL_TOOL ) -qs
55
59
56
60
# For running tests, ship, build, etc.
@@ -67,14 +71,15 @@ make:
67
71
$(REBOL ) $T /make-make.r $(OS_ID )
68
72
69
73
clean :
70
- @-rm -rf libr3.so objs/
74
+ $( RM ) libr3$( LIB_SUFFIX ) objs $( RES )
71
75
72
76
all :
73
77
$(MAKE ) clean
74
78
$(MAKE ) prep
75
79
$(MAKE ) r3$(BIN_SUFFIX )
76
80
$(MAKE ) lib
77
81
$(MAKE ) host$(BIN_SUFFIX )
82
+ $(MAKE ) testdo
78
83
79
84
prep :
80
85
$(REBOL ) $T /make-headers.r
83
88
$(REBOL ) $T /make-os-ext.r # ok, but not always
84
89
$(REBOL ) $T /make-host-ext.r
85
90
$(REBOL ) $T /make-reb-lib.r
86
- windres r3.rc -O coff -o objs/r3.res
87
91
88
92
# ## Provide more info if make fails due to no local Rebol build tool:
89
93
tmps : $S/include/tmp-bootdefs.h
@@ -101,12 +105,16 @@ $(REBOL_TOOL):
101
105
false
102
106
103
107
# ## Post build actions
108
+
104
109
purge :
105
- -rm libr3.*
106
- -rm host$(BIN_SUFFIX )
110
+ $( RM ) libr3.*
111
+ $( RM ) host$(BIN_SUFFIX )
107
112
$(MAKE ) lib
108
113
$(MAKE ) host$(BIN_SUFFIX )
109
114
115
+ testdo :
116
+ r3$(BIN_SUFFIX ) --do " print {^/^[[32mI'm READY^[[0m}"
117
+
110
118
test :
111
119
$(CP ) r3$(BIN_SUFFIX ) $(UP ) /src/tests/
112
120
$(R3 ) $S /tests/test.r
@@ -117,11 +125,11 @@ install:
117
125
ship :
118
126
$(R3 ) $S /tools/upload.r
119
127
120
- build : libr3.so
128
+ build : libr3$( LIB_SUFFIX )
121
129
$(R3 ) $S /tools/make-build.r
122
130
123
131
cln :
124
- rm libr3.* r3.o
132
+ $( RM ) libr3.* r3.o
125
133
126
134
check :
127
135
$(STRIP ) -s -o r3.s r3$(BIN_SUFFIX )
@@ -151,40 +159,44 @@ OBJS = objs/a-constants.o objs/a-globals.o objs/a-lib.o objs/b-boot.o \
151
159
objs/t-tuple.o objs/t-typeset.o objs/t-utype.o objs/t-vector.o \
152
160
objs/t-word.o objs/u-bmp.o objs/u-compress.o objs/u-dialect.o \
153
161
objs/u-gif.o objs/u-jpg.o objs/u-md5.o objs/u-parse.o \
154
- objs/u-png.o objs/u-sha1.o objs/u-zlib.o objs/r3.res
162
+ objs/u-png.o objs/u-sha1.o objs/u-zlib.o
155
163
156
164
HOST = objs/host-main.o objs/host-args.o objs/host-device.o objs/host-stdio.o \
157
165
objs/dev-net.o objs/dev-dns.o objs/host-lib.o objs/dev-stdio.o \
158
166
objs/dev-file.o objs/dev-event.o objs/dev-clipboard.o
159
167
160
168
169
+ # Compile resources:
170
+ $(RES ) :
171
+ windres r3.rc -O coff -o $(RES )
172
+
161
173
# Directly linked r3 executable:
162
- r3$(BIN_SUFFIX ) : tmps objs $(OBJS ) $(HOST )
163
- $(CC ) -o r3$(BIN_SUFFIX ) $(OBJS ) $(HOST ) $(CLIB )
174
+ r3$(BIN_SUFFIX ) : tmps objs $(OBJS ) $(RES ) $( HOST )
175
+ $(CC ) -o r3$(BIN_SUFFIX ) $(OBJS ) $(RES ) $( HOST ) $(CLIB )
164
176
$(STRIP ) r3$(BIN_SUFFIX )
165
177
-$(NM ) -a r3$(BIN_SUFFIX )
166
178
$(LS ) r3$(BIN_SUFFIX )
167
179
168
180
objs :
169
181
mkdir -p objs
170
182
171
- lib : libr3.so
183
+ lib : libr3$( LIB_SUFFIX )
172
184
173
185
# PUBLIC: Shared library:
174
- # NOTE: Did not use "-Wl,-soname,libr3.so " because won't find .so in local dir.
175
- libr3.so : $(OBJS )
176
- $(CC ) -o libr3.so -shared $(OBJS ) $(CLIB )
177
- $(STRIP ) libr3.so
178
- -$(NM ) -D libr3.so
179
- -$(NM ) -a libr3.so | grep " Do_"
180
- $(LS ) libr3.so
186
+ # NOTE: Did not use "-Wl,-soname,libr3$(LIB_SUFFIX) " because won't find $(LIB_SUFFIX) in local dir.
187
+ libr3$( LIB_SUFFIX ) : $(OBJS )
188
+ $(CC ) -o libr3$( LIB_SUFFIX ) -shared $(OBJS ) $(CLIB )
189
+ $(STRIP ) libr3$( LIB_SUFFIX )
190
+ -$(NM ) -D libr3$( LIB_SUFFIX )
191
+ -$(NM ) -a libr3$( LIB_SUFFIX ) | grep " Do_"
192
+ $(LS ) libr3$( LIB_SUFFIX )
181
193
182
194
# PUBLIC: Host using the shared lib:
183
- host$(BIN_SUFFIX ) : $(HOST )
184
- $(CC ) -o host$(BIN_SUFFIX ) $(HOST ) libr3.so $(CLIB )
195
+ host$(BIN_SUFFIX ) : $(HOST ) $( RES )
196
+ $(CC ) -o host$(BIN_SUFFIX ) $(HOST ) $( RES ) libr3$( LIB_SUFFIX ) $(CLIB )
185
197
$(STRIP ) host$(BIN_SUFFIX )
186
198
$(LS ) host$(BIN_SUFFIX )
187
- echo " export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH "
199
+ @ echo " export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH "
188
200
189
201
# ## File build targets:
190
202
b-boot.c : $(SRC ) /boot/boot.r
0 commit comments