xref: /titanic_52/usr/src/cmd/ast/libpp/Makefile.com (revision 906afcb89d0412cc073b95c2d701a804a8cdb62c)
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 2021 OmniOS Community Edition (OmniOSce) Association.
26
27SHELL= /usr/bin/ksh93
28
29LIBRARY= libpp.a
30VERS= .1
31
32include ../Makefile.defs
33
34OBJECTS += $(LIBOBJS)
35
36include $(SRC)/lib/Makefile.lib
37include ../../Makefile.ast
38
39MAPFILES=       ../mapfile-vers
40
41LIBS=		$(DYNLIB)
42
43LDLIBS += -last -lc
44
45# We use "=" here since using $(CPPFLAGS.master) is very tricky in our
46# case - it MUST come as the last element but future changes in -D options
47# may then cause silent breakage in the AST sources because the last -D
48# option specified overrides previous -D options so we prefer the current
49# way to explicitly list each single flag.
50CPPFLAGS= \
51	$(DTEXTDOM) $(DTS_ERRNO) \
52	-I. \
53	-I$(ROOT)/usr/include/ast \
54	-I$(ROOT)/usr/include \
55	-D_PACKAGE_ast \
56	'-DUSAGE_LICENSE=\
57	    "[-author?Glenn Fowler <gsf@research.att.com>]"\
58	    "[-copyright?Copyright (c) 1986-2012 AT&T Intellectual Property]"\
59	    "[-license?http://www.eclipse.org/org/documents/epl-v10.html]"\
60	    "[--catalog?libpp]"'
61
62CFLAGS += $(ASTCFLAGS)
63CFLAGS64 += $(ASTCFLAGS64)
64
65CERRWARN	+= -_gcc=-Wno-parentheses
66CERRWARN	+= -_gcc=-Wno-uninitialized
67CERRWARN	+= -_gcc=-Wno-char-subscripts
68CERRWARN	+= -_gcc=-Wno-empty-body
69CERRWARN	+= -_gcc=-Wno-unused-value
70
71all: $(LIBS)
72
73#
74# libpp is not lint-clean yet; fake up a target.  (You can use
75# "make lintcheck" to actually run lint; please send all lint fixes
76# upstream (to AT&T) so the next update will pull them into ON.)
77#
78lint:
79	@ print "usr/src/lib/libpp is not lint-clean: skipping"
80
81include $(SRC)/lib/Makefile.targ
82
83ppdef.h: $(ASTSRC)/pp.tab
84	$(AST_TOOLS)/gentab -d $(ASTSRC)/pp.tab > $@
85
86pptab.h: $(ASTSRC)/pp.tab
87	$(AST_TOOLS)/gentab -t $(ASTSRC)/pp.tab > $@
88
89pics/%.o: $(ASTSRC)/%.c ppdef.h pptab.h
90	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
91	$(POST_PROCESS_O)
92
93CLOBBERFILES += pptab.h ppdef.h
94
95include ../../Makefile.astmsg
96