VirtualBox

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

最後變更 在這個檔案從3066是 3062,由 bird 提交於 7 年 前

netbsd patches from Uwe. Messing around on arm (arm -> arm32, adding arm64); Adding GNU/kFreeBSD and GNU/kNetBSD to the OS list. Added SuperH to archs. Recognize ppc64le as ppc64 in env.sh. Misc.

  • 屬性 svn:eol-style 設為 LF
  • 屬性 svn:keywords 設為 Id
檔案大小: 5.2 KB
 
1# $Id: Makefile.kmk 3062 2017-09-30 11:26:21Z bird $
2## @file
3# Sub-makefile for kash.
4#
5
6#
7# Copyright (c) 2005-2010 knut st. osmundsen <[email protected]>
8#
9# This file is part of kBuild.
10#
11# kBuild 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 3 of the License, or
14# (at your option) any later version.
15#
16# kBuild 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 kBuild. If not, see <http://www.gnu.org/licenses/>
23#
24#
25
26SUB_DEPTH = ../..
27include $(KBUILD_PATH)/subheader.kmk
28
29#
30# The program.
31#
32PROGRAMS += kash
33kash_TEMPLATE = BIN-THREADED
34kash_NAME = kmk_ash
35kash_ASTOOL = YASM
36kash_DEFS = lint SHELL SMALL
37kash_DEFS += SH_FORKED_MODE
38kash_DEFS.debug = DEBUG=2
39kash_DEFS.haiku = BSD
40kash_DEFS.linux = BSD
41kash_DEFS.solaris = BSD
42## @todo bring over PC_SLASHES?
43kash_DEFS.win = \
44 BSD YY_NO_UNISTD_H \
45 SH_DEAL_WITH_CRLF PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS EXEC_HASH_BANG_SCRIPT
46kash_DEFS.os2 = \
47 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME PC_OS2_LIBPATHS \
48 SH_DEAL_WITH_CRLF PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS EXEC_HASH_BANG_SCRIPT
49kash_DEFS.darwin = \
50 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
51kash_DEFS.dragonfly = \
52 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
53kash_DEFS.freebsd = \
54 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
55kash_DEFS.gnukfbsd = HAVE_SYSCTL_H
56kash_DEFS.netbsd = \
57 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
58kash_DEFS.openbsd = \
59 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
60kash_INCS = $(kash_0_OUTDIR) . # (the last is because of error.h)
61kash_ASFLAGS.win = -g cv8
62kash_ASFLAGS.win.x86 = -f win32
63kash_ASFLAGS.win.amd64 = -f win64
64if "$(USER)" == "bird" && "$(KBUILD_TARGET)" != "win"
65kash_CFLAGS += -std=gnu99
66endif
67kash_CFLAGS.win.amd64 = -GS-
68kash_LDFLAGS.win = -DYNAMICBASE:NO
69kash_SOURCES = \
70 main.c \
71 alias.c \
72 cd.c \
73 error.c \
74 eval.c \
75 exec.c \
76 expand.c \
77 histedit.c \
78 input.c \
79 jobs.c \
80 mail.c \
81 memalloc.c \
82 mystring.c \
83 options.c \
84 output.c \
85 parser.c \
86 redir.c \
87 show.c \
88 syntax.c \
89 trap.c \
90 var.c \
91 miscbltin.c \
92 bltin/echo.c \
93 bltin/kill.c \
94 bltin/test.c \
95 \
96 $(kash_0_OUTDIR)/builtins.c \
97 $(kash_0_OUTDIR)/init.c \
98 $(kash_0_OUTDIR)/nodes.c \
99 \
100 setmode.c \
101 shinstance.c \
102 shheap.c \
103 shthread.c \
104 shfile.c
105kash_SOURCES.gnukfbsd = \
106 sys_signame.c \
107 strlcpy.c
108kash_SOURCES.gnuknbsd = \
109 sys_signame.c \
110 strlcpy.c
111kash_SOURCES.haiku = \
112 sys_signame.c \
113 strlcpy.c
114kash_SOURCES.linux = \
115 sys_signame.c \
116 strlcpy.c
117kash_SOURCES.solaris = \
118 sys_signame.c \
119 strlcpy.c
120kash_SOURCES.win = \
121 sys_signame.c \
122 strlcpy.c \
123 shfork-win.c \
124 shforkA-win.asm
125
126kash_INTERMEDIATES = \
127 $(kash_0_OUTDIR)/builtins.h \
128 $(kash_0_OUTDIR)/nodes.h \
129 $(kash_0_OUTDIR)/token.h
130kash_CLEAN = \
131 $(kash_INTERMEDIATES) \
132 $(kash_0_OUTDIR)/builtins.c \
133 $(kash_0_OUTDIR)/init.c \
134 $(kash_0_OUTDIR)/nodes.c
135
136kash_main.c_DEFS = KBUILD_SVN_REV=$(KBUILD_SVN_REV)
137
138##
139## The manual page.
140##
141#INSTALLS += kash.man
142#kash.man_TEMPLATE = usr.bin.man
143#kash.man_SOURCES = sh.1=>kash.1
144
145
146if1of ($(KBUILD_TARGET), win os2)
147
148#
149# Use the pregenerated code.
150#
151kash_SOURCES += \
152 $(kash_0_OUTDIR)/arith.c \
153 $(kash_0_OUTDIR)/arith_lex.c
154kash_INTERMEDIATES += \
155 $(kash_0_OUTDIR)/arith.h
156
157define def_copy_generated
158$$$$(kash_0_OUTDIR)/$(src): $(PATH_SUB_CURRENT)/generated/$(src)
159 $$(RM) -f $$@
160 $$(CP) -f $$^ $$@
161endef
162
163$(foreach src, arith.h arith.c arith_lex.c builtins.h builtins.c nodes.h nodes.c token.h init.c,\
164$(eval $(def_copy_generated)))
165
166else
167
168#
169# Generate the code on the fly.
170#
171
172USES += lex yacc
173kash_USES = lex yacc
174kash_LEXTOOL = FLEX
175kash_LEXFLAGS = -8
176#kash_YACCTOOL = BISON
177kash_YACCTOOL = YACC
178kash_YACCFLAGS = -ld
179kash_SOURCES += \
180 arith.y \
181 arith_lex.l
182
183#
184# ATTENTION! ATTENTION! ATTENTION!
185#
186# Older ash versions has trouble with some of these scripts, great.
187# Kudos to the NetBSD guys for this clever move. ;)
188#
189# So, when building for the frist time, setting BOOSTRAP_SHELL=/bin/bash is good idea.
190#
191BOOTSTRAP_SHELL ?= $(SHELL)
192
193$$(kash_0_OUTDIR)/builtins.h + $$(kash_0_OUTDIR)/builtins.c: \
194 $$(kash_DEFPATH)/mkbuiltins \
195 $$(kash_DEFPATH)/shell.h \
196 $$(kash_DEFPATH)/builtins.def \
197 | $$(dir $$@)
198 $(BOOTSTRAP_SHELL) $+ $(dir $@)
199 [ -f $(kash_0_OUTDIR)/builtins.h ]
200
201$$(kash_0_OUTDIR)/nodes.h + $$(kash_0_OUTDIR)/nodes.c: \
202 $$(kash_DEFPATH)/mknodes.sh \
203 $$(kash_DEFPATH)/nodetypes \
204 $$(kash_DEFPATH)/nodes.c.pat \
205 | $$(dir $$@)
206 $(BOOTSTRAP_SHELL) $+ $(dir $@)
207 [ -f $(dir $@)/nodes.h ]
208
209$$(kash_0_OUTDIR)/token.h: $$(kash_DEFPATH)/mktokens | $$(dir $$@)
210 $(BOOTSTRAP_SHELL) $+
211 $(MV) token.h $@
212
213$$(kash_0_OUTDIR)/init.c: \
214 $$(kash_DEFPATH)/mkinit.sh \
215 $$(abspathex $$(filter-out $$(kash_0_OUTDIR)/%,$$(kash_SOURCES)), $$(kash_DEFPATH)) \
216 | $$(dir $$@)
217 $(BOOTSTRAP_SHELL) $+
218 $(MV) init.c $@
219
220endif
221
222#
223# For debugging file handle inheritance on Windows.
224#
225if "$(KBUILD_TARGET)" == win && 0
226PROGRAMS += tstDump
227tstDump_TEMPLATE = BIN
228tstDump_SOURCES = tstDump.c
229endif
230
231# Include the sub-makefile.
232include $(PATH_SUB_CURRENT)/tests/Makefile.kmk
233
234include $(FILE_KBUILD_SUB_FOOTER)
235
236
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette