Magellan Linux

Annotation of /trunk/mkinitrd-magellan/klibc/usr/dash/Kbuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (hide annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File size: 3072 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

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     init-o-files := alias.o arith_yylex.o cd.o error.o eval.o exec.o expand.o \
15     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     gen-o-files := arith.o builtins.o init.o nodes.o syntax.o
20    
21     sh-y := $(init-o-files) $(gen-o-files)
22    
23     hostprogs-y := mkinit mksyntax mknodes mksignames
24     gen-h-files := arith.h builtins.h nodes.h syntax.h token.h
25    
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     # Generate arith parser - arith{.c + .h}
96     targets += arith.c arith.h
97     # Prefer bison, but BSD yacc should work as well
98     YACC ?= bison
99    
100     quiet_cmd_yacc = YACC $@
101     cmd_yacc = $(YACC) -d -o $(@:.h=.c) $<
102    
103     $(obj)/arith.h: $(src)/arith.y
104     $(call if_changed,yacc)
105    
106     # side effect..
107     $(obj)/arith.c: $(obj)/arith.h
108     $(Q):
109    
110     # Targets to install
111     install-y := sh.shared