xref: /titanic_41/usr/src/cmd/ksh/Makefile (revision ea394cb00fd96864e34d2841b4a22357b621c78f)
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 2010 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27SHELL=/usr/bin/ksh93
28
29PROG= ksh
30
31USRKSH_ALIAS_LIST=ksh ksh93 rksh rksh93 pfksh pfksh93 pfrksh pfrksh93
32
33
34include ../Makefile.cmd
35
36SUBDIRS= $(MACH)
37$(BUILD64)SUBDIRS += $(MACH64)
38
39SUBDIRS += builtins
40
41ARCH32_i386= i86
42ARCH32_sparc= sparcv7
43ARCH32= $(ARCH32_$(MACH))
44
45# Serialise the build to avoid that we run the test suite for 32bit
46# and 64bit in parallel
47.NO_PARALLEL: $(SUBDIRS)
48
49all		:=	TARGET = all
50install		:=	TARGET = install
51clean		:=	TARGET = clean
52clobber 	:=	TARGET = clobber
53lint		:=	TARGET = lint
54testshell	:=	TARGET = testshell
55
56.KEEP_STATE:
57
58all clean clobber lint testshell: $(SUBDIRS)
59
60# dummy file since AST/ksh doesn't use *.po files
61# (and "ksh" is just a frontend which calls directly into libshell,
62# e.g. there are no l10n strings here)
63$(PROG).po:
64	$(RM) ksh.po ksh93.po ; \
65	$(TOUCH) $(PROG).po
66
67install:	$(ISAEXEC) $(SUBDIRS)
68	@(set -o xtrace ; \
69	builtin ln ; \
70	builtin rm ; \
71	rm -f  $(ROOTPROG) ; \
72	ln $(ISAEXEC) $(ROOTPROG) ; \
73	for i in $(USRKSH_ALIAS_LIST) ; do \
74		[[ "$$i" == "$(PROG)" ]] && continue ; \
75		rm -f "$(ROOTBIN)/$$i" ; \
76		ln "$(ROOTBIN)/$(PROG)" "$(ROOTBIN)/$$i" ; \
77	done \
78	)
79	$(RM) $(ROOTSBIN)/sh
80	$(SYMLINK) ../usr/bin/$(ARCH32)/ksh93 $(ROOTSBIN)/sh
81	$(RM) $(ROOTSBIN)/jsh
82	$(SYMLINK) ../usr/bin/ksh93 $(ROOTSBIN)/jsh
83	$(RM) $(ROOTBIN)/jsh
84	$(SYMLINK) ksh93 $(ROOTBIN)/jsh
85	$(RM) $(ROOTSBIN)/pfsh
86	$(SYMLINK) ../usr/bin/ksh93 $(ROOTSBIN)/pfsh
87	$(RM) $(ROOTBIN)/pfsh
88	$(SYMLINK) ksh93 $(ROOTBIN)/pfsh
89	$(RM) $(ROOTBIN)/sh
90	$(SYMLINK) $(ARCH32)/ksh93 $(ROOTBIN)/sh
91	$(RM) $(ROOTLIB)/rsh
92	$(SYMLINK) ../bin/ksh93 $(ROOTLIB)/rsh
93
94$(SUBDIRS):	FRC
95	@cd $@; pwd; $(MAKE) $(TARGET)
96
97FRC:
98
99include ../Makefile.targ
100