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#ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 1989,2003 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# cmd/tnf/prex/Makefile.com
29#
30
31PROG=		prex
32
33OBJS.c=		source.o	\
34		main.o		\
35		util.o		\
36		expr.o		\
37		spec.o		\
38		set.o		\
39		queue.o		\
40		cmd.o		\
41		new.o		\
42		list.o		\
43		fcn.o		\
44		prbk.o		\
45		help.o
46
47OBJS.yl=	prexgram.o	\
48		prexlex.o
49
50OBJS=		 $(OBJS.yl) $(OBJS.c)
51
52SRCS= $(OBJS.c:%.o=../%.c) $(OBJS.yl:%.o=%.c)
53
54SRCS.yl = $(OBJS.yl:%.o=%.c)
55CLEANFILES = $(SRCS.yl)  y.tab.h
56
57include	../../../Makefile.cmd
58
59POFILE= prex.po
60POFILES= $(OBJS.c:%.o=%.po)
61
62#YFLAGS=	-d -t -v
63YFLAGS=		-d
64LFLAGS=		-v
65# FOR normal makefile, uncomment the next line
66LDLIBS +=	-lgen -ltnfctl -lelf -lc
67# Uncomment the following line for a debug build
68# COPTFLAG =	-g -DDEBUG -v
69
70.KEEP_STATE:
71
72.PARALLEL: $(OBJS)
73
74all: $(PROG)
75
76#OBJS can be built in parallel after all .c (and y.tab.h) are properly built
77$(PROG): $(SRCS.yl) .WAIT $(OBJS)
78	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
79	$(POST_PROCESS)
80
81#This also builds y.tab.h
82prexgram.c: ../prexgram.y
83	$(YACC.y) ../prexgram.y
84	mv y.tab.c $@
85
86prexlex.c: ../prexlex.l
87	$(RM) $@
88	$(LEX.l) ../prexlex.l > $@
89
90#Use %.c in priority to ../%.c for prexgram.c and prexlec.c
91%.o:	%.c
92	$(COMPILE.c) $<
93
94%.o:	../%.c
95	$(COMPILE.c) $<
96
97
98$(ROOTBIN):
99	$(INS.dir)
100
101$(POFILE):      $(POFILES)
102	$(RM)	$@
103	cat     $(POFILES)      > $@
104
105clean:
106	$(RM) $(OBJS) $(CLEANFILES)
107
108lint: $(OBJS) 
109	$(LINT.c) $(SRCS)
110
111include	../../../Makefile.targ
112