VirtualBox

source: kBuild/trunk/src/gmake/Makefile.kmk@ 530

Last change on this file since 530 was 530, checked in by bird, 18 years ago

Added kBuild specific functions for speeding up source processing.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.2 KB
Line 
1# $Id: Makefile.kmk 530 2006-09-17 20:38:57Z bird $
2
3
4#
5# kmk
6#
7PROGRAMS += kmk
8
9kmk_TEMPLATE = BIN
10kmk_DEPS = $(PATH_TARGET)/config.h
11kmk_INCS = $(PATH_TARGET) .
12#kmk_INCS.win32 = kmkbuiltin/w32
13
14kmk_DEFS = \
15 HAVE_CONFIG_H \
16 NO_ARCHIVES \
17 CONFIG_NO_DEFAULT_SUFFIXES \
18 CONFIG_NO_DEFAULT_PATTERN_RULES \
19 CONFIG_NO_DEFAULT_TERMINAL_RULES \
20 CONFIG_NO_DEFAULT_SUFFIX_RULES \
21 CONFIG_NO_DEFAULT_VARIABLES \
22 CONFIG_WITH_EXTENDED_NOTPARALLEL \
23 CONFIG_WITH_INCLUDEDEP \
24 CONFIG_WITH_TOUPPER_TOLOWER \
25 CONFIG_WITH_VALUE_LENGTH \
26 CONFIG_WITH_COMPARE \
27 KMK \
28 CONFIG_WITH_OPTIMIZATION_HACKS \
29 VARIABLE_HASH
30
31kmk_SOURCES = \
32 main.c \
33 read.c \
34 hash.c \
35 strcache.c \
36 variable.c \
37 ar.c \
38 arscan.c \
39 commands.c \
40 default.c \
41 dir.c \
42 expand.c \
43 file.c \
44 function.c \
45 implicit.c \
46 job.c \
47 misc.c \
48 remake.c \
49 rule.c \
50 signame.c \
51 version.c \
52 vpath.c \
53 remote-stub.c \
54 kbuild.c
55
56kmk_SOURCES.win32 = \
57 getopt.c \
58 getopt1.c \
59 getloadavg.c \
60 w32/subproc/misc.c \
61 w32/subproc/sub_proc.c \
62 w32/subproc/w32err.c \
63 glob/glob.c \
64 glob/fnmatch.c \
65 w32/compat/dirent.c \
66 w32/pathstuff.c
67
68kmk_SOURCES.freebsd = \
69 glob/glob.c \
70 glob/fnmatch.c
71
72#
73# kmkbuiltin commands
74#
75kmk_DEFS += CONFIG_WITH_KMK_BUILTIN
76kmk_SOURCES += \
77 kmkbuiltin.c \
78 kmkbuiltin/append.c \
79 kmkbuiltin/cp.c \
80 kmkbuiltin/cp_utils.c \
81 kmkbuiltin/echo.c \
82 kmkbuiltin/install.c \
83 kmkbuiltin/mkdir.c \
84 kmkbuiltin/ln.c \
85 kmkbuiltin/rm.c \
86 \
87 kmkbuiltin/err.c \
88 kmkbuiltin/setmode.c \
89 kmkbuiltin/strmode.c \
90 kmkbuiltin/strlcpy.c
91
92kmk_SOURCES.win32 += \
93 kmkbuiltin/mscfakes.c \
94 kmkbuiltin/fts.c
95
96
97#
98# Standalone kmkbuiltin commands.
99#
100PROGRAMS += kmk_append kmk_cp kmk_echo kmk_mkdir kmk_install kmk_ln kmk_rm
101
102kmk_append_TEMPLATE = BIN
103kmk_append_DEFS = kmk_builtin_append=main
104kmk_append_INCS = .
105kmk_append_SOURCES = \
106 kmkbuiltin/append.c \
107 kmkbuiltin/err.c
108
109kmk_cp_TEMPLATE = BIN
110kmk_cp_DEFS = kmk_builtin_cp=main
111kmk_cp_SOURCES = \
112 kmkbuiltin/cp.c \
113 kmkbuiltin/cp_utils.c \
114 kmkbuiltin/strlcpy.c \
115 kmkbuiltin/err.c
116kmk_cp_INCS.win32 = $(PATH_TARGET) .
117kmk_cp_DEFS.win32 = HAVE_CONFIG_H
118kmk_cp_SOURCES.win32 = \
119 kmkbuiltin/mscfakes.c \
120 kmkbuiltin/fts.c \
121 w32/compat/dirent.c \
122 getopt.c \
123 getopt1.c
124
125kmk_echo_TEMPLATE = BIN
126kmk_echo_DEFS = kmk_builtin_echo=main
127kmk_echo_SOURCES = \
128 kmkbuiltin/echo.c
129kmk_echo_SOURCES.win32 = \
130 kmkbuiltin/mscfakes.c \
131 kmkbuiltin/err.c
132
133kmk_install_TEMPLATE = BIN
134kmk_install_DEFS = kmk_builtin_install=main
135kmk_install_SOURCES = \
136 kmkbuiltin/install.c \
137 kmkbuiltin/err.c \
138 kmkbuiltin/strmode.c \
139 kmkbuiltin/setmode.c
140kmk_install_INCS.win32 = $(PATH_TARGET) .
141kmk_install_DEFS.win32 = HAVE_CONFIG_H
142kmk_install_SOURCES.win32 = \
143 kmkbuiltin/mscfakes.c \
144 getopt.c \
145 getopt1.c
146
147kmk_ln_TEMPLATE = BIN
148kmk_ln_DEFS = kmk_builtin_ln=main
149kmk_ln_SOURCES = \
150 kmkbuiltin/ln.c \
151 kmkbuiltin/err.c
152kmk_ln_INCS.win32 = $(PATH_TARGET) .
153kmk_ln_DEFS.win32 = HAVE_CONFIG_H
154kmk_ln_SOURCES.win32 = \
155 kmkbuiltin/mscfakes.c\
156 getopt.c \
157 getopt1.c
158
159kmk_mkdir_TEMPLATE = BIN
160kmk_mkdir_DEFS = kmk_builtin_mkdir=main
161kmk_mkdir_SOURCES = \
162 kmkbuiltin/mkdir.c \
163 kmkbuiltin/err.c \
164 kmkbuiltin/setmode.c
165kmk_mkdir_INCS.win32 = $(PATH_TARGET) .
166kmk_mkdir_DEFS.win32 = HAVE_CONFIG_H
167kmk_mkdir_SOURCES.win32 = \
168 kmkbuiltin/mscfakes.c \
169 getopt.c \
170 getopt1.c
171
172kmk_rm_TEMPLATE = BIN
173kmk_rm_DEFS = kmk_builtin_rm=main
174kmk_rm_SOURCES = \
175 kmkbuiltin/rm.c \
176 kmkbuiltin/err.c \
177 kmkbuiltin/strmode.c
178kmk_rm_INCS.win32 = $(PATH_TARGET) .
179kmk_rm_DEFS.win32 = HAVE_CONFIG_H
180kmk_rm_SOURCES.win32 = \
181 kmkbuiltin/mscfakes.c\
182 getopt.c \
183 getopt1.c
184
185
186#
187# kmk_gmake - almost plain GNU Make.
188#
189PROGRAMS += kmk_gmake
190kmk_gmake_TEMPLATE = BIN
191kmk_gmake_DEPS = $(PATH_TARGET)/config.h
192kmk_gmake_INCS = $(PATH_TARGET) .
193
194kmk_gmake_DEFS = \
195 HAVE_CONFIG_H \
196 NO_ARCHIVES \
197 CONFIG_WITH_TOUPPER_TOLOWER
198
199kmk_gmake_SOURCES = \
200 main.c \
201 read.c \
202 hash.c \
203 strcache.c \
204 variable.c \
205 ar.c \
206 arscan.c \
207 commands.c \
208 default.c \
209 dir.c \
210 expand.c \
211 file.c \
212 function.c \
213 implicit.c \
214 job.c \
215 misc.c \
216 remake.c \
217 rule.c \
218 signame.c \
219 version.c \
220 vpath.c \
221 remote-stub.c
222
223kmk_gmake_SOURCES.win32 = \
224 getopt.c \
225 getopt1.c \
226 getloadavg.c \
227 w32/subproc/misc.c \
228 w32/subproc/sub_proc.c \
229 w32/subproc/w32err.c \
230 glob/glob.c \
231 glob/fnmatch.c \
232 w32/compat/dirent.c \
233 w32/pathstuff.c
234
235kmk_gmake_SOURCES.freebsd = \
236 glob/glob.c \
237 glob/fnmatch.c
238
239
240
241DEPTH = ../..
242include $(PATH_KBUILD)/rules.kmk
243
244
245#
246# Use checked in config.h instead of running ./Configure for it.
247#
248config.h.$(BUILD_TARGET) := config.h.$(BUILD_TARGET)
249config.h.win := config.h.W32
250config.h.win32 := config.h.W32
251config.h.win64 := config.h.W32
252config.h.nt := config.h.W32
253
254$(PATH_TARGET)/config.h: $(config.h.$(BUILD_TARGET))
255 $(MKDIR) -p $(dir $@)
256 $(CP) $^ $@
257
258
259#
260# Some tests.
261#
262parallel: parallel_1 parallel_2 parallel_3 parallel_4 parallel_5
263parallel_1 parallel_2 parallel_3 parallel_4 parallel_5:
264 echo $@_start ; sleep 1; echo $@_done
265
266test:
267 echo "1"
268 echo "2"
269 echo "3"
270 echo "4"
271
272# shell double and single quoting check.
273test_shell_quoting:
274 $(ECHO_EXT) "double quoted sTrInG" | $(SED_EXT) -e "s/sTrInG/string/g"
275 $(ECHO_EXT) 'single quoted sTrInG' | $(SED_EXT) -e 's/sTrInG/string/g'
276 $(ECHO) "This string should not be printed with double quotes."
277 $(ECHO) 'This string should not be printed with single quotes.'
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette