xref: /illumos-gate/usr/src/cmd/sgs/yacc/Makefile.com (revision 915894ef19890baaed00080f85f6b69e225cda98)
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 2015 Gary Mills
23# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# Copyright (c) 2018, Joyent, Inc.
27# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
28#
29
30PROG=		yacc
31
32COMOBJS=	y1.o y2.o y3.o y4.o
33POBJECTS=	$(COMOBJS)
34POBJS=		$(POBJECTS:%=objs/%)
35
36OBJECTS=	libmai.o libzer.o
37
38LIBRARY=	liby.a
39VERS=		.1
40YACCPAR=	yaccpar
41
42include ../../../../lib/Makefile.lib
43
44COMPATLINKS=	usr/ccs/lib/liby.so
45COMPATLINKS64=	usr/ccs/lib/$(MACH64)/liby.so
46
47$(ROOT)/usr/ccs/lib/liby.so := COMPATLINKTARGET=../../lib/liby.so.1
48$(ROOT)/usr/ccs/lib/$(MACH64)/liby.so:= \
49	COMPATLINKTARGET=../../../lib/$(MACH64)/liby.so.1
50
51SRCDIR =	../common
52
53# Override default source file derivation rule (in Makefile.lib)
54# from objects
55#
56COMSRCS=	$(COMOBJS:%.o=../common/%.c)
57LIBSRCS=	$(OBJECTS:%.o=../common/%.c)
58SRCS=		$(COMSRCS) $(LIBSRCS)
59
60LIBS =          $(DYNLIB)
61
62# Tune ZDEFS to ignore undefined symbols for building the yacc shared library
63# since these symbols (mainly yyparse) are to be resolved elsewhere.
64#
65$(DYNLIB):= ZDEFS = $(ZNODEFS)
66$(DYNLIBCCC):= ZDEFS = $(ZNODEFS)
67
68INCLIST=	-I../../include -I../../include/$(MACH)
69CPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
70$(PROG):=	LDLIBS = $(LDLIBS.cmd)
71
72CSTD= $(CSTD_GNU99)
73CFLAGS += $(CCVERBOSE)
74CFLAGS64 += $(CCVERBOSE)
75CERRWARN += -_gcc=-Wno-parentheses
76CERRWARN += $(CNOWARN_UNINIT)
77
78# not linted
79SMATCH=off
80
81$(ROOTPROG):= FILEMODE = 0555
82
83ROOTYACCPAR=	$(YACCPAR:%=$(ROOTSHLIBCCS)/%)
84
85DYNLINKLIBDIR=	$(ROOTLIBDIR)
86DYNLINKLIB=	$(LIBLINKS:%=$(DYNLINKLIBDIR)/%)
87
88LDLIBS += -lc
89
90CLOBBERFILES +=	$(LIBS) $(LIBRARY)
91