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 2007 Sun Microsystems, Inc. All rights reserved. 23# Use is subject to license terms. 24# 25# ident "%Z%%M% %I% %E% SMI" 26# 27# cmd/genmsg/Makefile 28 29include ../Makefile.cmd 30 31PROG= genmsg 32PSRC_Y= genmsg.y 33C_OBJS= main.o util.o 34 35LEXARGS= 36LEXSRCS= genmsg.l 37LEXINTSRCS= lex.yy.c 38LEXOBJS= lex.yy.o 39 40LDLIBS += -ll 41YFLAGS = -d 42CPPFLAGS = -I../head $(CPPFLAGS.master) 43 44# lex and yacc generates lint-unclean C code. 45LINTSUPPRESS= \ 46 -erroff=E_FUNC_RET_MAYBE_IGNORED2 \ 47 -erroff=E_EQUALITY_NOT_ASSIGNMENT \ 48 -erroff=E_BLOCK_DECL_UNUSED 49 50LINTFLAGS += -um 51 52# genmsg has a name clash with main() and libl.so.1. Localize all symbols. 53LDFLAGS += $(MAPFILE.INT:%=-M%) 54 55OBJS = $(C_OBJS) $(PSRC_Y:%.y=%.o) $(LEXOBJS) 56PSRC_C = $(PSRC_Y:%.y=%.c) 57SRCS = $(C_OBJS:%.o=%.c) $(PSRC_C) $(LEXINTSRCS) 58 59.KEEP_STATE: 60 61all: $(PROG) $(MAPFILE.INT) 62 63install: all $(ROOTPROG) 64 65$(PROG): $(OBJS) 66 $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS) 67 $(POST_PROCESS) 68 69$(LEXINTSRCS): $(LEXSRCS) 70 $(LEX) $(LEXARGS) $(LEXSRCS) 71 72$(PSRC_C) + y.tab.h: $(PSRC_Y) 73 $(YACC) $(YFLAGS) $(PSRC_Y) 74 $(MV) y.tab.c $(PSRC_C) 75 76$(OBJS): y.tab.h lex.yy.c 77 78catalog: $(POFILE) 79 80$(POFILE): $(SRCS) 81 $(RM) $@ 82 $(COMPILE.cpp) $(SRCS) > $(POFILE).i 83 $(XGETTEXT) $(XGETFLAGS) $(POFILE).i 84 $(SED) "/^domain/d" messages.po > $@ 85 $(RM) $(POFILE).i messages.po 86 87lint: $(LEXINTSRCS) $(PSRC_C) 88 $(LINT.c) $(C_OBJS:%.o=%.c) $(LDLIBS) 89 $(LINT.c) $(LEXINTSRCS) $(PSRC_C) $(LINTSUPPRESS) $(LDLIBS) 90 91clean: 92 $(RM) $(OBJS) $(PSRC_C) $(LEXINTSRCS) y.tab.h *.po 93 94include ../Makefile.targ 95