Makefile.com revision 7c2fbfb345896881c631598ee3852ce9ce33fb07
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# CDDL HEADER START
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# The contents of this file are subject to the terms of the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Common Development and Distribution License (the "License").
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# You may not use this file except in compliance with the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# or http://www.opensolaris.org/os/licensing.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# See the License for the specific language governing permissions
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# and limitations under the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# When distributing Covered Code, include this CDDL HEADER in each
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# If applicable, add the following below this CDDL HEADER, with the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# fields enclosed by brackets "[]" replaced with your own identifying
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# information: Portions Copyright [yyyy] [name of copyright owner]
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# CDDL HEADER END
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Use is subject to license terms.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinSHELL=/usr/bin/ksh93
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chininclude ../../../Makefile.ksh93switch
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin$(BINKSH_IS_KSH93)PROG= ksh
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin$(BINKSH_IS_KSH93)USRKSH_ALIAS_LIST=ksh ksh93 rksh rksh93 pfksh pfksh93 pfrksh pfrksh93
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin$(BINKSH_ISNOT_KSH93)PROG= ksh93
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin$(BINKSH_ISNOT_KSH93)USRKSH_ALIAS_LIST=ksh93 rksh93
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinOBJECTS= \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin pmain.o
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinLIBSHELLBASE=../../../lib/libshell
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinLIBSHELLSRC=$(LIBSHELLBASE)/common/sh
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinSRCS= $(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinGROUP= bin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinLDLIBS += -lshell
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# Set common AST build flags (e.g., needed to support the math stuff).
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chininclude ../../../Makefile.ast
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# 1. Make sure that the -D/-U defines in CFLAGS below are in sync
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# with usr/src/lib/libshell/Makefile.com
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# 2. We use "=" here since using $(CPPFLAGS.master) is very tricky in our
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# case - it MUST come as the last element but future changes in -D options
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# may then cause silent breakage in the AST sources because the last -D
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# option specified overrides previous -D options so we prefer the current
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# way to explicitly list each single flag.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinCPPFLAGS = \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(DTEXTDOM) $(DTS_ERRNO) \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(LIBSHELLCPPFLAGS)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinCFLAGS += \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin $(ASTCFLAGS)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinCFLAGS64 += \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin $(ASTCFLAGS64)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# Workaround for CR#6628728 ("|memcntl()| prototype not available for C99/XPG6")
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinpmain.o := CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.KEEP_STATE:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin%.o: $(LIBSHELLSRC)/%.c
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(COMPILE.c) -c -o $@ $<
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(POST_PROCESS_O)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinall: $(PROG)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# We explicitly delete "ksh" and "ksh93" to catch changes in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# BUILD_KSH93_AS_BINKSH (see Makefile.ksh93switch)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# and soft-link $(PROG) to ksh/ksh93 below because ksh93 test
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# suite seems to require that ksh93 is available as "ksh" in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# ${PATH} (see comment about "io.sh" in Makefile.testshell).
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin$(PROG): $(OBJECTS)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(RM) ksh ksh93
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(POST_PROCESS)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin (set +o errexit ; \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin [[ ! -x ksh93 ]] && ln $(PROG) ksh93 ; \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin [[ ! -x ksh ]] && ln $(PROG) ksh ; \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin true \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin )
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinclean:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(RM) $(OBJECTS)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# We explicitly delete "ksh" and "ksh93" to catch changes in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# BUILD_KSH93_AS_BINKSH (see Makefile.ksh93switch)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinCLOBBERFILES += \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ksh \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ksh93
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# Install rule for $(MACH)/Makefile (32bit)
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinINSTALL.ksh.32bit=@ \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin (print "$(POUND_SIGN) Installing 32bit $(PROG) aliases $(USRKSH_ALIAS_LIST)" ; \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin set -o xtrace ; \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin for i in $(USRKSH_ALIAS_LIST) ; do \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin [[ "$$i" == "$(PROG)" ]] && continue ; \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin $(RM) "$(ROOTBIN32)/$$i" ; \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin $(LN) "$(ROOTBIN32)/$(PROG)" "$(ROOTBIN32)/$$i" ; \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin done \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin )
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# Install rule for $(MACH64)/Makefile (64bit)
7c2fbfb345896881c631598ee3852ce9ce33fb07April ChinINSTALL.ksh.64bit=@ \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin (print "$(POUND_SIGN) Installing 64bit $(PROG) aliases $(USRKSH_ALIAS_LIST)" ; \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin set -o xtrace ; \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin for i in $(USRKSH_ALIAS_LIST) ; do \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin [[ "$$i" == "$(PROG)" ]] && continue ; \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin $(RM) "$(ROOTBIN64)/$$i" ; \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin $(LN) "$(ROOTBIN64)/$(PROG)" "$(ROOTBIN64)/$$i" ; \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin done \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin )
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# ksh is not lint-clean yet; fake up a target. (You can use
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# "make lintcheck" to actually run lint; please send all lint fixes
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# upstream (to AT&T) so the next update will pull them into ON.)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinlint:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin @ print "usr/src/cmd/ksh is not lint-clean: skipping"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chininclude ../Makefile.testshell