xref: /illumos-gate/usr/src/cmd/ast/ksh/Makefile (revision 2e00117bdb9152d78b3ddf7509ed11147cd829bf)
1*b30d1939SAndy Fiddaman#
2*b30d1939SAndy Fiddaman# CDDL HEADER START
3*b30d1939SAndy Fiddaman#
4*b30d1939SAndy Fiddaman# The contents of this file are subject to the terms of the
5*b30d1939SAndy Fiddaman# Common Development and Distribution License (the "License").
6*b30d1939SAndy Fiddaman# You may not use this file except in compliance with the License.
7*b30d1939SAndy Fiddaman#
8*b30d1939SAndy Fiddaman# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*b30d1939SAndy Fiddaman# or http://www.opensolaris.org/os/licensing.
10*b30d1939SAndy Fiddaman# See the License for the specific language governing permissions
11*b30d1939SAndy Fiddaman# and limitations under the License.
12*b30d1939SAndy Fiddaman#
13*b30d1939SAndy Fiddaman# When distributing Covered Code, include this CDDL HEADER in each
14*b30d1939SAndy Fiddaman# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*b30d1939SAndy Fiddaman# If applicable, add the following below this CDDL HEADER, with the
16*b30d1939SAndy Fiddaman# fields enclosed by brackets "[]" replaced with your own identifying
17*b30d1939SAndy Fiddaman# information: Portions Copyright [yyyy] [name of copyright owner]
18*b30d1939SAndy Fiddaman#
19*b30d1939SAndy Fiddaman# CDDL HEADER END
20*b30d1939SAndy Fiddaman#
21*b30d1939SAndy Fiddaman
22*b30d1939SAndy Fiddaman#
23*b30d1939SAndy Fiddaman# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24*b30d1939SAndy Fiddaman# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
25*b30d1939SAndy Fiddaman#
26*b30d1939SAndy Fiddaman
27*b30d1939SAndy FiddamanSHELL= /usr/bin/ksh93
28*b30d1939SAndy Fiddaman
29*b30d1939SAndy FiddamanPROG= ksh
30*b30d1939SAndy Fiddaman
31*b30d1939SAndy FiddamanUSRKSH_ALIAS_LIST=ksh ksh93 rksh rksh93
32*b30d1939SAndy Fiddaman
33*b30d1939SAndy Fiddamaninclude ../../Makefile.cmd
34*b30d1939SAndy Fiddaman
35*b30d1939SAndy FiddamanSUBDIRS= $(MACH)
36*b30d1939SAndy Fiddaman$(BUILD64)SUBDIRS += $(MACH64)
37*b30d1939SAndy Fiddaman
38*b30d1939SAndy FiddamanSUBDIRS += builtins
39*b30d1939SAndy Fiddaman
40*b30d1939SAndy FiddamanARCH32_i386= i86
41*b30d1939SAndy FiddamanARCH32_sparc= sparcv7
42*b30d1939SAndy FiddamanARCH32= $(ARCH32_$(MACH))
43*b30d1939SAndy Fiddaman
44*b30d1939SAndy Fiddamanall		:=	TARGET = all
45*b30d1939SAndy Fiddamaninstall		:=	TARGET = install
46*b30d1939SAndy Fiddamanclean		:=	TARGET = clean
47*b30d1939SAndy Fiddamanclobber		:=	TARGET = clobber
48*b30d1939SAndy Fiddamanlint		:=	TARGET = lint
49*b30d1939SAndy Fiddamantestshell	:=	TARGET = testshell
50*b30d1939SAndy Fiddaman
51*b30d1939SAndy Fiddaman.KEEP_STATE:
52*b30d1939SAndy Fiddaman# Serialise the build to avoid running the test suite for 32-bit
53*b30d1939SAndy Fiddaman# and 64-bit in parallel
54*b30d1939SAndy Fiddaman.NO_PARALLEL: $(SUBDIRS)
55*b30d1939SAndy Fiddaman
56*b30d1939SAndy Fiddamanall clean clobber lint testshell: $(SUBDIRS)
57*b30d1939SAndy Fiddamaninstall_h _feature:
58*b30d1939SAndy Fiddaman
59*b30d1939SAndy Fiddaman# dummy file since AST/ksh doesn't use *.po files
60*b30d1939SAndy Fiddaman# (and "ksh" is just a frontend which calls directly into libshell,
61*b30d1939SAndy Fiddaman# i.e. there are no l10n strings here)
62*b30d1939SAndy Fiddaman$(PROG).po:
63*b30d1939SAndy Fiddaman	$(RM) ksh.po ksh93.po ; \
64*b30d1939SAndy Fiddaman	$(TOUCH) $(PROG).po
65*b30d1939SAndy Fiddaman
66*b30d1939SAndy Fiddamaninstall: $(SUBDIRS)
67*b30d1939SAndy Fiddaman	@(set -o xtrace ; \
68*b30d1939SAndy Fiddaman	builtin ln ; \
69*b30d1939SAndy Fiddaman	builtin rm ; \
70*b30d1939SAndy Fiddaman	for i in $(USRKSH_ALIAS_LIST) ; do \
71*b30d1939SAndy Fiddaman		[[ "$$i" == "$(PROG)" ]] && continue ; \
72*b30d1939SAndy Fiddaman		rm -f "$(ROOTBIN)/$$i" ; \
73*b30d1939SAndy Fiddaman		ln "$(ROOTBIN)/$(PROG)" "$(ROOTBIN)/$$i" ; \
74*b30d1939SAndy Fiddaman	done \
75*b30d1939SAndy Fiddaman	)
76*b30d1939SAndy Fiddaman	$(RM) $(ROOTSBIN)/sh
77*b30d1939SAndy Fiddaman	$(SYMLINK) ../usr/bin/$(ARCH32)/ksh93 $(ROOTSBIN)/sh
78*b30d1939SAndy Fiddaman	$(RM) $(ROOTSBIN)/jsh
79*b30d1939SAndy Fiddaman	$(SYMLINK) ../usr/bin/ksh93 $(ROOTSBIN)/jsh
80*b30d1939SAndy Fiddaman	$(RM) $(ROOTBIN)/jsh
81*b30d1939SAndy Fiddaman	$(SYMLINK) ksh93 $(ROOTBIN)/jsh
82*b30d1939SAndy Fiddaman	$(RM) $(ROOTBIN)/sh
83*b30d1939SAndy Fiddaman	$(SYMLINK) $(ARCH32)/ksh93 $(ROOTBIN)/sh
84*b30d1939SAndy Fiddaman	$(RM) $(ROOTLIB)/rsh
85*b30d1939SAndy Fiddaman	$(SYMLINK) ../bin/ksh93 $(ROOTLIB)/rsh
86*b30d1939SAndy Fiddaman
87*b30d1939SAndy Fiddaman$(SUBDIRS):	FRC
88*b30d1939SAndy Fiddaman	@cd $@; pwd; $(MAKE) $(TARGET)
89*b30d1939SAndy FiddamanFRC:
90*b30d1939SAndy Fiddaman
91*b30d1939SAndy Fiddamaninclude ../../Makefile.targ
92