xref: /titanic_51/usr/src/cmd/ast/shcomp/Makefile (revision b4dd7d09880f14016feece03929a224eca1cf39a)
1*b4dd7d09SAndy Fiddaman#
2*b4dd7d09SAndy Fiddaman# CDDL HEADER START
3*b4dd7d09SAndy Fiddaman#
4*b4dd7d09SAndy Fiddaman# The contents of this file are subject to the terms of the
5*b4dd7d09SAndy Fiddaman# Common Development and Distribution License (the "License").
6*b4dd7d09SAndy Fiddaman# You may not use this file except in compliance with the License.
7*b4dd7d09SAndy Fiddaman#
8*b4dd7d09SAndy Fiddaman# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*b4dd7d09SAndy Fiddaman# or http://www.opensolaris.org/os/licensing.
10*b4dd7d09SAndy Fiddaman# See the License for the specific language governing permissions
11*b4dd7d09SAndy Fiddaman# and limitations under the License.
12*b4dd7d09SAndy Fiddaman#
13*b4dd7d09SAndy Fiddaman# When distributing Covered Code, include this CDDL HEADER in each
14*b4dd7d09SAndy Fiddaman# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*b4dd7d09SAndy Fiddaman# If applicable, add the following below this CDDL HEADER, with the
16*b4dd7d09SAndy Fiddaman# fields enclosed by brackets "[]" replaced with your own identifying
17*b4dd7d09SAndy Fiddaman# information: Portions Copyright [yyyy] [name of copyright owner]
18*b4dd7d09SAndy Fiddaman#
19*b4dd7d09SAndy Fiddaman# CDDL HEADER END
20*b4dd7d09SAndy Fiddaman#
21*b4dd7d09SAndy Fiddaman
22*b4dd7d09SAndy Fiddaman#
23*b4dd7d09SAndy Fiddaman# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24*b4dd7d09SAndy Fiddaman# Use is subject to license terms.
25*b4dd7d09SAndy Fiddaman#
26*b4dd7d09SAndy Fiddaman# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
27*b4dd7d09SAndy Fiddaman
28*b4dd7d09SAndy FiddamanSHELL= /usr/bin/ksh93
29*b4dd7d09SAndy Fiddaman
30*b4dd7d09SAndy Fiddamaninclude ../../Makefile.cmd
31*b4dd7d09SAndy Fiddaman$(SPARC_BLD)include ../../Makefile.cmd.64
32*b4dd7d09SAndy Fiddaman
33*b4dd7d09SAndy Fiddaman.KEEP_STATE:
34*b4dd7d09SAndy Fiddaman
35*b4dd7d09SAndy Fiddaman# Set common AST build flags (e.g., needed to support the math stuff).
36*b4dd7d09SAndy Fiddamaninclude ../Makefile.ast
37*b4dd7d09SAndy Fiddaman
38*b4dd7d09SAndy FiddamanOBJECTS= shcomp.o
39*b4dd7d09SAndy Fiddaman
40*b4dd7d09SAndy FiddamanASTSRC= $(C_AST)/src/cmd/ksh93
41*b4dd7d09SAndy FiddamanLIBSHELLMACH= $(MACH)
42*b4dd7d09SAndy FiddamanLIBSHELLBASE= ../libshell
43*b4dd7d09SAndy FiddamanLIBSHELLSRC= $(ASTSRC)/sh
44*b4dd7d09SAndy Fiddaman
45*b4dd7d09SAndy FiddamanSRCS=	$(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
46*b4dd7d09SAndy Fiddaman
47*b4dd7d09SAndy FiddamanLDLIBS += -lshell -last
48*b4dd7d09SAndy Fiddaman
49*b4dd7d09SAndy Fiddaman# We use "=" here since using $(CPPFLAGS.master) is very tricky in our
50*b4dd7d09SAndy Fiddaman# case - it MUST come as the last element but future changes in -D options
51*b4dd7d09SAndy Fiddaman# may then cause silent breakage in the AST sources because the last -D
52*b4dd7d09SAndy Fiddaman# option specified overrides previous -D options so we prefer the current
53*b4dd7d09SAndy Fiddaman# way to explicitly list each single flag.
54*b4dd7d09SAndy FiddamanCPPFLAGS= \
55*b4dd7d09SAndy Fiddaman	$(DTEXTDOM) $(DTS_ERRNO) \
56*b4dd7d09SAndy Fiddaman	$(LIBSHELLCPPFLAGS)
57*b4dd7d09SAndy Fiddaman
58*b4dd7d09SAndy FiddamanCFLAGS += $(ASTCFLAGS)
59*b4dd7d09SAndy FiddamanCFLAGS64 += $(ASTCFLAGS64)
60*b4dd7d09SAndy Fiddaman
61*b4dd7d09SAndy FiddamanCERRWARN +=	-_gcc=-Wno-parentheses
62*b4dd7d09SAndy Fiddaman
63*b4dd7d09SAndy FiddamanROOTCMDDIR=$(ROOT)/usr/bin
64*b4dd7d09SAndy Fiddaman
65*b4dd7d09SAndy FiddamanPROG= shcomp
66*b4dd7d09SAndy Fiddaman
67*b4dd7d09SAndy Fiddaman%.o:    $(LIBSHELLSRC)/%.c
68*b4dd7d09SAndy Fiddaman	$(COMPILE.c) -c -o $@ $<
69*b4dd7d09SAndy Fiddaman	$(POST_PROCESS_O)
70*b4dd7d09SAndy Fiddaman
71*b4dd7d09SAndy Fiddamanall: $(PROG)
72*b4dd7d09SAndy Fiddaman
73*b4dd7d09SAndy Fiddaman# dummy file since AST/ksh/shcomp doesn't use *.po files
74*b4dd7d09SAndy Fiddaman# (and "shcomp" is just a frontend which calls directly into libshell,
75*b4dd7d09SAndy Fiddaman# i.e. there are no l10n strings here)
76*b4dd7d09SAndy Fiddaman$(PROG).po:
77*b4dd7d09SAndy Fiddaman	$(RM) $(PROG).po ; \
78*b4dd7d09SAndy Fiddaman	$(TOUCH) $(PROG).po
79*b4dd7d09SAndy Fiddaman
80*b4dd7d09SAndy Fiddamaninstall: all $(ROOTCMD)
81*b4dd7d09SAndy Fiddamaninstall_h _feature:
82*b4dd7d09SAndy Fiddaman
83*b4dd7d09SAndy Fiddaman$(PROG):	$(OBJECTS)
84*b4dd7d09SAndy Fiddaman	$(RM) shcomp
85*b4dd7d09SAndy Fiddaman	$(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
86*b4dd7d09SAndy Fiddaman	$(POST_PROCESS)
87*b4dd7d09SAndy Fiddaman
88*b4dd7d09SAndy Fiddamanclean:
89*b4dd7d09SAndy Fiddaman	$(RM) $(OBJECTS)
90*b4dd7d09SAndy Fiddaman
91*b4dd7d09SAndy Fiddamaninclude ../../Makefile.targ
92