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