xref: /onnv-gate/usr/src/cmd/sgs/lex/Makefile.com (revision 6951:59445bec7ef4)
10Sstevel@tonic-gate#
20Sstevel@tonic-gate# CDDL HEADER START
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# The contents of this file are subject to the terms of the
52522Sraf# Common Development and Distribution License (the "License").
62522Sraf# You may not use this file except in compliance with the License.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate# See the License for the specific language governing permissions
110Sstevel@tonic-gate# and limitations under the License.
120Sstevel@tonic-gate#
130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate#
190Sstevel@tonic-gate# CDDL HEADER END
200Sstevel@tonic-gate#
210Sstevel@tonic-gate#
22*6951Sab196087# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate# Use is subject to license terms.
240Sstevel@tonic-gate#
250Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
260Sstevel@tonic-gate#
270Sstevel@tonic-gate
28*6951Sab196087PROG=		lex
29*6951Sab196087
300Sstevel@tonic-gateMACHOBJS=	main.o sub1.o sub2.o sub3.o header.o parser.o
314538SdamicoPOBJECTS=	$(MACHOBJS)
320Sstevel@tonic-gatePOBJS=		$(POBJECTS:%=objs/%)
330Sstevel@tonic-gate
340Sstevel@tonic-gateLIBRARY=	libl.a
350Sstevel@tonic-gateVERS=		.1
360Sstevel@tonic-gate
370Sstevel@tonic-gateLIBOBJS=	allprint.o libmain.o reject.o yyless.o yywrap.o
380Sstevel@tonic-gateLIBOBJS_W=	allprint_w.o reject_w.o yyless_w.o
390Sstevel@tonic-gateLIBOBJS_E=	reject_e.o yyless_e.o
400Sstevel@tonic-gateOBJECTS=	$(LIBOBJS) $(LIBOBJS_W) $(LIBOBJS_E)
410Sstevel@tonic-gate
420Sstevel@tonic-gateFORMS=		nceucform ncform nrform
430Sstevel@tonic-gate
442522Srafinclude 	../../../../lib/Makefile.lib
450Sstevel@tonic-gate
462522SrafSRCDIR =	../common
470Sstevel@tonic-gate
480Sstevel@tonic-gateC99MODE=	$(C99_ENABLE)
490Sstevel@tonic-gate
500Sstevel@tonic-gate# Override default source file derivation rule (in Makefile.lib)
510Sstevel@tonic-gate# from objects
520Sstevel@tonic-gate#
53*6951Sab196087MACHSRCS=	$(MACHOBJS:%.o=../common/%.c)
54*6951Sab196087LIBSRCS =	$(LIBOBJS:%.o=../common/%.c)
55*6951Sab196087SRCS=		$(MACHSRCS) $(LIBSRCS)
56*6951Sab196087
570Sstevel@tonic-gate
580Sstevel@tonic-gateLIBS =          $(DYNLIB) $(LINTLIB)
590Sstevel@tonic-gate
600Sstevel@tonic-gateLINTSRCS=	../common/llib-l$(LIBNAME)
610Sstevel@tonic-gate
620Sstevel@tonic-gateINCLIST=	$(INCLIST_$(MACH)) -I../../include -I../../include/$(MACH)
630Sstevel@tonic-gateDEFLIST=	-DELF
640Sstevel@tonic-gate
650Sstevel@tonic-gate# It is not very clean to base the conditional definitions as below, but
660Sstevel@tonic-gate# this will have to do for now.
670Sstevel@tonic-gate#
680Sstevel@tonic-gate#$(LIBOBJS_W):=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
690Sstevel@tonic-gateobjs/%_w.o:=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
700Sstevel@tonic-gatepics/%_w.o:=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
710Sstevel@tonic-gate
720Sstevel@tonic-gate#$(LIBOBJS_E):=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
730Sstevel@tonic-gateobjs/%_e.o:=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
740Sstevel@tonic-gatepics/%_e.o:=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
750Sstevel@tonic-gate
760Sstevel@tonic-gateCPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
770Sstevel@tonic-gateBUILD.AR=	$(AR) $(ARFLAGS) $@ `$(LORDER) $(OBJS) | $(TSORT)`
78*6951Sab196087LINTFLAGS=	-amux
79*6951Sab196087LINTPOUT=	lint.out
800Sstevel@tonic-gate
810Sstevel@tonic-gate$(LINTLIB):=	LINTFLAGS = -nvx
824538Sdamico$(ROOTPROG):=	FILEMODE = 0555
830Sstevel@tonic-gate
844538SdamicoROOTFORMS=	$(FORMS:%=$(ROOTSHLIBCCS)/%)
854538Sdamico
860Sstevel@tonic-gateROOTLINTDIR=	$(ROOTLIBDIR)
870Sstevel@tonic-gateROOTLINT=	$(LINTSRCS:../common/%=$(ROOTLINTDIR)/%)
880Sstevel@tonic-gate
890Sstevel@tonic-gateDYNLINKLIBDIR=	$(ROOTLIBDIR)
900Sstevel@tonic-gateDYNLINKLIB=	$(LIBLINKS:%=$(DYNLINKLIBDIR)/%)
910Sstevel@tonic-gate
920Sstevel@tonic-gate# Need to make sure lib-make's are warning free
930Sstevel@tonic-gate$(DYNLIB) :=	CFLAGS += $(CCVERBOSE)
940Sstevel@tonic-gate$(DYNLIB) :=	CFLAGS64 += $(CCVERBOSE)
950Sstevel@tonic-gate
960Sstevel@tonic-gate$(DYNLIB) :=	LDLIBS += -lc
970Sstevel@tonic-gate
98*6951Sab196087CLEANFILES +=	../common/parser.c $(LINTPOUT)
990Sstevel@tonic-gateCLOBBERFILES +=	$(LIBS) $(LIBRARY)
100