xref: /titanic_51/usr/src/cmd/ksh/builtins/Makefile (revision fe89515e649436ba27844b63b5f18b41113d99c8)
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	bg \
66	cd \
67	command \
68	fc \
69	fg \
70	getopts \
71	hash \
72	jobs \
73	kill \
74	read \
75	test \
76	type \
77	ulimit \
78	umask \
79	unalias \
80	wait
81
82include ../../Makefile.cmd
83$(SPARC_BLD)include ../../Makefile.cmd.64
84
85ROOTALIASPROG= $(ALIASPROG:%=$(ROOTBIN)/%) $(XPG4ALIASPROG:%=$(ROOTXPG4BIN)/%)
86
87FILEMODE= 555
88
89.KEEP_STATE:
90
91all: $(PROG)
92
93$(ROOTBIN)/%: $(ROOTBIN)/alias
94	$(INS.link)
95
96$(ROOTXPG4BIN)/%: $(ROOTBIN)/alias
97	$(INS.link)
98
99.KEEP_STATE:
100
101# Set common AST build flags (e.g., needed to support the math stuff).
102include ../../../Makefile.ast
103
104OBJECTS= \
105        alias.o
106
107SRCS=	$(OBJECTS:%.o=%.c)
108
109LDLIBS += -lshell -lcmd -last
110
111CPPFLAGS = \
112	$(DTEXTDOM) $(DTS_ERRNO) \
113	-I$(ROOT)/usr/include/ast \
114	-I$(ROOT)/usr/include
115
116# Enable workaround for a crash in /usr/bin/alias when invalid
117# options are passed (e.g. $ /usr/bin/alias -c #). The shell
118# code will call an error handler which does a |longjmp()| but
119# somehow the code failed to do the |setjmp()| before this point.
120CPPFLAGS += -DWORKAROUND_FOR_ALIAS_CRASH
121
122CFLAGS += \
123	$(ASTCFLAGS)
124CFLAGS64 += \
125	$(ASTCFLAGS64)
126
127ROOTCMDDIR=$(ROOT)/usr/bin
128
129# .WAIT is needed to get the hardlinks properly done
130install: all $(ROOTCMD) .WAIT $(ROOTALIASPROG)
131
132$(PROG):	$(OBJECTS)
133	$(RM) alias
134	$(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
135	$(POST_PROCESS)
136
137clean clobber:
138	rm -f $(PROG) $(OBJECTS)
139
140lint _msg:
141