VirtualBox

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

Last change on this file since 632 was 632, checked in by bird, 18 years ago

MSC hacking.

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