VirtualBox

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

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

file mockup.

  • Property svn:eol-style set to LF
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
17kmk_ash_DEFS += SH_STUB_MODE # for the time being.
18kmk_ash_DEFS.debug = DEBUG
19kmk_ash_DEFS.linux = BSD
20kmk_ash_DEFS.solaris = BSD
21kmk_ash_DEFS.win = \
22 BSD PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS YY_NO_UNISTD_H
23kmk_ash_DEFS.os2 = \
24 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME \
25 EXEC_HASH_BANG_SCRIPT PC_OS2_LIBPATHS PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
26kmk_ash_DEFS.darwin = \
27 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
28kmk_ash_DEFS.freebsd = \
29 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
30kmk_ash_INCS = $(PATH_TARGET) . # (the last is because of error.h)
31kmk_ash_CFLAGS.win = -I. ## @todo kBuild bug.
32kmk_ash_INCS.win = win
33kmk_ash_SOURCES = \
34 main.c \
35 alias.c \
36 cd.c \
37 error.c \
38 eval.c \
39 exec.c \
40 expand.c \
41 histedit.c \
42 input.c \
43 jobs.c \
44 mail.c \
45 memalloc.c \
46 mystring.c \
47 options.c \
48 output.c \
49 parser.c \
50 redir.c \
51 show.c \
52 syntax.c \
53 trap.c \
54 var.c \
55 miscbltin.c \
56 bltin/echo.c \
57 bltin/kill.c \
58 bltin/test.c \
59 \
60 $(PATH_TARGET)/arith.c \
61 $(PATH_TARGET)/arith_lex.c \
62 $(PATH_TARGET)/builtins.c \
63 $(PATH_TARGET)/init.c \
64 $(PATH_TARGET)/nodes.c \
65 \
66 setmode.c \
67 shinstance.c \
68 shthread.c \
69 shfile.c
70kmk_ash_SOURCES.linux = \
71 sys_signame.c \
72 strlcpy.c
73kmk_ash_SOURCES.win = \
74 sys_signame.c \
75 strlcpy.c
76#kmk_ash_SOURCES.win = \
77# win/mscfakes.c \
78# win/err.c \
79# win/dirent.c \
80# sys_signame.c \
81# strlcpy.c
82kmk_ash_SOURCES.solaris = \
83 sys_signame.c \
84 strlcpy.c
85
86kmk_ash_ORDERDEPS = \
87 $(PATH_TARGET)/arith.h \
88 $(PATH_TARGET)/builtins.h \
89 $(PATH_TARGET)/nodes.h \
90 $(PATH_TARGET)/token.h
91kmk_ash_CLEAN = \
92 $(kmk_ash_ORDERDEPS) \
93 $(PATH_TARGET)/arith.c \
94 $(PATH_TARGET)/arith_lex.c \
95 $(PATH_TARGET)/builtins.c \
96 $(PATH_TARGET)/init.c \
97 $(PATH_TARGET)/nodes.c
98
99kmk_ash.man_TEMPLATE = usr.bin.man
100kmk_ash.man_SOURCES = \
101 sh.1=>ash.1
102#ash.man_SYMLINKS = \
103# ash.1.gz=>sh.1
104
105
106
107ifeq ($(filter-out win,$(BUILD_TARGET)),)
108
109#
110# Use the pregenerated code.
111#
112kmk_ash_ORDERDEPS :=
113kmk_ash_INCS += generated
114kmk_ash_SOURCES := $(patsubst $(PATH_TARGET)/%,generated/%,$(kmk_ash_SOURCES))
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