Makefiles need to specify C99 mode consistently
[unleashed.git] / usr / src / cmd / sgs / lex / Makefile.com
blobd1ccfd4405d04cf8178cd53db15cf1b9c6708a7a
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
22 # Copyright 2015 Gary Mills
23 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24 # Use is subject to license terms.
27 PROG=           lex
29 MACHOBJS=       main.o sub1.o sub2.o sub3.o header.o parser.o
30 POBJECTS=       $(MACHOBJS)
31 POBJS=          $(POBJECTS:%=objs/%)
33 LIBRARY=        libl.a
34 VERS=           .1
36 LIBOBJS=        allprint.o libmain.o reject.o yyless.o yywrap.o
37 LIBOBJS_W=      allprint_w.o reject_w.o yyless_w.o
38 LIBOBJS_E=      reject_e.o yyless_e.o
39 OBJECTS=        $(LIBOBJS) $(LIBOBJS_W) $(LIBOBJS_E)
41 FORMS=          nceucform ncform nrform
43 include         ../../../../lib/Makefile.lib
45 SRCDIR =        ../common
47 CSTD=   $(CSTD_GNU99)
49 CERRWARN +=     -Wno-unused-label
50 CERRWARN +=     -Wno-uninitialized
51 CERRWARN +=     -Wno-parentheses
53 # Override default source file derivation rule (in Makefile.lib)
54 # from objects
56 MACHSRCS=       $(MACHOBJS:%.o=../common/%.c)
57 LIBSRCS =       $(LIBOBJS:%.o=../common/%.c)
58 SRCS=           $(MACHSRCS) $(LIBSRCS)
60 LIBS =          $(DYNLIB)
62 INCLIST=        $(INCLIST_$(MACH)) -I../../include -I../../include/$(MACH)
63 DEFLIST=        -DELF
65 # It is not very clean to base the conditional definitions as below, but
66 # this will have to do for now.
68 #$(LIBOBJS_W):= DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
69 objs/%_w.o:=    DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
70 pics/%_w.o:=    DEFLIST = -DEUC -DJLSLEX  -DWOPTION -D$*=$*_w
72 #$(LIBOBJS_E):= DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
73 objs/%_e.o:=    DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
74 pics/%_e.o:=    DEFLIST = -DEUC -DJLSLEX  -DEOPTION -D$*=$*_e
76 CPPFLAGS=       $(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
77 BUILD.AR=       $(AR) $(ARFLAGS) $@ `$(LORDER) $(OBJS) | $(TSORT)`
79 $(ROOTPROG):=   FILEMODE = 0555
81 ROOTFORMS=      $(FORMS:%=$(ROOTSHLIBCCS)/%)
83 DYNLINKLIBDIR=  $(ROOTLIBDIR)
84 DYNLINKLIB=     $(LIBLINKS:%=$(DYNLINKLIBDIR)/%)
86 LDLIBS += -lc
88 CLEANFILES +=   ../common/parser.c
89 CLOBBERFILES += $(LIBS) $(LIBRARY)