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, Version 1.0 only
   6 # (the "License").  You may not use this file except in compliance
   7 # with the License.
   8 #
   9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 
  23 #
  24 # Copyright 1989,2003 Sun Microsystems, Inc.  All rights reserved.
  25 # Use is subject to license terms.
  26 #
  27 # cmd/tnf/prex/Makefile.com
  28 #
  29 
  30 PROG=           prex
  31 
  32 OBJS.c=         source.o        \
  33                 main.o          \
  34                 util.o          \
  35                 expr.o          \
  36                 spec.o          \
  37                 set.o           \
  38                 queue.o         \
  39                 cmd.o           \
  40                 new.o           \
  41                 list.o          \
  42                 fcn.o           \
  43                 prbk.o          \
  44                 help.o
  45 
  46 OBJS.yl=        prexgram.o      \
  47                 prexlex.o
  48 
  49 OBJS=            $(OBJS.yl) $(OBJS.c)
  50 
  51 SRCS= $(OBJS.c:%.o=../%.c) $(OBJS.yl:%.o=%.c)
  52 
  53 SRCS.yl = $(OBJS.yl:%.o=%.c)
  54 CLEANFILES = $(SRCS.yl)  y.tab.h
  55 
  56 include ../../../Makefile.cmd
  57 
  58 POFILE= prex.po
  59 POFILES= $(OBJS.c:%.o=%.po)
  60 
  61 #YFLAGS=        -d -t -v
  62 YFLAGS=         -d
  63 LFLAGS=         -v
  64 # FOR normal makefile, uncomment the next line
  65 LDLIBS +=       -lgen -ltnfctl -lelf -lc
  66 # Uncomment the following line for a debug build
  67 # COPTFLAG =    -g -DDEBUG
  68 
  69 CFLAGS +=       $(CCVERBOSE)
  70 CERRWARN +=     -_gcc=-Wno-unused-label
  71 CERRWARN +=     -_gcc=-Wno-unused-variable
  72 CERRWARN +=     -_gcc=-Wno-parentheses
  73 CERRWARN +=     -_gcc=-Wno-uninitialized
  74 
  75 .KEEP_STATE:
  76 
  77 .PARALLEL: $(OBJS)
  78 
  79 all: $(PROG)
  80 
  81 #OBJS can be built in parallel after all .c (and y.tab.h) are properly built
  82 $(PROG): $(SRCS.yl) .WAIT $(OBJS)
  83         $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
  84         $(POST_PROCESS)
  85 
  86 #This also builds y.tab.h
  87 prexgram.c: ../prexgram.y
  88         $(YACC.y) ../prexgram.y
  89         mv y.tab.c $@
  90 
  91 prexlex.c: ../prexlex.l
  92         $(RM) $@
  93         $(LEX.l) ../prexlex.l > $@
  94 
  95 #Use %.c in priority to ../%.c for prexgram.c and prexlec.c
  96 %.o:    %.c
  97         $(COMPILE.c) $<
  98 
  99 %.o:    ../%.c
 100         $(COMPILE.c) $<
 101 
 102 
 103 $(ROOTBIN):
 104         $(INS.dir)
 105 
 106 $(POFILE):      $(POFILES)
 107         $(RM)   $@
 108         cat     $(POFILES)      > $@
 109 
 110 clean:
 111         $(RM) $(OBJS) $(CLEANFILES)
 112 
 113 lint: $(OBJS) 
 114         $(LINT.c) $(SRCS)
 115 
 116 include ../../../Makefile.targ