xref: /titanic_50/usr/src/cmd/ksh/builtins/Makefile (revision 7b07063d906859b2be1e88791f801b3c96e432f6)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27#
28# Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
29#
30
31PROG= alias
32ALIASPROG= \
33	bg \
34	cd \
35	cksum \
36	cmp \
37	comm \
38	command \
39	cut \
40	fc \
41	fg \
42	getopts \
43	hash \
44	jobs \
45	join \
46	kill \
47	logname \
48	paste \
49	print \
50	read \
51	rev \
52	sleep \
53	sum \
54	tee \
55	test \
56	type \
57	ulimit \
58	umask \
59	unalias \
60	uniq \
61	wait \
62	wc
63
64XPG4ALIASPROG= \
65	alias \
66	bg \
67	cd \
68	command \
69	fc \
70	fg \
71	getopts \
72	hash \
73	jobs \
74	kill \
75	read \
76	test \
77	type \
78	ulimit \
79	umask \
80	unalias \
81	wait
82
83XPG4SH= \
84	sh
85
86ROOTXPG4ALIAS= \
87	$(XPG4SH:%=$(ROOTXPG4BIN)/%) $(XPG4ALIASPROG:%=$(ROOTXPG4BIN)/%)
88ROOTALIASPROG= $(ALIASPROG:%=$(ROOTBIN)/%)
89
90include ../../Makefile.cmd
91$(SPARC_BLD)include ../../Makefile.cmd.64
92
93FILEMODE= 555
94CERRWARN += -_gcc=-Wno-parentheses
95
96.KEEP_STATE:
97
98all: $(PROG)
99
100$(XPG4ALIASPROG:%=$(ROOTXPG4BIN)/%):
101	$(RM) $@; $(SYMLINK) ../../bin/alias $@
102
103$(XPG4SH:%=$(ROOTXPG4BIN)/%):
104	$(RM) $@; $(SYMLINK) ../../bin/ksh93 $@
105
106$(ALIASPROG:%=$(ROOTBIN)/%): $(ROOTPROG)
107	$(RM) $@; $(LN) $(ROOTPROG) $@
108
109.KEEP_STATE:
110
111# Set common AST build flags (e.g., needed to support the math stuff).
112include ../../../Makefile.ast
113
114OBJECTS= \
115        alias.o
116
117SRCS=	$(OBJECTS:%.o=%.c)
118
119LDLIBS += -lshell -lcmd -last
120
121CPPFLAGS = \
122	$(DTEXTDOM) $(DTS_ERRNO) \
123	-I$(ROOT)/usr/include/ast \
124	-I$(ROOT)/usr/include
125
126# Enable workaround for a crash in /usr/bin/alias when invalid
127# options are passed (e.g. $ /usr/bin/alias -c #). The shell
128# code will call an error handler which does a |longjmp()| but
129# somehow the code failed to do the |setjmp()| before this point.
130CPPFLAGS += -DWORKAROUND_FOR_ALIAS_CRASH
131
132CFLAGS += \
133	$(ASTCFLAGS)
134CFLAGS64 += \
135	$(ASTCFLAGS64)
136
137ROOTCMDDIR=$(ROOT)/usr/bin
138
139install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTALIASPROG) $(ROOTXPG4ALIAS)
140
141$(PROG):	$(OBJECTS)
142	$(RM) alias
143	$(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
144	$(POST_PROCESS)
145
146clean clobber:
147	rm -f $(PROG) $(OBJECTS)
148
149lint _msg:
150