source: trunk/ash/Makefile.kmk@ 3075

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

Use the kBuild ash shell for the scripts, install ash as sh.exe too.

File size: 2.2 KB
Line 
1# $Id: $
2## @file
3#
4# kBuild Makefile for ash.
5#
6# Copyright (c) 2005 knut st. osmundsen <bird@anduin.net>
7#
8
9PROGRAMS = ash
10INSTALLS = ash.man
11
12ash_TEMPLATE = bin
13ash_INST = bin/ash$(SUFF_EXE) bin/sh$(SUFF_EXE)
14ash_DEFS = lint SHELL SMALL
15ash_DEFS.os2 = EXEC_HASH_BANG_SCRIPT PC_OS2_LIBPATHS PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
16ash_INCS = $(PATH_TARGET) . # (the last is because of error.h)
17ash_SOURCES = \
18 alias.c \
19 cd.c \
20 error.c \
21 eval.c \
22 exec.c \
23 expand.c \
24 histedit.c \
25 input.c \
26 jobs.c \
27 mail.c \
28 main.c \
29 memalloc.c \
30 miscbltin.c \
31 mystring.c \
32 options.c \
33 output.c \
34 parser.c \
35 redir.c \
36 show.c \
37 syntax.c \
38 trap.c \
39 var.c \
40 bltin/echo.c \
41 bltin/kill.c \
42 bltin/test.c \
43 $(PATH_TARGET)/arith.c \
44 $(PATH_TARGET)/arith_lex.c \
45 $(PATH_TARGET)/builtins.c \
46 $(PATH_TARGET)/init.c \
47 $(PATH_TARGET)/nodes.c
48ash_DEPS = \
49 $(PATH_TARGET)/arith.h \
50 $(PATH_TARGET)/builtins.h \
51 $(PATH_TARGET)/nodes.h \
52 $(PATH_TARGET)/token.h
53ash_CLEAN = \
54 $(ash_DEPS) \
55 $(PATH_TARGET)/arith.c \
56 $(PATH_TARGET)/arith_lex.c \
57 $(PATH_TARGET)/builtins.c \
58 $(PATH_TARGET)/init.c \
59 $(PATH_TARGET)/nodes.c
60
61ash.man_TEMPLATE = usr.bin.man
62ash.man_SOURCES = \
63 sh.1=>ash.1
64#ash.man_SYMLINKS = \
65# ash.1.gz=>sh.1
66
67DEPTH = ..
68include $(PATH_KBUILD)/rules.kmk
69
70$(PATH_TARGET)/arith.h $(PATH_TARGET)/arith.c: arith.y | $(call DIRDEP,$(PATH_TARGET))
71 yacc -ld $^
72 $(MV) -f y.tab.c $(PATH_TARGET)/arith.c
73 $(MV) -f y.tab.h $(PATH_TARGET)/arith.h
74
75$(PATH_TARGET)/arith_lex.c: arith_lex.l | $(call DIRDEP,$(PATH_TARGET))
76 flex -8 -o$@ $^ # 8-bit lex scanner for arithmetic
77
78$(PATH_TARGET)/builtins.h $(PATH_TARGET)/builtins.c: mkbuiltins shell.h builtins.def | $(call DIRDEP,$(PATH_TARGET))
79 $(ASH) $+ $(dir $@)
80 [ -f $(PATH_TARGET)/builtins.h ]
81
82$(PATH_TARGET)/nodes.h $(PATH_TARGET)/nodes.c: mknodes.sh nodetypes nodes.c.pat | $(call DIRDEP,$(PATH_TARGET))
83 $(ASH) $+ $(dir $@)
84 [ -f $(dir $@)/nodes.h ]
85
86$(PATH_TARGET)/token.h: mktokens | $(call DIRDEP,$(PATH_TARGET))
87 $(ASH) $+
88 $(MV) token.h $@
89
90$(PATH_TARGET)/init.c: mkinit.sh $(filter-out $(PATH_TARGET)/%,$(ash_SOURCES)) | $(call DIRDEP,$(PATH_TARGET))
91 $(ASH) $+
92 $(MV) init.c $@
93
Note: See TracBrowser for help on using the repository browser.