Annotation of /trunk/mkinitrd-magellan/klibc/usr/dash/Kbuild
Parent Directory | Revision Log
Revision 1122 -
(hide annotations)
(download)
Wed Aug 18 21:11:40 2010 UTC (13 years, 9 months ago) by niro
File size: 2751 byte(s)
Wed Aug 18 21:11:40 2010 UTC (13 years, 9 months ago) by niro
File size: 2751 byte(s)
-updated to klibc-1.5.19
1 | niro | 532 | # |
2 | # Kbuild file for dash | ||
3 | # | ||
4 | |||
5 | config-cppflags := -DBSD=1 -DSMALL -DJOBS=0 -DHAVE_CONFIG_H -DSHELL | ||
6 | config-cppflags += -DGLOB_BROKEN -DIFS_BROKEN | ||
7 | |||
8 | EXTRA_KLIBCCFLAGS := -I$(srctree)/$(src) -I$(objtree)/$(obj) | ||
9 | EXTRA_KLIBCCFLAGS += -include $(srctree)/$(src)/config.h | ||
10 | EXTRA_KLIBCCFLAGS += $(config-cppflags) | ||
11 | |||
12 | HOST_EXTRACFLAGS := $(config-cppflags) | ||
13 | |||
14 | niro | 1122 | init-o-files := alias.o arith_yacc.o arith_yylex.o cd.o error.o eval.o exec.o expand.o \ |
15 | niro | 532 | histedit.o input.o jobs.o mail.o main.o memalloc.o miscbltin.o \ |
16 | mystring.o options.o parser.o redir.o show.o trap.o output.o \ | ||
17 | bltin/printf.o system.o bltin/test.o var.o | ||
18 | |||
19 | niro | 1122 | gen-o-files := builtins.o init.o nodes.o syntax.o |
20 | niro | 532 | |
21 | sh-y := $(init-o-files) $(gen-o-files) | ||
22 | |||
23 | hostprogs-y := mkinit mksyntax mknodes mksignames | ||
24 | niro | 1122 | gen-h-files := builtins.h nodes.h syntax.h token.h |
25 | niro | 532 | |
26 | static-y := sh | ||
27 | |||
28 | # The shared binary | ||
29 | shared-y := sh.shared | ||
30 | sh.shared-y := $(sh-y) | ||
31 | |||
32 | # For cleaning | ||
33 | targets := sh sh.g sh.shared sh.shared.g $(gen-o-files) | ||
34 | |||
35 | # explicit dependency for all generated files | ||
36 | $(addprefix $(obj)/, $(sh-y)): $(addprefix $(obj)/, $(gen-h-files)) | ||
37 | |||
38 | # Generate token.h | ||
39 | targets += token.h | ||
40 | quiet_cmd_mktokens = GEN $@ | ||
41 | cmd_mktokens = sh $< > $@ | ||
42 | $(obj)/token.h: $(src)/mktokens | ||
43 | $(call if_changed,mktokens) | ||
44 | |||
45 | # Generate builtins.def | ||
46 | targets += builtins.def | ||
47 | quiet_cmd_mkbuiltins_def = GEN $@ | ||
48 | cmd_mkbuiltins_def = $(HOSTCC) $(hostc_flags) -x c -E -o $@ $< | ||
49 | $(obj)/builtins.def: $(src)/builtins.def.in $(src)/config.h | ||
50 | $(call if_changed,mkbuiltins_def) | ||
51 | |||
52 | # Generate builtins{.c + .h} | ||
53 | targets += builtins.c builtins.h | ||
54 | quiet_cmd_mkbuiltins = GEN $@ | ||
55 | cmd_mkbuiltins = mkdir -p $(obj)/bltin && cd $(obj) && \ | ||
56 | sh $(srctree)/$(src)/mkbuiltins builtins.def | ||
57 | $(obj)/builtins.c: $(src)/mkbuiltins $(obj)/builtins.def | ||
58 | $(call cmd,mkbuiltins) | ||
59 | |||
60 | # side effect.. | ||
61 | $(obj)/builtins.h: $(obj)/builtins.c | ||
62 | $(Q): | ||
63 | |||
64 | # Generate init.c | ||
65 | targets += init.c | ||
66 | init-c-files := $(addprefix $(srctree)/$(src)/, $(init-o-files:.o=.c)) | ||
67 | quiet_cmd_mkinit = GEN $@ | ||
68 | cmd_mkinit = cd $(obj) && ./mkinit $(init-c-files) | ||
69 | $(obj)/init.c: $(obj)/mkinit $(init-c-files) | ||
70 | $(call cmd,mkinit) | ||
71 | |||
72 | # Generate nodes{.c + .h} | ||
73 | targets += nodes.c nodes.h | ||
74 | quiet_cmd_mknodes = GEN $@ | ||
75 | cmd_mknodes = cd $(obj) && ./mknodes $(srctree)/$(src)/nodetypes \ | ||
76 | $(srctree)/$(src)/nodes.c.pat | ||
77 | $(obj)/nodes.c: $(obj)/mknodes $(src)/nodetypes $(src)/nodes.c.pat | ||
78 | $(call cmd,mknodes) | ||
79 | |||
80 | # side effect.. | ||
81 | $(obj)/nodes.h: $(obj)/nodes.c | ||
82 | $(Q): | ||
83 | |||
84 | # Generate syntax{.c + .h} | ||
85 | targets += syntax.c syntax.h | ||
86 | quiet_cmd_mksyntax = GEN $@ | ||
87 | cmd_mksyntax = cd $(obj) && ./mksyntax | ||
88 | $(obj)/syntax.c: $(obj)/mksyntax | ||
89 | $(call cmd,mksyntax) | ||
90 | |||
91 | # side effect.. | ||
92 | $(obj)/syntax.h: $(obj)/syntax.c | ||
93 | $(Q): | ||
94 | |||
95 | # Targets to install | ||
96 | install-y := sh.shared |