VirtualBox

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

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

More GNU hurd adjustments.

  • 屬性 svn:eol-style 設為 LF
  • 屬性 svn:keywords 設為 Id
檔案大小: 5.4 KB
 
1# $Id: Makefile.kmk 3110 2017-10-20 19:14:56Z 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.gnuhurd = \
106 sys_signame.c \
107 strlcpy.c
108kash_SOURCES.gnukfbsd = \
109 sys_signame.c \
110 strlcpy.c
111kash_SOURCES.gnuknbsd = \
112 sys_signame.c \
113 strlcpy.c
114kash_SOURCES.haiku = \
115 sys_signame.c \
116 strlcpy.c
117kash_SOURCES.linux = \
118 sys_signame.c \
119 strlcpy.c
120kash_SOURCES.solaris = \
121 sys_signame.c \
122 strlcpy.c
123kash_SOURCES.win = \
124 sys_signame.c \
125 strlcpy.c \
126 shfork-win.c \
127 shforkA-win.asm
128
129kash_INTERMEDIATES = \
130 $(kash_0_OUTDIR)/builtins.h \
131 $(kash_0_OUTDIR)/nodes.h \
132 $(kash_0_OUTDIR)/token.h
133kash_CLEAN = \
134 $(kash_INTERMEDIATES) \
135 $(kash_0_OUTDIR)/builtins.c \
136 $(kash_0_OUTDIR)/init.c \
137 $(kash_0_OUTDIR)/nodes.c
138
139kash_main.c_DEFS = KBUILD_SVN_REV=$(KBUILD_SVN_REV)
140
141##
142## The manual page.
143##
144#INSTALLS += kash.man
145#kash.man_TEMPLATE = usr.bin.man
146#kash.man_SOURCES = sh.1=>kash.1
147
148
149if1of ($(KBUILD_TARGET), win os2)
150 KASH_USE_PREGENERATED_CODE = 1
151endif
152
153ifdef KASH_USE_PREGENERATED_CODE
154
155#
156# Use the pregenerated code.
157#
158kash_SOURCES += \
159 $(kash_0_OUTDIR)/arith.c \
160 $(kash_0_OUTDIR)/arith_lex.c
161kash_INTERMEDIATES += \
162 $(kash_0_OUTDIR)/arith.h
163
164define def_copy_generated
165$$$$(kash_0_OUTDIR)/$(src): $(PATH_SUB_CURRENT)/generated/$(src)
166 $$(RM) -f $$@
167 $$(CP) -f $$^ $$@
168endef
169
170$(foreach src, arith.h arith.c arith_lex.c builtins.h builtins.c nodes.h nodes.c token.h init.c,\
171$(eval $(def_copy_generated)))
172
173else # !KASH_USE_PREGENERATED_CODE
174
175#
176# Generate the code on the fly.
177#
178
179USES += lex yacc
180kash_USES = lex yacc
181kash_LEXTOOL = FLEX
182kash_LEXFLAGS = -8
183#kash_YACCTOOL = BISON
184kash_YACCTOOL = YACC
185kash_YACCFLAGS = -ld
186kash_SOURCES += \
187 arith.y \
188 arith_lex.l
189
190#
191# ATTENTION! ATTENTION! ATTENTION!
192#
193# Older ash versions has trouble with some of these scripts, great.
194# Kudos to the NetBSD guys for this clever move. ;)
195#
196# So, when building for the frist time, setting BOOSTRAP_SHELL=/bin/bash is good idea.
197#
198BOOTSTRAP_SHELL ?= $(SHELL)
199
200$$(kash_0_OUTDIR)/builtins.h + $$(kash_0_OUTDIR)/builtins.c: \
201 $$(kash_DEFPATH)/mkbuiltins \
202 $$(kash_DEFPATH)/shell.h \
203 $$(kash_DEFPATH)/builtins.def \
204 | $$(dir $$@)
205 $(BOOTSTRAP_SHELL) $+ $(dir $@)
206 [ -f $(kash_0_OUTDIR)/builtins.h ]
207
208$$(kash_0_OUTDIR)/nodes.h + $$(kash_0_OUTDIR)/nodes.c: \
209 $$(kash_DEFPATH)/mknodes.sh \
210 $$(kash_DEFPATH)/nodetypes \
211 $$(kash_DEFPATH)/nodes.c.pat \
212 | $$(dir $$@)
213 $(BOOTSTRAP_SHELL) $+ $(dir $@)
214 [ -f $(dir $@)/nodes.h ]
215
216$$(kash_0_OUTDIR)/token.h: $$(kash_DEFPATH)/mktokens | $$(dir $$@)
217 $(BOOTSTRAP_SHELL) $+
218 $(MV) token.h $@
219
220$$(kash_0_OUTDIR)/init.c: \
221 $$(kash_DEFPATH)/mkinit.sh \
222 $$(abspathex $$(filter-out $$(kash_0_OUTDIR)/%,$$(kash_SOURCES)), $$(kash_DEFPATH)) \
223 | $$(dir $$@)
224 $(BOOTSTRAP_SHELL) $+
225 $(MV) init.c $@
226
227endif # !KASH_USE_PREGENERATED_CODE
228
229#
230# For debugging file handle inheritance on Windows.
231#
232if "$(KBUILD_TARGET)" == win && 0
233PROGRAMS += tstDump
234tstDump_TEMPLATE = BIN
235tstDump_SOURCES = tstDump.c
236endif
237
238# Include the sub-makefile.
239include $(PATH_SUB_CURRENT)/tests/Makefile.kmk
240
241include $(FILE_KBUILD_SUB_FOOTER)
242
243
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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