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