Makefile revision 7c2fbfb345896881c631598ee3852ce9ce33fb07
5cd4555ad444fd391002ae32450572054369fd42Rob Austein#
5cd4555ad444fd391002ae32450572054369fd42Rob Austein# CDDL HEADER START
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein#
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# The contents of this file are subject to the terms of the
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews# Common Development and Distribution License (the "License").
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# You may not use this file except in compliance with the License.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson#
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# or http://www.opensolaris.org/os/licensing.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# See the License for the specific language governing permissions
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# and limitations under the License.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews#
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews#
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# CDDL HEADER END
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews#
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson#
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Use is subject to license terms.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein#
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas GustafssonSHELL=/usr/bin/ksh93
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeininclude ../Makefile.cmd
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein.KEEP_STATE:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas Gustafsson# Set common AST build flags (e.g., needed to support the math stuff).
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeininclude ../../Makefile.ast
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinOBJECTS= \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein shcomp.o
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinLIBSHELLMACH=$(MACH)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinLIBSHELLBASE=../../lib/libshell
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinLIBSHELLSRC=$(LIBSHELLBASE)/common/sh
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinSRCS= $(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinGROUP= bin
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinLDLIBS += -lshell -last
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# 1. Make sure that the -D/-U defines in CFLAGS below are in sync
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# with usr/src/lib/libshell/Makefile.com
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# 2. We use "=" here since using $(CPPFLAGS.master) is very tricky in our
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# case - it MUST come as the last element but future changes in -D options
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# may then cause silent breakage in the AST sources because the last -D
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# option specified overrides previous -D options so we prefer the current
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# way to explicitly list each single flag.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCPPFLAGS = \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(DTEXTDOM) $(DTS_ERRNO) \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(LIBSHELLCPPFLAGS)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCFLAGS += \
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson $(ASTCFLAGS)
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCFLAGS64 += \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(ASTCFLAGS64)
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonROOTCMDDIR=$(ROOT)/usr/bin
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinPROG= shcomp
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein%.o: $(LIBSHELLSRC)/%.c
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(COMPILE.c) -c -o $@ $<
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson $(POST_PROCESS_O)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonall: $(PROG)
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# dummy file since AST/ksh/shcomp doesn't use *.po files
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# (and "shcomp" is just a frontend which calls directly into libshell,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# e.g. there are no l10n strings here)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein$(PROG).po:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(RM) $(PROG).po ; \
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson $(TOUCH) $(PROG).po
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssoninstall: all $(ROOTCMD)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein$(PROG): $(OBJECTS)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(RM) shcomp
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(POST_PROCESS)
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinclean lint:
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssoninclude ../Makefile.targ
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein