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