VirtualBox

source: kBuild/trunk/src/ash-messup/Makefile.kmk@ 881

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

hacking...

  • Property svn:eol-style set to native
File size: 3.7 KB
Line 
1# $Id: $
2## @file
3#
4# kBuild Makefile for kmk_ash.
5#
6# Copyright (c) 2005-2007 knut st. osmundsen <[email protected]>
7#
8
9DEPTH = ../..
10include $(PATH_KBUILD)/header.kmk
11
12#INSTALLS = ash.man
13
14PROGRAMS += kmk_ash
15kmk_ash_TEMPLATE = BIN
16kmk_ash_DEFS = lint SHELL SMALL
17kmk_ash_DEFS.linux = BSD
18kmk_ash_DEFS.solaris = BSD
19kmk_ash_DEFS.win = \
20 BSD PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
21kmk_ash_DEFS.os2 = \
22 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME \
23 EXEC_HASH_BANG_SCRIPT PC_OS2_LIBPATHS PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
24kmk_ash_DEFS.darwin = \
25 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
26kmk_ash_DEFS.freebsd = \
27 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
28kmk_ash_INCS = $(PATH_TARGET) . # (the last is because of error.h)
29kmk_ash_CFLAGS.win = -I. ## @todo kBuild bug.
30kmk_ash_INCS.win = win
31kmk_ash_SOURCES = \
32 alias.c \
33 cd.c \
34 error.c \
35 eval.c \
36 exec.c \
37 expand.c \
38 histedit.c \
39 input.c \
40 jobs.c \
41 mail.c \
42 main.c \
43 memalloc.c \
44 miscbltin.c \
45 mystring.c \
46 options.c \
47 output.c \
48 parser.c \
49 redir.c \
50 show.c \
51 syntax.c \
52 trap.c \
53 var.c \
54 bltin/echo.c \
55 bltin/kill.c \
56 bltin/test.c \
57 $(PATH_TARGET)/arith.c \
58 $(PATH_TARGET)/arith_lex.c \
59 $(PATH_TARGET)/builtins.c \
60 $(PATH_TARGET)/init.c \
61 $(PATH_TARGET)/nodes.c
62kmk_ash_SOURCES.linux = \
63 sys_signame.c \
64 strlcpy.c \
65 setmode.c
66kmk_ash_SOURCES.win = \
67 win/mscfakes.c \
68 win/err.c \
69 win/dirent.c \
70 sys_signame.c \
71 strlcpy.c \
72 setmode.c
73kmk_ash_SOURCES.solaris = \
74 sys_signame.c \
75 strlcpy.c \
76 setmode.c
77
78kmk_ash_DEPS = \
79 $(PATH_TARGET)/arith.h \
80 $(PATH_TARGET)/builtins.h \
81 $(PATH_TARGET)/nodes.h \
82 $(PATH_TARGET)/token.h
83kmk_ash_CLEAN = \
84 $(kmk_ash_DEPS) \
85 $(PATH_TARGET)/arith.c \
86 $(PATH_TARGET)/arith_lex.c \
87 $(PATH_TARGET)/builtins.c \
88 $(PATH_TARGET)/init.c \
89 $(PATH_TARGET)/nodes.c
90
91kmk_ash.man_TEMPLATE = usr.bin.man
92kmk_ash.man_SOURCES = \
93 sh.1=>ash.1
94#ash.man_SYMLINKS = \
95# ash.1.gz=>sh.1
96
97
98
99ifeq ($(filter-out nt win win32 win64,$(BUILD_TARGET)),)
100
101#
102# Use the pregenerated code.
103#
104kmk_ash_DEPS :=
105
106define def_copy_generated
107$(PATH_TARGET)/$(src): generated/$(src)
108 $$(RM) -f $$@
109 $$(CP) -f $$^ $$@
110kmk_ash_DEPS += $(PATH_TARGET)/$(src)
111endef
112
113#$(foreach src, arith.h arith.c arith_lex.c builtins.h builtins.c nodes.h nodes.c token.h init.c,\
114#$(eval $(def_copy_generated)))
115
116kmk_ash_INCS += generated
117
118include $(PATH_KBUILD)/footer.kmk
119
120else
121
122include $(PATH_KBUILD)/footer.kmk
123
124#
125# ATTENTION! ATTENTION! ATTENTION!
126#
127# Older ash versions has trouble with some of these scripts, great.
128# Kudos to the NetBSD guys for this clever move. ;)
129#
130# So, when building for the frist time, setting BOOSTRAP_SHELL=/bin/bash is good idea.
131#
132BOOTSTRAP_SHELL ?= $(SHELL)
133YACC ?= yacc
134
135$(PATH_TARGET)/arith.h $(PATH_TARGET)/arith.c: arith.y | $(call DIRDEP,$(PATH_TARGET))
136 $(YACC) -ld $^
137 $(MV) -f y.tab.c $(PATH_TARGET)/arith.c
138 $(MV) -f y.tab.h $(PATH_TARGET)/arith.h
139
140$(PATH_TARGET)/arith_lex.c: arith_lex.l | $(call DIRDEP,$(PATH_TARGET))
141 flex -8 -o$@ $^ # 8-bit lex scanner for arithmetic
142
143$(PATH_TARGET)/builtins.h $(PATH_TARGET)/builtins.c: $(PATH_CURRENT)/mkbuiltins shell.h builtins.def | $(call DIRDEP,$(PATH_TARGET))
144 $(BOOTSTRAP_SHELL) $+ $(dir $@)
145 [ -f $(PATH_TARGET)/builtins.h ]
146
147$(PATH_TARGET)/nodes.h $(PATH_TARGET)/nodes.c: $(PATH_CURRENT)/mknodes.sh nodetypes nodes.c.pat | $(call DIRDEP,$(PATH_TARGET))
148 $(BOOTSTRAP_SHELL) $+ $(dir $@)
149 [ -f $(dir $@)/nodes.h ]
150
151$(PATH_TARGET)/token.h: $(PATH_CURRENT)/mktokens | $(call DIRDEP,$(PATH_TARGET))
152 $(BOOTSTRAP_SHELL) $+
153 $(MV) token.h $@
154
155$(PATH_TARGET)/init.c: $(PATH_CURRENT)/mkinit.sh $(filter-out $(PATH_TARGET)/%,$(kmk_ash_SOURCES)) | $(call DIRDEP,$(PATH_TARGET))
156 $(BOOTSTRAP_SHELL) $+
157 $(MV) init.c $@
158
159endif
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