xref: /illumos-gate/usr/src/cmd/ast/ksh/Makefile (revision d7b72f7b52f902da47cc7210a9121f4caabbcb9c)
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	rm -f $(ROOTPROG) ; \
71	ln $(ISAEXEC) $(ROOTPROG) ; \
72	for i in $(USRKSH_ALIAS_LIST) ; do \
73		[[ "$$i" == "$(PROG)" ]] && continue ; \
74		rm -f "$(ROOTBIN)/$$i" ; \
75		ln "$(ROOTBIN)/$(PROG)" "$(ROOTBIN)/$$i" ; \
76	done \
77	)
78	$(RM) $(ROOTSBIN)/sh
79	$(SYMLINK) ../usr/bin/$(ARCH32)/ksh93 $(ROOTSBIN)/sh
80	$(RM) $(ROOTSBIN)/jsh
81	$(SYMLINK) ../usr/bin/ksh93 $(ROOTSBIN)/jsh
82	$(RM) $(ROOTBIN)/jsh
83	$(SYMLINK) ksh93 $(ROOTBIN)/jsh
84	$(RM) $(ROOTBIN)/sh
85	$(SYMLINK) $(ARCH32)/ksh93 $(ROOTBIN)/sh
86	$(RM) $(ROOTLIB)/rsh
87	$(SYMLINK) ../bin/ksh93 $(ROOTLIB)/rsh
88
89$(SUBDIRS):	FRC
90	@cd $@; pwd; $(MAKE) $(TARGET)
91FRC:
92
93include ../../Makefile.targ
94