xref: /titanic_50/usr/src/cmd/ksh/builtins/Makefile (revision 726fad2a65f16c200a03969c29cb5c86c2d427db)
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
27SHELL=/usr/bin/ksh93
28
29PROG= alias
30ALIASPROG= \
31	bg \
32	cd \
33	cksum \
34	cmp \
35	comm \
36	command \
37	cut \
38	fc \
39	fg \
40	getopts \
41	hash \
42	jobs \
43	join \
44	kill \
45	logname \
46	paste \
47	print \
48	read \
49	rev \
50	sleep \
51	sum \
52	tee \
53	test \
54	type \
55	ulimit \
56	umask \
57	unalias \
58	uniq \
59	wait \
60	wc
61
62include ../../Makefile.cmd
63$(SPARC_BLD)include ../../Makefile.cmd.64
64
65ROOTALIASPROG= $(ALIASPROG:%=$(ROOTBIN)/%)
66
67FILEMODE= 555
68
69.KEEP_STATE:
70
71all: $(PROG)
72
73$(ROOTBIN)/%: $(ROOTBIN)/alias
74	$(INS.link)
75
76.KEEP_STATE:
77
78# Set common AST build flags (e.g., needed to support the math stuff).
79include ../../../Makefile.ast
80
81OBJECTS= \
82        alias.o
83
84SRCS=	$(OBJECTS:%.o=%.c)
85
86LDLIBS += -lshell -lcmd -last
87
88CPPFLAGS = \
89	$(DTEXTDOM) $(DTS_ERRNO) \
90	-I$(ROOT)/usr/include/ast \
91	-I$(ROOT)/usr/include
92
93# Enable workaround for a crash in /usr/bin/alias when invalid
94# options are passed (e.g. $ /usr/bin/alias -c #). The shell
95# code will call an error handler which does a |longjmp()| but
96# somehow the code failed to do the |setjmp()| before this point.
97CPPFLAGS += -DWORKAROUND_FOR_ALIAS_CRASH
98
99CFLAGS += \
100	$(ASTCFLAGS)
101CFLAGS64 += \
102	$(ASTCFLAGS64)
103
104ROOTCMDDIR=$(ROOT)/usr/bin
105
106# .WAIT is needed to get the hardlinks properly done
107install: all $(ROOTCMD) .WAIT $(ROOTALIASPROG)
108
109$(PROG):	$(OBJECTS)
110	$(RM) alias
111	$(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
112	$(POST_PROCESS)
113
114clean clobber:
115	rm -f $(PROG) $(OBJECTS)
116
117lint _msg:
118