xref: /illumos-gate/usr/src/cmd/sgs/lex/Makefile.com (revision 8af575c0afc1d79bd23c3e1a78a546c9963e5083)
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 2015 Gary Mills
23# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
27#
28
29PROG=		lex
30
31MACHOBJS=	main.o sub1.o sub2.o sub3.o header.o parser.o
32POBJECTS=	$(MACHOBJS)
33POBJS=		$(POBJECTS:%=objs/%)
34
35LIBRARY=	libl.a
36VERS=		.1
37
38LIBOBJS=	allprint.o libmain.o reject.o yyless.o yywrap.o
39LIBOBJS_W=	allprint_w.o reject_w.o yyless_w.o
40LIBOBJS_E=	reject_e.o yyless_e.o
41OBJECTS=	$(LIBOBJS) $(LIBOBJS_W) $(LIBOBJS_E)
42
43FORMS=		nceucform ncform nrform
44
45include		../../../../lib/Makefile.lib
46
47COMPATLINKS=	usr/ccs/lib/libl.so
48COMPATLINKS64=	usr/ccs/lib/$(MACH64)/libl.so
49
50$(ROOT)/usr/ccs/lib/libl.so := COMPATLINKTARGET=../../lib/libl.so.1
51$(ROOT)/usr/ccs/lib/$(MACH64)/libl.so:= \
52	COMPATLINKTARGET=../../../lib/$(MACH64)/libl.so.1
53
54SRCDIR =	../common
55
56CSTD=	$(CSTD_GNU99)
57
58CERRWARN +=	-_gcc=-Wno-unused-label
59CERRWARN +=	$(CNOWARN_UNINIT)
60CERRWARN +=	-_gcc=-Wno-parentheses
61
62# Override default source file derivation rule (in Makefile.lib)
63# from objects
64#
65MACHSRCS=	$(MACHOBJS:%.o=../common/%.c)
66LIBSRCS =	$(LIBOBJS:%.o=../common/%.c)
67SRCS=		$(MACHSRCS) $(LIBSRCS)
68
69LIBS =          $(DYNLIB)
70
71INCLIST=	$(INCLIST_$(MACH)) -I../../include -I../../include/$(MACH)
72DEFLIST=	-DELF
73
74# It is not very clean to base the conditional definitions as below, but
75# this will have to do for now.
76#
77#$(LIBOBJS_W):=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
78objs/%_w.o:=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
79pics/%_w.o:=	DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
80
81#$(LIBOBJS_E):=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
82objs/%_e.o:=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
83pics/%_e.o:=	DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
84
85CPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
86
87$(ROOTPROG):=	FILEMODE = 0555
88
89ROOTFORMS=	$(FORMS:%=$(ROOTSHLIBCCS)/%)
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
98LDLIBS += -lc
99
100CLEANFILES +=	../common/parser.c
101CLOBBERFILES +=	$(LIBS) $(LIBRARY)
102