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 
  30 PROG=           yacc
  31 
  32 COMOBJS=        y1.o y2.o y3.o y4.o
  33 POBJECTS=       $(COMOBJS)
  34 POBJS=          $(POBJECTS:%=objs/%)
  35 
  36 OBJECTS=        libmai.o libzer.o
  37 
  38 LIBRARY=        liby.a
  39 VERS=           .1
  40 YACCPAR=        yaccpar
  41 
  42 include ../../../../lib/Makefile.lib
  43 
  44 COMPATLINKS=    /usr/ccs/lib/liby.so \
  45                 /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 
  51 SRCDIR =        ../common
  52 
  53 # Override default source file derivation rule (in Makefile.lib)
  54 # from objects
  55 #
  56 COMSRCS=        $(COMOBJS:%.o=../common/%.c)
  57 LIBSRCS=        $(OBJECTS:%.o=../common/%.c)
  58 SRCS=           $(COMSRCS) $(LIBSRCS)
  59 
  60 LIBS =          $(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 
  68 INCLIST=        -I../../include -I../../include/$(MACH)
  69 CPPFLAGS=       $(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
  70 $(PROG):=       LDLIBS = $(LDLIBS.cmd)
  71 BUILD.AR=       $(AR) $(ARFLAGS) $@ `$(LORDER) $(OBJS) | $(TSORT)`
  72 
  73 CSTD= $(CSTD_GNU99)
  74 CFLAGS += $(CCVERBOSE)
  75 CFLAGS64 += $(CCVERBOSE)
  76 CERRWARN += -_gcc=-Wno-parentheses
  77 CERRWARN += -_gcc=-Wno-uninitialized
  78 
  79 # not linted
  80 SMATCH=off
  81 
  82 $(ROOTPROG):= FILEMODE = 0555
  83 
  84 ROOTYACCPAR=    $(YACCPAR:%=$(ROOTSHLIBCCS)/%)
  85 
  86 DYNLINKLIBDIR=  $(ROOTLIBDIR)
  87 DYNLINKLIB=     $(LIBLINKS:%=$(DYNLINKLIBDIR)/%)
  88 
  89 LDLIBS += -lc
  90 
  91 CLOBBERFILES += $(LIBS) $(LIBRARY)