xref: /titanic_41/usr/src/cmd/oawk/Makefile (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate# with the License.
87c478bd9Sstevel@tonic-gate#
97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate# and limitations under the License.
137c478bd9Sstevel@tonic-gate#
147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate#
207c478bd9Sstevel@tonic-gate# CDDL HEADER END
217c478bd9Sstevel@tonic-gate#
227c478bd9Sstevel@tonic-gate#
237c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate# Use is subject to license terms.
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateinclude		../Makefile.cmd
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gatePROG =		oawk
307c478bd9Sstevel@tonic-gateLINKPROG =	awk
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gateSRCS =		b.c lib.c main.c parse.c run.c tran.c
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gate#TXTS =		README EXPLAIN
357c478bd9Sstevel@tonic-gate
367c478bd9Sstevel@tonic-gateOBJS =		awk.g.o awk.lx.o proctab.o tmptoken.o		\
377c478bd9Sstevel@tonic-gate		$(SRCS:%.c=%.o)
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gate#
407c478bd9Sstevel@tonic-gate# for message catalogue
417c478bd9Sstevel@tonic-gate#
427c478bd9Sstevel@tonic-gatePOFILES=        $(OBJS:%.o=%.po)
437c478bd9Sstevel@tonic-gatePOFILE=         oawk.po
447c478bd9Sstevel@tonic-gateXGETFLAGS +=    -a -x oawk.xcl
457c478bd9Sstevel@tonic-gate
467c478bd9Sstevel@tonic-gateNATIVEDIR =	native
477c478bd9Sstevel@tonic-gateMAKEPRCTAB =	$(NATIVEDIR)/makeprctab
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gateNATIVEOBJS =	$(NATIVEDIR)/makeprctab.o $(NATIVEDIR)/tmptoken.o
507c478bd9Sstevel@tonic-gate$(MAKEPRCTAB) :=	CC = $(NATIVECC)
517c478bd9Sstevel@tonic-gate$(MAKEPRCTAB) :=	POST_PROCESS=
527c478bd9Sstevel@tonic-gate$(MAKEPRCTAB) :=	POST_PROCESS_O=
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gateCLEANFILES =	proctab.c y.tab.h y.tab.c awk.h awk.g.c		\
557c478bd9Sstevel@tonic-gate		tmptoken.c awk.lx.c $(NATIVEOBJS) $(MAKEPRCTAB)	\
567c478bd9Sstevel@tonic-gate		temp
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gateYFLAGS =	-d
597c478bd9Sstevel@tonic-gateXLDLIBS5CC +=	-lm
607c478bd9Sstevel@tonic-gateLDLIBS +=	-lm
617c478bd9Sstevel@tonic-gateCPPFLAGS =      -I. $(CPPFLAGS.master)
627c478bd9Sstevel@tonic-gateCPPFLAGS +=	-D_FILE_OFFSET_BITS=64
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gateROOTLINK =	$(LINKPROG:%=$(ROOTBIN)/%)
657c478bd9Sstevel@tonic-gate
66*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-implicit-function-declaration
67*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-label
68*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-variable
69*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-extra
70*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
71*7014882cSRichard Lowe
727c478bd9Sstevel@tonic-gate.KEEP_STATE :
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gateall :		$(PROG) $(TXTS)
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gate$(PROG) :	$(OBJS)
777c478bd9Sstevel@tonic-gate		$(LINK.c) $(OBJS)  -o $@  $(LDLIBS)
787c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gate$(POFILE):      $(POFILES)
817c478bd9Sstevel@tonic-gate		$(RM)	$@
827c478bd9Sstevel@tonic-gate		$(CAT) 	$(POFILES)      > $@
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gateawk.g.c + awk.h :	awk.g.y
857c478bd9Sstevel@tonic-gate		$(RM) awk.g.c awk.h
867c478bd9Sstevel@tonic-gate		$(YACC.y) awk.g.y
877c478bd9Sstevel@tonic-gate		$(MV) y.tab.c awk.g.c
887c478bd9Sstevel@tonic-gate		$(MV) y.tab.h awk.h
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gateawk.lx.c:	awk.lx.l
917c478bd9Sstevel@tonic-gate		$(LEX.l) -w awk.lx.l > awk.lx.c
927c478bd9Sstevel@tonic-gate
937c478bd9Sstevel@tonic-gatetmptoken.c :	tokenscript token.c
947c478bd9Sstevel@tonic-gate		$(RM) $@
957c478bd9Sstevel@tonic-gate		ed - < tokenscript
967c478bd9Sstevel@tonic-gate
977c478bd9Sstevel@tonic-gateproctab.c :	$(MAKEPRCTAB)
987c478bd9Sstevel@tonic-gate		$(RM) $@
997c478bd9Sstevel@tonic-gate		$(MAKEPRCTAB) > $@
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gate$(MAKEPRCTAB) :	$(NATIVEDIR) $(NATIVEOBJS)
1027c478bd9Sstevel@tonic-gate		$(LINK.c) $(NATIVEOBJS) -o $@ $(XLDLIBS5CC)
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gateinstall : 	all $(ROOTPROG) $(ROOTLINK)
1057c478bd9Sstevel@tonic-gate
1067c478bd9Sstevel@tonic-gate$(NATIVEDIR) :
1077c478bd9Sstevel@tonic-gate		-@mkdir -p $(NATIVEDIR)
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gate$(NATIVEDIR)/%.o :	%.c
1107c478bd9Sstevel@tonic-gate		$(COMPILE.c) -o $@ $<
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gate$(ROOTLINK) :	$(ROOTPROG)
1137c478bd9Sstevel@tonic-gate		$(RM) $@; $(LN) $(ROOTPROG) $@
1147c478bd9Sstevel@tonic-gate
1157c478bd9Sstevel@tonic-gateclean:
1167c478bd9Sstevel@tonic-gate		$(RM) $(OBJS) $(CLEANFILES)
1177c478bd9Sstevel@tonic-gate
1187c478bd9Sstevel@tonic-gatelint :		lint_SRCS
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gatestrip:
1217c478bd9Sstevel@tonic-gate		$(STRIP) $(PROG)
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gateinclude		../Makefile.targ
124