VirtualBox

source: kBuild/trunk/src/ash/Makefile.kmk@ 1158

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

KMK.

  • Property svn:eol-style set to native
File size: 3.6 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 KMK
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 PC_SLASHES
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 PC_SLASHES
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
116include $(PATH_KBUILD)/footer.kmk
117
118else
119
120include $(PATH_KBUILD)/footer.kmk
121
122#
123# ATTENTION! ATTENTION! ATTENTION!
124#
125# Older ash versions has trouble with some of these scripts, great.
126# Kudos to the NetBSD guys for this clever move. ;)
127#
128# So, when building for the frist time, setting BOOSTRAP_SHELL=/bin/bash is good idea.
129#
130BOOTSTRAP_SHELL ?= $(SHELL)
131YACC ?= yacc
132
133$(PATH_TARGET)/arith.h $(PATH_TARGET)/arith.c: arith.y | $(call DIRDEP,$(PATH_TARGET))
134 $(YACC) -ld $^
135 $(MV) -f y.tab.c $(PATH_TARGET)/arith.c
136 $(MV) -f y.tab.h $(PATH_TARGET)/arith.h
137
138$(PATH_TARGET)/arith_lex.c: arith_lex.l | $(call DIRDEP,$(PATH_TARGET))
139 flex -8 -o$@ $^ # 8-bit lex scanner for arithmetic
140
141$(PATH_TARGET)/builtins.h $(PATH_TARGET)/builtins.c: $(PATH_CURRENT)/mkbuiltins shell.h builtins.def | $(call DIRDEP,$(PATH_TARGET))
142 $(BOOTSTRAP_SHELL) $+ $(dir $@)
143 [ -f $(PATH_TARGET)/builtins.h ]
144
145$(PATH_TARGET)/nodes.h $(PATH_TARGET)/nodes.c: $(PATH_CURRENT)/mknodes.sh nodetypes nodes.c.pat | $(call DIRDEP,$(PATH_TARGET))
146 $(BOOTSTRAP_SHELL) $+ $(dir $@)
147 [ -f $(dir $@)/nodes.h ]
148
149$(PATH_TARGET)/token.h: $(PATH_CURRENT)/mktokens | $(call DIRDEP,$(PATH_TARGET))
150 $(BOOTSTRAP_SHELL) $+
151 $(MV) token.h $@
152
153$(PATH_TARGET)/init.c: $(PATH_CURRENT)/mkinit.sh $(filter-out $(PATH_TARGET)/%,$(kmk_ash_SOURCES)) | $(call DIRDEP,$(PATH_TARGET))
154 $(BOOTSTRAP_SHELL) $+
155 $(MV) init.c $@
156
157endif
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