xref: /titanic_50/usr/src/cmd/ksh/builtins/Makefile (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
17c2fbfb3SApril Chin#
27c2fbfb3SApril Chin# CDDL HEADER START
37c2fbfb3SApril Chin#
47c2fbfb3SApril Chin# The contents of this file are subject to the terms of the
57c2fbfb3SApril Chin# Common Development and Distribution License (the "License").
67c2fbfb3SApril Chin# You may not use this file except in compliance with the License.
77c2fbfb3SApril Chin#
87c2fbfb3SApril Chin# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c2fbfb3SApril Chin# or http://www.opensolaris.org/os/licensing.
107c2fbfb3SApril Chin# See the License for the specific language governing permissions
117c2fbfb3SApril Chin# and limitations under the License.
127c2fbfb3SApril Chin#
137c2fbfb3SApril Chin# When distributing Covered Code, include this CDDL HEADER in each
147c2fbfb3SApril Chin# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c2fbfb3SApril Chin# If applicable, add the following below this CDDL HEADER, with the
167c2fbfb3SApril Chin# fields enclosed by brackets "[]" replaced with your own identifying
177c2fbfb3SApril Chin# information: Portions Copyright [yyyy] [name of copyright owner]
187c2fbfb3SApril Chin#
197c2fbfb3SApril Chin# CDDL HEADER END
207c2fbfb3SApril Chin#
217c2fbfb3SApril Chin
227c2fbfb3SApril Chin#
2381af778eSCasper H.S. Dik# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
247c2fbfb3SApril Chin# Use is subject to license terms.
257c2fbfb3SApril Chin#
267c2fbfb3SApril Chin
275d4606d7SGarrett D'Amore#
285d4606d7SGarrett D'Amore# Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
295d4606d7SGarrett D'Amore#
307c2fbfb3SApril Chin
317c2fbfb3SApril ChinPROG= alias
327c2fbfb3SApril ChinALIASPROG= \
337c2fbfb3SApril Chin	bg \
347c2fbfb3SApril Chin	cd \
3534f9b3eeSRoland Mainz	cksum \
3634f9b3eeSRoland Mainz	cmp \
3734f9b3eeSRoland Mainz	comm \
387c2fbfb3SApril Chin	command \
3934f9b3eeSRoland Mainz	cut \
407c2fbfb3SApril Chin	fc \
417c2fbfb3SApril Chin	fg \
427c2fbfb3SApril Chin	getopts \
437c2fbfb3SApril Chin	hash \
447c2fbfb3SApril Chin	jobs \
4534f9b3eeSRoland Mainz	join \
467c2fbfb3SApril Chin	kill \
4734f9b3eeSRoland Mainz	logname \
4834f9b3eeSRoland Mainz	paste \
4934f9b3eeSRoland Mainz	print \
507c2fbfb3SApril Chin	read \
517c2fbfb3SApril Chin	rev \
527c2fbfb3SApril Chin	sleep \
537c2fbfb3SApril Chin	sum \
5434f9b3eeSRoland Mainz	tee \
557c2fbfb3SApril Chin	test \
567c2fbfb3SApril Chin	type \
577c2fbfb3SApril Chin	ulimit \
587c2fbfb3SApril Chin	umask \
597c2fbfb3SApril Chin	unalias \
6034f9b3eeSRoland Mainz	uniq \
6134f9b3eeSRoland Mainz	wait \
6234f9b3eeSRoland Mainz	wc
637c2fbfb3SApril Chin
645d4606d7SGarrett D'AmoreXPG4ALIASPROG= \
6565f38579SGarrett D'Amore	alias \
665d4606d7SGarrett D'Amore	bg \
675d4606d7SGarrett D'Amore	cd \
685d4606d7SGarrett D'Amore	command \
695d4606d7SGarrett D'Amore	fc \
705d4606d7SGarrett D'Amore	fg \
715d4606d7SGarrett D'Amore	getopts \
725d4606d7SGarrett D'Amore	hash \
735d4606d7SGarrett D'Amore	jobs \
745d4606d7SGarrett D'Amore	kill \
755d4606d7SGarrett D'Amore	read \
765d4606d7SGarrett D'Amore	test \
775d4606d7SGarrett D'Amore	type \
785d4606d7SGarrett D'Amore	ulimit \
795d4606d7SGarrett D'Amore	umask \
805d4606d7SGarrett D'Amore	unalias \
815d4606d7SGarrett D'Amore	wait
825d4606d7SGarrett D'Amore
8365f38579SGarrett D'AmoreXPG4SH= \
8465f38579SGarrett D'Amore	sh
8565f38579SGarrett D'Amore
8665f38579SGarrett D'AmoreROOTXPG4ALIAS= \
8765f38579SGarrett D'Amore	$(XPG4SH:%=$(ROOTXPG4BIN)/%) $(XPG4ALIASPROG:%=$(ROOTXPG4BIN)/%)
8865f38579SGarrett D'AmoreROOTALIASPROG= $(ALIASPROG:%=$(ROOTBIN)/%)
8965f38579SGarrett D'Amore
907c2fbfb3SApril Chininclude ../../Makefile.cmd
9134f9b3eeSRoland Mainz$(SPARC_BLD)include ../../Makefile.cmd.64
927c2fbfb3SApril Chin
937c2fbfb3SApril ChinFILEMODE= 555
94*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses
957c2fbfb3SApril Chin
967c2fbfb3SApril Chin.KEEP_STATE:
977c2fbfb3SApril Chin
987c2fbfb3SApril Chinall: $(PROG)
997c2fbfb3SApril Chin
10065f38579SGarrett D'Amore$(XPG4ALIASPROG:%=$(ROOTXPG4BIN)/%):
10165f38579SGarrett D'Amore	$(RM) $@; $(SYMLINK) ../../bin/alias $@
1027c2fbfb3SApril Chin
10365f38579SGarrett D'Amore$(XPG4SH:%=$(ROOTXPG4BIN)/%):
10465f38579SGarrett D'Amore	$(RM) $@; $(SYMLINK) ../../bin/ksh93 $@
10565f38579SGarrett D'Amore
10665f38579SGarrett D'Amore$(ALIASPROG:%=$(ROOTBIN)/%): $(ROOTPROG)
10765f38579SGarrett D'Amore	$(RM) $@; $(LN) $(ROOTPROG) $@
1085d4606d7SGarrett D'Amore
10981af778eSCasper H.S. Dik.KEEP_STATE:
11081af778eSCasper H.S. Dik
11181af778eSCasper H.S. Dik# Set common AST build flags (e.g., needed to support the math stuff).
11281af778eSCasper H.S. Dikinclude ../../../Makefile.ast
11381af778eSCasper H.S. Dik
11481af778eSCasper H.S. DikOBJECTS= \
11581af778eSCasper H.S. Dik        alias.o
11681af778eSCasper H.S. Dik
11781af778eSCasper H.S. DikSRCS=	$(OBJECTS:%.o=%.c)
11881af778eSCasper H.S. Dik
11934f9b3eeSRoland MainzLDLIBS += -lshell -lcmd -last
12081af778eSCasper H.S. Dik
12181af778eSCasper H.S. DikCPPFLAGS = \
12281af778eSCasper H.S. Dik	$(DTEXTDOM) $(DTS_ERRNO) \
12334f9b3eeSRoland Mainz	-I$(ROOT)/usr/include/ast \
12434f9b3eeSRoland Mainz	-I$(ROOT)/usr/include
12534f9b3eeSRoland Mainz
12634f9b3eeSRoland Mainz# Enable workaround for a crash in /usr/bin/alias when invalid
12734f9b3eeSRoland Mainz# options are passed (e.g. $ /usr/bin/alias -c #). The shell
12834f9b3eeSRoland Mainz# code will call an error handler which does a |longjmp()| but
12934f9b3eeSRoland Mainz# somehow the code failed to do the |setjmp()| before this point.
13034f9b3eeSRoland MainzCPPFLAGS += -DWORKAROUND_FOR_ALIAS_CRASH
13181af778eSCasper H.S. Dik
13281af778eSCasper H.S. DikCFLAGS += \
13381af778eSCasper H.S. Dik	$(ASTCFLAGS)
13481af778eSCasper H.S. DikCFLAGS64 += \
13581af778eSCasper H.S. Dik	$(ASTCFLAGS64)
13681af778eSCasper H.S. Dik
13781af778eSCasper H.S. DikROOTCMDDIR=$(ROOT)/usr/bin
13881af778eSCasper H.S. Dik
13965f38579SGarrett D'Amoreinstall: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTALIASPROG) $(ROOTXPG4ALIAS)
14081af778eSCasper H.S. Dik
14181af778eSCasper H.S. Dik$(PROG):	$(OBJECTS)
14281af778eSCasper H.S. Dik	$(RM) alias
14381af778eSCasper H.S. Dik	$(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
14481af778eSCasper H.S. Dik	$(POST_PROCESS)
1457c2fbfb3SApril Chin
1467c2fbfb3SApril Chinclean clobber:
14781af778eSCasper H.S. Dik	rm -f $(PROG) $(OBJECTS)
1487c2fbfb3SApril Chin
14981af778eSCasper H.S. Diklint _msg:
150