xref: /titanic_50/usr/src/cmd/ksh/builtins/Makefile (revision bd670b35a010421b6e1a5536c34453a827007c81)
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
68OWNER= root
69GROUP= bin
70
71.KEEP_STATE:
72
73all: $(PROG)
74
75$(ROOTBIN)/%: $(ROOTBIN)/alias
76	$(INS.link)
77
78.KEEP_STATE:
79
80# Set common AST build flags (e.g., needed to support the math stuff).
81include ../../../Makefile.ast
82
83OBJECTS= \
84        alias.o
85
86SRCS=	$(OBJECTS:%.o=%.c)
87
88GROUP= bin
89LDLIBS += -lshell -lcmd -last
90
91CPPFLAGS = \
92	$(DTEXTDOM) $(DTS_ERRNO) \
93	-I$(ROOT)/usr/include/ast \
94	-I$(ROOT)/usr/include
95
96# Enable workaround for a crash in /usr/bin/alias when invalid
97# options are passed (e.g. $ /usr/bin/alias -c #). The shell
98# code will call an error handler which does a |longjmp()| but
99# somehow the code failed to do the |setjmp()| before this point.
100CPPFLAGS += -DWORKAROUND_FOR_ALIAS_CRASH
101
102CFLAGS += \
103	$(ASTCFLAGS)
104CFLAGS64 += \
105	$(ASTCFLAGS64)
106
107ROOTCMDDIR=$(ROOT)/usr/bin
108
109# .WAIT is needed to get the hardlinks properly done
110install: all $(ROOTCMD) .WAIT $(ROOTALIASPROG)
111
112$(PROG):	$(OBJECTS)
113	$(RM) alias
114	$(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
115	$(POST_PROCESS)
116
117clean clobber:
118	rm -f $(PROG) $(OBJECTS)
119
120lint _msg:
121