xref: /titanic_41/usr/src/cmd/sgs/lex/Makefile.com (revision 3ed621bc8eb70ee11c69cd408fb8450eac33c281)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28PROG=		lex
29
30MACHOBJS=	main.o sub1.o sub2.o sub3.o header.o parser.o
31POBJECTS=	$(MACHOBJS)
32POBJS=		$(POBJECTS:%=objs/%)
33
34LIBRARY=	libl.a
35VERS=		.1
36
37LIBOBJS=	allprint.o libmain.o reject.o yyless.o yywrap.o
38LIBOBJS_W=	allprint_w.o reject_w.o yyless_w.o
39LIBOBJS_E=	reject_e.o yyless_e.o
40OBJECTS=	$(LIBOBJS) $(LIBOBJS_W) $(LIBOBJS_E)
41
42FORMS=		nceucform ncform nrform
43
44include 	../../../../lib/Makefile.lib
45
46SRCDIR =	../common
47
48C99MODE=	$(C99_ENABLE)
49
50# Override default source file derivation rule (in Makefile.lib)
51# from objects
52#
53MACHSRCS=	$(MACHOBJS:%.o=../common/%.c)
54LIBSRCS =	$(LIBOBJS:%.o=../common/%.c)
55SRCS=		$(MACHSRCS) $(LIBSRCS)
56
57
58LIBS =          $(DYNLIB) $(LINTLIB)
59
60LINTSRCS=	../common/llib-l$(LIBNAME)
61
62INCLIST=	$(INCLIST_$(MACH)) -I../../include -I../../include/$(MACH)
63DEFLIST=	-DELF
64
65# It is not very clean to base the conditional definitions as below, but
66# this will have to do for now.
67#
68#$(LIBOBJS_W):=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
69objs/%_w.o:=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
70pics/%_w.o:=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
71
72#$(LIBOBJS_E):=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
73objs/%_e.o:=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
74pics/%_e.o:=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
75
76CPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
77BUILD.AR=	$(AR) $(ARFLAGS) $@ `$(LORDER) $(OBJS) | $(TSORT)`
78LINTFLAGS=	-amux
79LINTPOUT=	lint.out
80
81$(LINTLIB):=	LINTFLAGS = -nvx
82$(ROOTPROG):=	FILEMODE = 0555
83
84ROOTFORMS=	$(FORMS:%=$(ROOTSHLIBCCS)/%)
85
86ROOTLINTDIR=	$(ROOTLIBDIR)
87ROOTLINT=	$(LINTSRCS:../common/%=$(ROOTLINTDIR)/%)
88
89DYNLINKLIBDIR=	$(ROOTLIBDIR)
90DYNLINKLIB=	$(LIBLINKS:%=$(DYNLINKLIBDIR)/%)
91
92# Need to make sure lib-make's are warning free
93$(DYNLIB) :=	CFLAGS += $(CCVERBOSE)
94$(DYNLIB) :=	CFLAGS64 += $(CCVERBOSE)
95
96$(DYNLIB) :=	LDLIBS += -lc
97
98CLEANFILES +=	../common/parser.c $(LINTPOUT)
99CLOBBERFILES +=	$(LIBS) $(LIBRARY)
100