xref: /titanic_50/usr/src/cmd/ksh/Makefile (revision ead1f93ee620d7580f7e53350fe5a884fc4f158a)
1da2e3ebdSchin#
2da2e3ebdSchin# CDDL HEADER START
3da2e3ebdSchin#
4da2e3ebdSchin# The contents of this file are subject to the terms of the
5da2e3ebdSchin# Common Development and Distribution License (the "License").
6da2e3ebdSchin# You may not use this file except in compliance with the License.
7da2e3ebdSchin#
8da2e3ebdSchin# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9da2e3ebdSchin# or http://www.opensolaris.org/os/licensing.
10da2e3ebdSchin# See the License for the specific language governing permissions
11da2e3ebdSchin# and limitations under the License.
12da2e3ebdSchin#
13da2e3ebdSchin# When distributing Covered Code, include this CDDL HEADER in each
14da2e3ebdSchin# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15da2e3ebdSchin# If applicable, add the following below this CDDL HEADER, with the
16da2e3ebdSchin# fields enclosed by brackets "[]" replaced with your own identifying
17da2e3ebdSchin# information: Portions Copyright [yyyy] [name of copyright owner]
18da2e3ebdSchin#
19da2e3ebdSchin# CDDL HEADER END
20da2e3ebdSchin#
217c2fbfb3SApril Chin
22da2e3ebdSchin#
23*ead1f93eSLiane Praza# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
24da2e3ebdSchin# Use is subject to license terms.
25da2e3ebdSchin#
26da2e3ebdSchin
277c2fbfb3SApril ChinSHELL=/usr/bin/ksh93
28da2e3ebdSchin
29*ead1f93eSLiane PrazaPROG= ksh
30da2e3ebdSchin
31*ead1f93eSLiane PrazaUSRKSH_ALIAS_LIST=ksh ksh93 rksh rksh93 pfksh pfksh93 pfrksh pfrksh93
32da2e3ebdSchin
33da2e3ebdSchin
34da2e3ebdSchininclude ../Makefile.cmd
35da2e3ebdSchin
36da2e3ebdSchinSUBDIRS= $(MACH)
37da2e3ebdSchin$(BUILD64)SUBDIRS += $(MACH64)
38da2e3ebdSchin
397c2fbfb3SApril ChinSUBDIRS += builtins
407c2fbfb3SApril Chin
41*ead1f93eSLiane PrazaARCH32_i386= i86
42*ead1f93eSLiane PrazaARCH32_sparc= sparcv7
43*ead1f93eSLiane PrazaARCH32= $(ARCH32_$(MACH))
44*ead1f93eSLiane Praza
45da2e3ebdSchin# Serialise the build to avoid that we run the test suite for 32bit
46da2e3ebdSchin# and 64bit in parallel
47da2e3ebdSchin.NO_PARALLEL: $(SUBDIRS)
48da2e3ebdSchin
49da2e3ebdSchinall		:=	TARGET = all
50da2e3ebdSchininstall		:=	TARGET = install
51da2e3ebdSchinclean		:=	TARGET = clean
52da2e3ebdSchinclobber 	:=	TARGET = clobber
53da2e3ebdSchinlint		:=	TARGET = lint
54da2e3ebdSchintestshell	:=	TARGET = testshell
55da2e3ebdSchin
56da2e3ebdSchin.KEEP_STATE:
57da2e3ebdSchin
58da2e3ebdSchinall clean clobber lint testshell: $(SUBDIRS)
59da2e3ebdSchin
60da2e3ebdSchin# dummy file since AST/ksh doesn't use *.po files
61da2e3ebdSchin# (and "ksh" is just a frontend which calls directly into libshell,
62da2e3ebdSchin# e.g. there are no l10n strings here)
63da2e3ebdSchin$(PROG).po:
647c2fbfb3SApril Chin	$(RM) ksh.po ksh93.po ; \
657c2fbfb3SApril Chin	$(TOUCH) $(PROG).po
66da2e3ebdSchin
67da2e3ebdSchininstall:	$(ISAEXEC) $(SUBDIRS)
68da2e3ebdSchin	@(set -o xtrace ; \
697c2fbfb3SApril Chin	builtin ln ; \
707c2fbfb3SApril Chin	builtin rm ; \
717c2fbfb3SApril Chin	rm -f  $(ROOTPROG) ; \
727c2fbfb3SApril Chin	ln $(ISAEXEC) $(ROOTPROG) ; \
73da2e3ebdSchin	for i in $(USRKSH_ALIAS_LIST) ; do \
747c2fbfb3SApril Chin		[[ "$$i" == "$(PROG)" ]] && continue ; \
757c2fbfb3SApril Chin		rm -f "$(ROOTBIN)/$$i" ; \
767c2fbfb3SApril Chin		ln "$(ROOTBIN)/$(PROG)" "$(ROOTBIN)/$$i" ; \
77da2e3ebdSchin	done \
78da2e3ebdSchin	)
79*ead1f93eSLiane Praza	$(RM) $(ROOTSBIN)/sh
80*ead1f93eSLiane Praza	$(SYMLINK) ../usr/bin/$(ARCH32)/ksh93 $(ROOTSBIN)/sh
81*ead1f93eSLiane Praza	$(RM) $(ROOTSBIN)/jsh
82*ead1f93eSLiane Praza	$(SYMLINK) ../usr/bin/ksh93 $(ROOTSBIN)/jsh
83*ead1f93eSLiane Praza	$(RM) $(ROOTBIN)/jsh
84*ead1f93eSLiane Praza	$(SYMLINK) ksh93 $(ROOTBIN)/jsh
85*ead1f93eSLiane Praza	$(RM) $(ROOTSBIN)/pfsh
86*ead1f93eSLiane Praza	$(SYMLINK) ../usr/bin/ksh93 $(ROOTSBIN)/pfsh
87*ead1f93eSLiane Praza	$(RM) $(ROOTBIN)/pfsh
88*ead1f93eSLiane Praza	$(SYMLINK) ksh93 $(ROOTBIN)/pfsh
89*ead1f93eSLiane Praza	$(RM) $(ROOTBIN)/sh
90*ead1f93eSLiane Praza	$(SYMLINK) $(ARCH32)/ksh93 $(ROOTBIN)/sh
91*ead1f93eSLiane Praza	$(RM) $(ROOTLIB)/rsh
92*ead1f93eSLiane Praza	$(SYMLINK) ../bin/ksh93 $(ROOTLIB)/rsh
93da2e3ebdSchin
94da2e3ebdSchin$(SUBDIRS):	FRC
95da2e3ebdSchin	@cd $@; pwd; $(MAKE) $(TARGET)
96da2e3ebdSchin
97da2e3ebdSchinFRC:
98da2e3ebdSchin
99da2e3ebdSchininclude ../Makefile.targ
100