xref: /illumos-gate/usr/src/cmd/ast/shcomp/Makefile (revision 2a8bcb4efb45d99ac41c94a75c396b362c414f7f)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# Copyright (c) 2018, Joyent, Inc.
27# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
28
29SHELL= /usr/bin/ksh93
30
31include ../../Makefile.cmd
32$(SPARC_BLD)include ../../Makefile.cmd.64
33
34.KEEP_STATE:
35
36# Set common AST build flags (e.g., needed to support the math stuff).
37include ../Makefile.ast
38
39OBJECTS= shcomp.o
40
41ASTSRC= $(C_AST)/src/cmd/ksh93
42LIBSHELLMACH= $(MACH)
43LIBSHELLBASE= ../libshell
44LIBSHELLSRC= $(ASTSRC)/sh
45
46SRCS=	$(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
47
48LDLIBS += -lshell -last
49
50# We use "=" here since using $(CPPFLAGS.master) is very tricky in our
51# case - it MUST come as the last element but future changes in -D options
52# may then cause silent breakage in the AST sources because the last -D
53# option specified overrides previous -D options so we prefer the current
54# way to explicitly list each single flag.
55CPPFLAGS= \
56	$(DTEXTDOM) $(DTS_ERRNO) \
57	$(LIBSHELLCPPFLAGS)
58
59CFLAGS += $(ASTCFLAGS)
60CFLAGS64 += $(ASTCFLAGS64)
61
62CERRWARN +=	-_gcc=-Wno-parentheses
63
64SMOFF +=	all_func_returns
65
66ROOTCMDDIR=$(ROOT)/usr/bin
67
68PROG= shcomp
69
70%.o:    $(LIBSHELLSRC)/%.c
71	$(COMPILE.c) -c -o $@ $<
72	$(POST_PROCESS_O)
73
74all: $(PROG)
75
76# dummy file since AST/ksh/shcomp doesn't use *.po files
77# (and "shcomp" is just a frontend which calls directly into libshell,
78# i.e. there are no l10n strings here)
79$(PROG).po:
80	$(RM) $(PROG).po ; \
81	$(TOUCH) $(PROG).po
82
83install: all $(ROOTCMD)
84install_h _feature:
85
86$(PROG):	$(OBJECTS)
87	$(RM) shcomp
88	$(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
89	$(POST_PROCESS)
90
91clean:
92	$(RM) $(OBJECTS)
93
94include ../../Makefile.targ
95