17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# CDDL HEADER START 37c478bd9Sstevel@tonic-gate# 47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5f808c858Sraf# Common Development and Distribution License (the "License"). 6f808c858Sraf# You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate# 87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate# and limitations under the License. 127c478bd9Sstevel@tonic-gate# 137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate# 197c478bd9Sstevel@tonic-gate# CDDL HEADER END 207c478bd9Sstevel@tonic-gate# 217c478bd9Sstevel@tonic-gate# 22*fca42680SGary Mills# Copyright 2015 Gary Mills 231dd08564Sab196087# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate# Use is subject to license terms. 257c478bd9Sstevel@tonic-gate# 267c478bd9Sstevel@tonic-gate 271dd08564Sab196087PROG= lex 281dd08564Sab196087 297c478bd9Sstevel@tonic-gateMACHOBJS= main.o sub1.o sub2.o sub3.o header.o parser.o 3067298654SdamicoPOBJECTS= $(MACHOBJS) 317c478bd9Sstevel@tonic-gatePOBJS= $(POBJECTS:%=objs/%) 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gateLIBRARY= libl.a 347c478bd9Sstevel@tonic-gateVERS= .1 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gateLIBOBJS= allprint.o libmain.o reject.o yyless.o yywrap.o 377c478bd9Sstevel@tonic-gateLIBOBJS_W= allprint_w.o reject_w.o yyless_w.o 387c478bd9Sstevel@tonic-gateLIBOBJS_E= reject_e.o yyless_e.o 397c478bd9Sstevel@tonic-gateOBJECTS= $(LIBOBJS) $(LIBOBJS_W) $(LIBOBJS_E) 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gateFORMS= nceucform ncform nrform 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gateinclude ../../../../lib/Makefile.lib 447c478bd9Sstevel@tonic-gate 45f808c858SrafSRCDIR = ../common 46f808c858Sraf 477c478bd9Sstevel@tonic-gateC99MODE= $(C99_ENABLE) 487c478bd9Sstevel@tonic-gate 497014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-label 507014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized 517014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 527014882cSRichard Lowe 537c478bd9Sstevel@tonic-gate# Override default source file derivation rule (in Makefile.lib) 547c478bd9Sstevel@tonic-gate# from objects 557c478bd9Sstevel@tonic-gate# 561dd08564Sab196087MACHSRCS= $(MACHOBJS:%.o=../common/%.c) 571dd08564Sab196087LIBSRCS = $(LIBOBJS:%.o=../common/%.c) 581dd08564Sab196087SRCS= $(MACHSRCS) $(LIBSRCS) 591dd08564Sab196087 607c478bd9Sstevel@tonic-gateLIBS = $(DYNLIB) $(LINTLIB) 617c478bd9Sstevel@tonic-gate 62*fca42680SGary Mills# Append to LINTFLAGS and LINTFLAGS64 from lib/Makefile.lib 63*fca42680SGary MillsLINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2 -erroff=E_FUNC_RET_MAYBE_IGNORED2 64*fca42680SGary MillsLINTFLAGS64 += -erroff=E_NAME_MULTIPLY_DEF2 -erroff=E_FUNC_RET_MAYBE_IGNORED2 65*fca42680SGary Mills 667c478bd9Sstevel@tonic-gateLINTSRCS= ../common/llib-l$(LIBNAME) 67*fca42680SGary Mills$(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC) 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gateINCLIST= $(INCLIST_$(MACH)) -I../../include -I../../include/$(MACH) 707c478bd9Sstevel@tonic-gateDEFLIST= -DELF 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate# It is not very clean to base the conditional definitions as below, but 737c478bd9Sstevel@tonic-gate# this will have to do for now. 747c478bd9Sstevel@tonic-gate# 757c478bd9Sstevel@tonic-gate#$(LIBOBJS_W):= DEFLIST = -DEUC -DJLSLEX -DWOPTION -D$*=$*_w 767c478bd9Sstevel@tonic-gateobjs/%_w.o:= DEFLIST = -DEUC -DJLSLEX -DWOPTION -D$*=$*_w 777c478bd9Sstevel@tonic-gatepics/%_w.o:= DEFLIST = -DEUC -DJLSLEX -DWOPTION -D$*=$*_w 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate#$(LIBOBJS_E):= DEFLIST = -DEUC -DJLSLEX -DEOPTION -D$*=$*_e 807c478bd9Sstevel@tonic-gateobjs/%_e.o:= DEFLIST = -DEUC -DJLSLEX -DEOPTION -D$*=$*_e 817c478bd9Sstevel@tonic-gatepics/%_e.o:= DEFLIST = -DEUC -DJLSLEX -DEOPTION -D$*=$*_e 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gateCPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) 847c478bd9Sstevel@tonic-gateBUILD.AR= $(AR) $(ARFLAGS) $@ `$(LORDER) $(OBJS) | $(TSORT)` 85*fca42680SGary Mills 861dd08564Sab196087LINTPOUT= lint.out 877c478bd9Sstevel@tonic-gate 8867298654Sdamico$(ROOTPROG):= FILEMODE = 0555 897c478bd9Sstevel@tonic-gate 9067298654SdamicoROOTFORMS= $(FORMS:%=$(ROOTSHLIBCCS)/%) 9167298654Sdamico 927c478bd9Sstevel@tonic-gateROOTLINTDIR= $(ROOTLIBDIR) 937c478bd9Sstevel@tonic-gateROOTLINT= $(LINTSRCS:../common/%=$(ROOTLINTDIR)/%) 947c478bd9Sstevel@tonic-gate 957c478bd9Sstevel@tonic-gateDYNLINKLIBDIR= $(ROOTLIBDIR) 967c478bd9Sstevel@tonic-gateDYNLINKLIB= $(LIBLINKS:%=$(DYNLINKLIBDIR)/%) 977c478bd9Sstevel@tonic-gate 987c478bd9Sstevel@tonic-gate# Need to make sure lib-make's are warning free 997c478bd9Sstevel@tonic-gate$(DYNLIB) := CFLAGS += $(CCVERBOSE) 1007c478bd9Sstevel@tonic-gate$(DYNLIB) := CFLAGS64 += $(CCVERBOSE) 1017c478bd9Sstevel@tonic-gate 102*fca42680SGary MillsLDLIBS += -lc 1037c478bd9Sstevel@tonic-gate 1041dd08564Sab196087CLEANFILES += ../common/parser.c $(LINTPOUT) 1057c478bd9Sstevel@tonic-gateCLOBBERFILES += $(LIBS) $(LIBRARY) 106*fca42680SGary Mills 107*fca42680SGary Millslint: lintcheck 108