xref: /illumos-gate/usr/src/cmd/ast/libpp/Makefile.com (revision 475b46fe)
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# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# Copyright (c) 2019, Joyent, Inc.
26# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
27
28SHELL= /usr/bin/ksh93
29
30LIBRARY= libpp.a
31VERS= .1
32
33include ../Makefile.defs
34
35OBJECTS += $(LIBOBJS)
36
37include $(SRC)/lib/Makefile.lib
38include ../../Makefile.ast
39
40MAPFILES=       ../mapfile-vers
41
42LIBS=		$(DYNLIB)
43
44LDLIBS += -last -lc
45
46# We use "=" here since using $(CPPFLAGS.master) is very tricky in our
47# case - it MUST come as the last element but future changes in -D options
48# may then cause silent breakage in the AST sources because the last -D
49# option specified overrides previous -D options so we prefer the current
50# way to explicitly list each single flag.
51CPPFLAGS= \
52	$(DTEXTDOM) $(DTS_ERRNO) \
53	-I. \
54	-I$(ROOT)/usr/include/ast \
55	-I$(ROOT)/usr/include \
56	-D_PACKAGE_ast \
57	'-DUSAGE_LICENSE=\
58	    "[-author?Glenn Fowler <gsf@research.att.com>]"\
59	    "[-copyright?Copyright (c) 1986-2012 AT&T Intellectual Property]"\
60	    "[-license?http://www.eclipse.org/org/documents/epl-v10.html]"\
61	    "[--catalog?libpp]"'
62
63CFLAGS += $(ASTCFLAGS)
64CFLAGS64 += $(ASTCFLAGS64)
65
66CERRWARN	+= -_gcc=-Wno-parentheses
67CERRWARN	+= $(CNOWARN_UNINIT)
68CERRWARN	+= -_gcc=-Wno-char-subscripts
69CERRWARN	+= -_gcc=-Wno-empty-body
70CERRWARN	+= -_gcc=-Wno-unused-value
71
72# "pplex() parse error: turning off implications after 60 seconds"
73SMATCH		= off
74
75.KEEP_STATE:
76
77all: $(LIBS)
78
79include $(SRC)/lib/Makefile.targ
80
81ppdef.h: $(ASTSRC)/pp.tab
82	$(AST_TOOLS)/gentab -d $(ASTSRC)/pp.tab > $@
83
84pptab.h: $(ASTSRC)/pp.tab
85	$(AST_TOOLS)/gentab -t $(ASTSRC)/pp.tab > $@
86
87pics/%.o: $(ASTSRC)/%.c ppdef.h pptab.h
88	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
89	$(POST_PROCESS_O)
90
91CLOBBERFILES += pptab.h ppdef.h
92
93include ../../Makefile.astmsg
94