VirtualBox

source: kBuild/trunk/src/kash/Makefile.kmk@ 1205

Last change on this file since 1205 was 1205, checked in by bird, 17 years ago

echo.

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