source: trunk/essentials/app-shells/bash/kNIX-bootstrap.kmk@ 3283

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

configured bootstrap build.

File size: 8.1 KB
Line 
1# $Id: kNIX-bootstrap.kmk 3180 2007-04-22 07:13:02Z bird $
2## @file
3#
4# kNIX Boostrap Makefile for bash
5#
6# Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
7#
8#
9# This file is part of kNIX.
10#
11# kNIX is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# kNIX is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with kNIX; if not, write to the Free Software
23# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24#
25#
26
27DEPTH = ../../..
28include $(PATH_KBUILD)/header.kmk
29
30# version sans patchlevel.
31VER = 3.1
32
33#
34# The bash template.
35#
36TEMPLATE_bash_EXTENDS = usr.bin
37TEMPLATE_bash_DEFS = $(TEMPLATE_usr.bin_DEFS) \
38 LOCALEDIR=\"/@unixroot/usr/share/locale\" \
39 PROGRAM=\"bash.exe\" \
40 CONF_HOSTTYPE=\"i386\" \
41 CONF_OSTYPE=\"os2-emx\" \
42 CONF_MACHTYPE=\"i386-pc-os2-emx\" \
43 CONF_VENDOR=\"pc\" \
44 PACKAGE=\"bash\" \
45 SHELL \
46 HAVE_CONFIG_H
47TEMPLATE_bash_INCS = $(TEMPLATE_usr.bin_INCS) \
48 $(PATH_TARGET) \
49 $(PATH_SUB_CURRENT) \
50 $(PATH_SUB_ROOT)/include \
51 $(PATH_SUB_ROOT)/lib
52TEMPLATE_bash_ORDERDEPS = $(TEMPLATE_usr.bin_ORDERDEPS) \
53 $(PATH_TARGET)/config.h \
54 $(PATH_TARGET)/version.h \
55 $(PATH_TARGET)/pathnames.h
56
57#
58# bash
59#
60PROGRAMS += bash
61bash_TEMPLATE = bash
62bash_ORDERDEPS = $(PATH_TARGET)/builtins/builtext.h
63bash_INCS = $(PATH_SUB_ROOT)/builtins $(PATH_TARGET)/builtins
64BUILTINS = \
65 alias.def \
66 bind.def \
67 break.def \
68 builtin.def \
69 caller.def \
70 cd.def \
71 colon.def \
72 command.def \
73 declare.def \
74 echo.def \
75 enable.def \
76 eval.def \
77 exec.def \
78 exit.def \
79 fc.def \
80 fg_bg.def \
81 hash.def \
82 help.def \
83 history.def \
84 jobs.def \
85 kill.def \
86 let.def \
87 pushd.def \
88 read.def \
89 return.def \
90 set.def \
91 setattr.def \
92 shift.def \
93 source.def \
94 suspend.def \
95 test.def \
96 times.def \
97 trap.def \
98 type.def \
99 ulimit.def \
100 umask.def \
101 wait.def \
102 getopts.def \
103 shopt.def \
104 printf.def \
105 complete.def
106bash_SOURCES = \
107 shell.c \
108 eval.c \
109 y.tab.c \
110 general.c \
111 make_cmd.c \
112 print_cmd.c \
113 dispose_cmd.c \
114 execute_cmd.c \
115 variables.c \
116 copy_cmd.c \
117 error.c \
118 expr.c \
119 flags.c \
120 jobs.c \
121 subst.c \
122 hashcmd.c \
123 hashlib.c \
124 mailcheck.c \
125 trap.c \
126 input.c \
127 unwind_prot.c \
128 pathexp.c \
129 sig.c \
130 test.c \
131 version.c \
132 alias.c \
133 array.c \
134 arrayfunc.c \
135 braces.c \
136 bracecomp.c \
137 bashhist.c \
138 bashline.c \
139 list.c \
140 stringlib.c \
141 locale.c \
142 findcmd.c \
143 redir.c \
144 pcomplete.c \
145 pcomplib.c \
146 xmalloc.c \
147 $(PATH_TARGET)/syntax.c \
148 \
149 $(PATH_TARGET)/builtins/builtins.c \
150 builtins/common.c \
151 builtins/evalfile.c \
152 builtins/evalstring.c \
153 builtins/getopt.c \
154 builtins/bashgetopt.c \
155 $(addprefix $(PATH_TARGET)/builtins/, $(BUILTINS:.def=.c)) \
156 \
157 lib/glob/glob.c \
158 lib/glob/strmatch.c \
159 lib/glob/smatch.c \
160 lib/glob/xmbsrtowcs.c \
161 \
162 lib/tilde/tilde.c
163
164trap.c_DEPS = $(PATH_TARGET)/signames.h
165$(PATH_TARGET)/builtins/ulimit.c_DEPS = $(PATH_TARGET)/pipesize.h
166
167bash_LIBS = \
168 $(TARGET_libsh) \
169 $(TARGET_libreadline) \
170 $(TARGET_libhistory) \
171 ncurses
172
173
174# generate syntax.c.
175$(PATH_TARGET)/syntax.c: $(TARGET_mksyntax)
176 $(TARGET_mksyntax) -o $@
177
178# generate signames.h for trap.c
179$(PATH_TARGET)/signames.h: $(TARGET_mksignames)
180 $(TARGET_mksignames) $@
181
182# generate pipesize.h for ulimit.def
183$(PATH_TARGET)/pipesize.h:
184 $(RM) -f $@
185 $(APPEND) $@ '#define PIPESIZE 8192'
186
187# generate builtext.h and builtins.c from the builtins/*.def files.
188$(PATH_TARGET)/builtins/builtext.h $(PATH_TARGET)/builtins/builtins.c: \
189 $(addprefix $(PATH_SUB_ROOT)/builtins/, $(BUILTINS)) \
190 $(TARGET_mkbuiltins)
191 $(MKDIR) -p $(PATH_TARGET)/builtins
192 $(TARGET_mkbuiltins) \
193 -externfile $(PATH_TARGET)/builtins/builtext.h \
194 -structfile $(PATH_TARGET)/builtins/builtins.c \
195 -noproduction \
196 -D $(PATH_SUB_ROOT)/builtins \
197 $(addprefix $(PATH_SUB_ROOT)/builtins/, $(BUILTINS))
198
199# generate C source files from the builtins/*.def files.
200define def_mkbuiltin
201$(PATH_TARGET)/builtins/$(name:.def=.c): $(PATH_SUB_ROOT)/builtins/$(name) $$(TARGET_mkbuiltins)
202 $(MKDIR) -p $(PATH_TARGET)/builtins
203 cd $$(@D) && $$(TARGET_mkbuiltins) -D $(PATH_SUB_ROOT)/builtins $$<
204endef
205$(foreach name,$(BUILTINS),$(eval $(def_mkbuiltin)))
206
207
208#
209# mkbuiltins.
210#
211BLDPROGS += mkbuiltins
212mkbuiltins_TEMPLATE = bash
213mkbuiltins_INCS = \
214 $(PATH_SUB_ROOT)/builtins
215mkbuiltins_SOURCES = \
216 builtins/mkbuiltins.c
217
218#
219# mksignames
220#
221BLDPROGS += mksignames
222mksignames_TEMPLATE = bash
223mksignames_SOURCES = \
224 support/mksignames.c
225
226#
227# basheversion
228#
229BLDPROGS += bashversion
230bashversion_TEMPLATE = bash
231bashversion_DEFS += BUILDTOOL
232bashversion_SOURCES = \
233 support/bashversion.c \
234 version.c
235
236#
237# mksyntax
238#
239BLDPROGS += mksyntax
240mksyntax_TEMPLATE = bash
241mksyntax_SOURCES = \
242 mksyntax.c
243
244
245#
246# libsh
247#
248LIBRARIES += libsh
249libsh_TEMPLATE = bash
250libsh_NOINST = yes
251libsh_DEFS = SHELL
252libsh_INCS = \
253 $(PATH_SUB_ROOT)/lib/sh
254libsh_SOURCES = \
255 lib/sh/clktck.c \
256 lib/sh/clock.c \
257 lib/sh/getenv.c \
258 lib/sh/oslib.c \
259 lib/sh/setlinebuf.c \
260 lib/sh/strnlen.c \
261 lib/sh/itos.c \
262 lib/sh/zread.c \
263 lib/sh/zwrite.c \
264 lib/sh/shtty.c \
265 lib/sh/shmatch.c \
266 lib/sh/netconn.c \
267 lib/sh/netopen.c \
268 lib/sh/timeval.c \
269 lib/sh/makepath.c \
270 lib/sh/pathcanon.c \
271 lib/sh/pathphys.c \
272 lib/sh/tmpfile.c \
273 lib/sh/stringlist.c \
274 lib/sh/stringvec.c \
275 lib/sh/spell.c \
276 lib/sh/shquote.c \
277 lib/sh/strtrans.c \
278 lib/sh/strindex.c \
279 lib/sh/snprintf.c \
280 lib/sh/mailstat.c \
281 lib/sh/fmtulong.c \
282 lib/sh/fmtullong.c \
283 lib/sh/fmtumax.c \
284 lib/sh/xstrchr.c \
285 lib/sh/zcatfd.c \
286 lib/sh/winsize.c
287
288
289#
290# libreadline
291#
292LIBRARIES += libreadline
293libreadline_TEMPLATE = bash
294libreadline_NOINST = yes
295libreadline_SOURCES = \
296 lib/readline/readline.c \
297 lib/readline/vi_mode.c \
298 lib/readline/funmap.c \
299 lib/readline/keymaps.c \
300 lib/readline/parens.c \
301 lib/readline/search.c \
302 lib/readline/rltty.c \
303 lib/readline/complete.c \
304 lib/readline/bind.c \
305 lib/readline/isearch.c \
306 lib/readline/display.c \
307 lib/readline/signals.c \
308 lib/readline/util.c \
309 lib/readline/kill.c \
310 lib/readline/undo.c \
311 lib/readline/macro.c \
312 lib/readline/input.c \
313 lib/readline/callback.c \
314 lib/readline/terminal.c \
315 lib/readline/text.c \
316 lib/readline/nls.c \
317 lib/readline/misc.c \
318 lib/readline/compat.c \
319 lib/readline/tilde.c \
320 lib/readline/xmalloc.c
321
322lib/readline/tilde.c_DEFS = READLINE_LIBRARY
323
324#
325# libhistory
326#
327LIBRARIES += libhistory
328libhistory_TEMPLATE = bash
329libhistory_NOINST = yes
330libhistory_SOURCES = \
331 lib/readline/history.c \
332 lib/readline/histexpand.c \
333 lib/readline/histfile.c \
334 lib/readline/histsearch.c \
335 lib/readline/shell.c \
336 lib/readline/savestring.c \
337 lib/readline/mbutil.c \
338 lib/readline/xmalloc.c
339
340#
341# Install docs
342#
343INSTALLS += bashman
344bashman_TEMPLATE = usr.bin.man
345bashman_SOURCES = \
346 doc/bash.1 \
347 doc/bashbug.1
348
349#INSTALLS += bashinfo - later
350bashinfo_TEMPLATE = usr.bin.info
351bashinfo_SOURCES = \
352 $(PATH_TARGET)/bash.info
353
354$(PATH_TARGET)/bash.info: | $(call DIRDEP,$(PATH_TARGET))
355 $(PATH_SUB_ROOT)/doc/infopost.sh < $(PATH_SUB_ROOT)/doc/bashref.info > $@
356
357
358#
359# config.h, fnmatch.h and version.h (force shell for on the latter).
360#
361$(PATH_TARGET)/config.h: kNIX-bootstrap-$(BUILD_TARGET).$(BUILD_TARGET_ARCH)-config.h
362 $(INSTALL) $< $@
363
364$(PATH_TARGET)/pathnames.h: kNIX-bootstrap-$(BUILD_TARGET).$(BUILD_TARGET_ARCH)-pathnames.h
365 $(INSTALL) $< $@
366
367$(PATH_TARGET)/version.h:
368 $(PATH_SUB_ROOT)/support/mkversion.sh -b -S $(PATH_SUB_ROOT) -s release -d $(VER) -o $(PATH_TARGET)/newversion.h && \
369 $(MV_EXT) -f $(PATH_TARGET)/newversion.h $(PATH_TARGET)/version.h
370
371
372include $(PATH_KBUILD)/footer.kmk
373
Note: See TracBrowser for help on using the repository browser.