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.
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.
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]
23 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
30 USRKSH_ALIAS_LIST=ksh ksh93 rksh rksh93
35 LIBSHELLBASE=../../../lib/libshell
36 LIBSHELLSRC=$(LIBSHELLBASE)/common/sh
38 SRCS= $(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
42 # Set common AST build flags (e.g., needed to support the math stuff).
43 include ../../../Makefile.ast
45 # 1. Make sure that the -D/-U defines in CFLAGS below are in sync
46 # with usr/src/lib/libshell/Makefile.com
47 # 2. We use "=" here since using $(CPPFLAGS.master) is very tricky in our
48 # case - it MUST come as the last element but future changes in -D options
49 # may then cause silent breakage in the AST sources because the last -D
50 # option specified overrides previous -D options so we prefer the current
51 # way to explicitly list each single flag.
53 $(DTEXTDOM) $(LIBSHELLCPPFLAGS)
60 # Workaround for CR#6628728 ("|memcntl()| prototype not available for C99/XPG6")
61 pmain.o := CERRWARN += -Wno-implicit-function-declaration
65 %.o: $(LIBSHELLSRC)/%.c
66 $(COMPILE.c) -c -o $@ $<
71 # We explicitly delete "ksh" and "ksh93" to catch changes in
72 # BUILD_KSH93_AS_BINKSH (see Makefile.ksh93switch)
73 # and soft-link $(PROG) to ksh/ksh93 below because ksh93 test
74 # suite seems to require that ksh93 is available as "ksh" in
75 # ${PATH} (see comment about "io.sh" in Makefile.testshell).
78 $(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
81 [[ ! -x ksh93 ]] && ln $(PROG) ksh93 ; \
82 [[ ! -x ksh ]] && ln $(PROG) ksh ; \
89 # We explicitly delete "ksh" and "ksh93" to catch changes in
90 # BUILD_KSH93_AS_BINKSH (see Makefile.ksh93switch)
95 # Install rule for $(MACH)/Makefile (32bit)
97 (print "$(POUND_SIGN) Installing 32bit $(PROG) aliases $(USRKSH_ALIAS_LIST)" ; \
98 for i in $(USRKSH_ALIAS_LIST) ; do \
99 [[ "$$i" == "$(PROG)" ]] && continue ; \
100 $(RM) "$(ROOTBIN32)/$$i" ; \
101 $(LN) "$(ROOTBIN32)/$(PROG)" "$(ROOTBIN32)/$$i" ; \
105 # Install rule for $(MACH64)/Makefile (64bit)
106 INSTALL.ksh.64bit=@ \
107 (print "$(POUND_SIGN) Installing 64bit $(PROG) aliases $(USRKSH_ALIAS_LIST)" ; \
108 for i in $(USRKSH_ALIAS_LIST) ; do \
109 [[ "$$i" == "$(PROG)" ]] && continue ; \
110 $(RM) "$(ROOTBIN64)/$$i" ; \
111 $(LN) "$(ROOTBIN64)/$(PROG)" "$(ROOTBIN64)/$$i" ; \
115 include ../Makefile.testshell