xref: /illumos-gate/usr/src/cmd/sgs/lex/Makefile.com (revision 4de2612967d06c4fdbf524a62556a1e8118a006f)
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# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# cmd/sgs/lex/Makefile.com
29#
30
31
32MACHOBJS=	main.o sub1.o sub2.o sub3.o header.o parser.o
33WHATOBJS=	whatdir.o
34POBJECTS=	$(MACHOBJS) $(WHATOBJS)
35POBJS=		$(POBJECTS:%=objs/%)
36
37LIBRARY=	libl.a
38VERS=		.1
39
40LIBOBJS=	allprint.o libmain.o reject.o yyless.o yywrap.o
41LIBOBJS_W=	allprint_w.o reject_w.o yyless_w.o
42LIBOBJS_E=	reject_e.o yyless_e.o
43OBJECTS=	$(LIBOBJS) $(LIBOBJS_W) $(LIBOBJS_E)
44
45FORMS=		nceucform ncform nrform
46
47# 32-bit environment mapfile
48MAPFILE=		../common/mapfile-vers
49
50include 	../../../../lib/Makefile.lib
51
52C99MODE=	$(C99_ENABLE)
53
54# Override default source file derivation rule (in Makefile.lib)
55# from objects
56#
57SRCS=		$(MACHOBJS:%.o=../common/%.c) \
58		$(WHATOBJS:%.o=../../whatdir/common/%.c) \
59		$(LIBOBJS:%.o=../common/%.c)
60
61LIBS =          $(DYNLIB) $(LINTLIB)
62
63LINTSRCS=	../common/llib-l$(LIBNAME)
64
65INCLIST=	$(INCLIST_$(MACH)) -I../../include -I../../include/$(MACH)
66DEFLIST=	-DELF
67
68# It is not very clean to base the conditional definitions as below, but
69# this will have to do for now.
70#
71#$(LIBOBJS_W):=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
72objs/%_w.o:=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
73pics/%_w.o:=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
74
75#$(LIBOBJS_E):=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
76objs/%_e.o:=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
77pics/%_e.o:=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
78
79CPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
80BUILD.AR=	$(AR) $(ARFLAGS) $@ `$(LORDER) $(OBJS) | $(TSORT)`
81LINTFLAGS=	-ax
82LINTPOUT=	lintp.out
83
84$(LINTLIB):=	LINTFLAGS = -nvx
85$(ROOTCCSBINPROG):= FILEMODE = 0555
86
87ROOTFORMS=	$(FORMS:%=$(ROOTCCSBIN)/%)
88ROOTLINTDIR=	$(ROOTLIBDIR)
89ROOTLINT=	$(LINTSRCS:../common/%=$(ROOTLINTDIR)/%)
90
91DYNLINKLIBDIR=	$(ROOTLIBDIR)
92DYNLINKLIB=	$(LIBLINKS:%=$(DYNLINKLIBDIR)/%)
93
94# Need to make sure lib-make's are warning free
95$(DYNLIB) :=	CFLAGS += $(CCVERBOSE)
96$(DYNLIB) :=	CFLAGS64 += $(CCVERBOSE)
97
98DYNFLAGS += -M $(MAPFILE)
99$(DYNLIB) :=	LDLIBS += -lc
100
101CLEANFILES +=	../common/parser.c $(LINTPOUT) $(LINTOUT)
102CLOBBERFILES +=	$(LIBS) $(LIBRARY)
103