VirtualBox

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

Last change on this file since 1626 was 1604, checked in by bird, 17 years ago

DragonFly BSD config. Kudos to Francis G.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1# $Id: Makefile.kmk 1604 2008-05-05 22:22:55Z bird $
2## @file
3# kBuild Makefile for kash.
4#
5
6#
7# Copyright (c) 2005-2008 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 2 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, write to the Free Software
23# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24#
25#
26
27DEPTH = ../..
28include $(PATH_KBUILD)/header.kmk
29
30#
31# The program.
32#
33PROGRAMS += kash
34kash_TEMPLATE = BIN
35kash_DEFS = lint SHELL SMALL
36kash_DEFS += SH_STUB_MODE # for the time being.
37kash_DEFS.debug = DEBUG
38kash_DEFS.linux = BSD
39kash_DEFS.solaris = BSD
40kash_DEFS.win = \
41 BSD PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS YY_NO_UNISTD_H
42kash_DEFS.os2 = \
43 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME \
44 EXEC_HASH_BANG_SCRIPT PC_OS2_LIBPATHS PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
45kash_DEFS.darwin = \
46 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
47kash_DEFS.dragonfly = \
48 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
49kash_DEFS.freebsd = \
50 HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
51kash_INCS = $(PATH_TARGET) . # (the last is because of error.h)
52kash_SOURCES = \
53 main.c \
54 alias.c \
55 cd.c \
56 error.c \
57 eval.c \
58 exec.c \
59 expand.c \
60 histedit.c \
61 input.c \
62 jobs.c \
63 mail.c \
64 memalloc.c \
65 mystring.c \
66 options.c \
67 output.c \
68 parser.c \
69 redir.c \
70 show.c \
71 syntax.c \
72 trap.c \
73 var.c \
74 miscbltin.c \
75 bltin/echo.c \
76 bltin/kill.c \
77 bltin/test.c \
78 \
79 $(PATH_TARGET)/arith.c \
80 $(PATH_TARGET)/arith_lex.c \
81 $(PATH_TARGET)/builtins.c \
82 $(PATH_TARGET)/init.c \
83 $(PATH_TARGET)/nodes.c \
84 \
85 setmode.c \
86 shinstance.c \
87 shthread.c \
88 shfile.c
89kash_SOURCES.linux = \
90 sys_signame.c \
91 strlcpy.c
92kash_SOURCES.win = \
93 sys_signame.c \
94 strlcpy.c
95kash_SOURCES.solaris = \
96 sys_signame.c \
97 strlcpy.c
98
99kash_ORDERDEPS = \
100 $(PATH_TARGET)/arith.h \
101 $(PATH_TARGET)/builtins.h \
102 $(PATH_TARGET)/nodes.h \
103 $(PATH_TARGET)/token.h
104kash_CLEAN = \
105 $(kash_ORDERDEPS) \
106 $(PATH_TARGET)/arith.c \
107 $(PATH_TARGET)/arith_lex.c \
108 $(PATH_TARGET)/builtins.c \
109 $(PATH_TARGET)/init.c \
110 $(PATH_TARGET)/nodes.c
111
112##
113## The manual page.
114##
115#INSTALLS += kash.man
116#kash.man_TEMPLATE = usr.bin.man
117#kash.man_SOURCES = sh.1=>kash.1
118
119
120ifeq ($(filter-out win,$(KBUILD_TARGET)),)
121
122#
123# Use the pregenerated code.
124#
125kash_ORDERDEPS :=
126kash_INCS += generated
127kash_SOURCES := $(patsubst $(PATH_TARGET)/%,generated/%,$(kash_SOURCES))
128
129include $(FILE_KBUILD_FOOTER)
130
131else
132
133include $(FILE_KBUILD_FOOTER)
134
135#
136# ATTENTION! ATTENTION! ATTENTION!
137#
138# Older ash versions has trouble with some of these scripts, great.
139# Kudos to the NetBSD guys for this clever move. ;)
140#
141# So, when building for the frist time, setting BOOSTRAP_SHELL=/bin/bash is good idea.
142#
143BOOTSTRAP_SHELL ?= $(SHELL)
144YACC ?= yacc
145
146$(PATH_TARGET)/arith.h $(PATH_TARGET)/arith.c: arith.y | $(call DIRDEP,$(PATH_TARGET))
147 $(YACC) -ld $^
148 $(MV) -f y.tab.c $(PATH_TARGET)/arith.c
149 $(MV) -f y.tab.h $(PATH_TARGET)/arith.h
150
151$(PATH_TARGET)/arith_lex.c: arith_lex.l | $(call DIRDEP,$(PATH_TARGET))
152 flex -8 -o$@ $^ # 8-bit lex scanner for arithmetic
153
154$(PATH_TARGET)/builtins.h $(PATH_TARGET)/builtins.c: $(PATH_CURRENT)/mkbuiltins shell.h builtins.def | $(call DIRDEP,$(PATH_TARGET))
155 $(BOOTSTRAP_SHELL) $+ $(dir $@)
156 [ -f $(PATH_TARGET)/builtins.h ]
157
158$(PATH_TARGET)/nodes.h $(PATH_TARGET)/nodes.c: $(PATH_CURRENT)/mknodes.sh nodetypes nodes.c.pat | $(call DIRDEP,$(PATH_TARGET))
159 $(BOOTSTRAP_SHELL) $+ $(dir $@)
160 [ -f $(dir $@)/nodes.h ]
161
162$(PATH_TARGET)/token.h: $(PATH_CURRENT)/mktokens | $(call DIRDEP,$(PATH_TARGET))
163 $(BOOTSTRAP_SHELL) $+
164 $(MV) token.h $@
165
166$(PATH_TARGET)/init.c: $(PATH_CURRENT)/mkinit.sh $(filter-out $(PATH_TARGET)/%,$(kash_SOURCES)) | $(call DIRDEP,$(PATH_TARGET))
167 $(BOOTSTRAP_SHELL) $+
168 $(MV) init.c $@
169
170endif
Note: See TracBrowser for help on using the repository browser.

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