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