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 524da5b34Srie# Common Development and Distribution License (the "License"). 624da5b34Srie# 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# 2224da5b34Srie# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate# Use is subject to license terms. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gatePROG= genmsg 297c478bd9Sstevel@tonic-gatePSRC_Y= genmsg.y 306e54a631SmuffinC_OBJS= main.o util.o 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gateLEXARGS= 337c478bd9Sstevel@tonic-gateLEXSRCS= genmsg.l 347c478bd9Sstevel@tonic-gateLEXINTSRCS= lex.yy.c 357c478bd9Sstevel@tonic-gateLEXOBJS= lex.yy.o 367c478bd9Sstevel@tonic-gate 37*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-label 38*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 39*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable 40*7014882cSRichard Lowe 417c478bd9Sstevel@tonic-gateLDLIBS += -ll 427c478bd9Sstevel@tonic-gateYFLAGS = -d 437c478bd9Sstevel@tonic-gateCPPFLAGS = -I../head $(CPPFLAGS.master) 447c478bd9Sstevel@tonic-gate 456e54a631Smuffin# lex and yacc generates lint-unclean C code. 466e54a631SmuffinLINTSUPPRESS= \ 476e54a631Smuffin -erroff=E_FUNC_RET_MAYBE_IGNORED2 \ 486e54a631Smuffin -erroff=E_EQUALITY_NOT_ASSIGNMENT \ 496e54a631Smuffin -erroff=E_BLOCK_DECL_UNUSED 5024da5b34Srie 516e54a631SmuffinLINTFLAGS += -um 526e54a631Smuffin 53df4628cbSrie# genmsg has a name clash with main() and libl.so.1. However, genmsg must 54df4628cbSrie# still export a number of "yy*" (libl) interfaces. Reduce all other symbols 55df4628cbSrie# to local scope. 56df4628cbSrieMAPFILES += $(MAPFILE.LEX) $(MAPFILE.NGB) 57df4628cbSrieMAPOPTS = $(MAPFILES:%=-M%) 58df4628cbSrie 59df4628cbSrieLDFLAGS += $(MAPOPTS) 606e54a631Smuffin 616e54a631SmuffinOBJS = $(C_OBJS) $(PSRC_Y:%.y=%.o) $(LEXOBJS) 627c478bd9Sstevel@tonic-gatePSRC_C = $(PSRC_Y:%.y=%.c) 636e54a631SmuffinSRCS = $(C_OBJS:%.o=%.c) $(PSRC_C) $(LEXINTSRCS) 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gate.KEEP_STATE: 667c478bd9Sstevel@tonic-gate 67df4628cbSrieall: $(PROG) 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gateinstall: all $(ROOTPROG) 707c478bd9Sstevel@tonic-gate 71df4628cbSrie$(PROG): $(OBJS) $(MAPFILES) 727c478bd9Sstevel@tonic-gate $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS) 737c478bd9Sstevel@tonic-gate $(POST_PROCESS) 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate$(LEXINTSRCS): $(LEXSRCS) 767c478bd9Sstevel@tonic-gate $(LEX) $(LEXARGS) $(LEXSRCS) 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gate$(PSRC_C) + y.tab.h: $(PSRC_Y) 797c478bd9Sstevel@tonic-gate $(YACC) $(YFLAGS) $(PSRC_Y) 807c478bd9Sstevel@tonic-gate $(MV) y.tab.c $(PSRC_C) 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate$(OBJS): y.tab.h lex.yy.c 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gatecatalog: $(POFILE) 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate$(POFILE): $(SRCS) 877c478bd9Sstevel@tonic-gate $(RM) $@ 887c478bd9Sstevel@tonic-gate $(COMPILE.cpp) $(SRCS) > $(POFILE).i 897c478bd9Sstevel@tonic-gate $(XGETTEXT) $(XGETFLAGS) $(POFILE).i 907c478bd9Sstevel@tonic-gate $(SED) "/^domain/d" messages.po > $@ 917c478bd9Sstevel@tonic-gate $(RM) $(POFILE).i messages.po 927c478bd9Sstevel@tonic-gate 936e54a631Smuffinlint: $(LEXINTSRCS) $(PSRC_C) 946e54a631Smuffin $(LINT.c) $(C_OBJS:%.o=%.c) $(LDLIBS) 956e54a631Smuffin $(LINT.c) $(LEXINTSRCS) $(PSRC_C) $(LINTSUPPRESS) $(LDLIBS) 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gateclean: 986e54a631Smuffin $(RM) $(OBJS) $(PSRC_C) $(LEXINTSRCS) y.tab.h *.po 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gateinclude ../Makefile.targ 101