xref: /illumos-gate/usr/src/cmd/genmsg/Makefile (revision 85f4cb87)
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
377014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-label
387014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
397014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-variable
407014882cSRichard Lowe
417c478bd9Sstevel@tonic-gateLDLIBS += -ll
427c478bd9Sstevel@tonic-gateYFLAGS = -d
437c478bd9Sstevel@tonic-gateCPPFLAGS = -I../head $(CPPFLAGS.master)
447c478bd9Sstevel@tonic-gate
45df4628cbSrie# genmsg has a name clash with main() and libl.so.1.  However, genmsg must
46df4628cbSrie# still export a number of "yy*" (libl) interfaces.  Reduce all other symbols
47df4628cbSrie# to local scope.
48df4628cbSrieMAPFILES +=	$(MAPFILE.LEX) $(MAPFILE.NGB)
49*85f4cb87SRichard LoweMAPOPTS =	$(MAPFILES:%=-Wl,-M%)
50df4628cbSrie
51df4628cbSrieLDFLAGS +=	$(MAPOPTS)
5224da5b34Srie
536e54a631SmuffinOBJS =          $(C_OBJS) $(PSRC_Y:%.y=%.o) $(LEXOBJS)
547c478bd9Sstevel@tonic-gatePSRC_C =        $(PSRC_Y:%.y=%.c)
556e54a631SmuffinSRCS =          $(C_OBJS:%.o=%.c) $(PSRC_C) $(LEXINTSRCS)
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gate.KEEP_STATE:
587c478bd9Sstevel@tonic-gate
59df4628cbSrieall:    $(PROG)
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gateinstall: all $(ROOTPROG)
627c478bd9Sstevel@tonic-gate
63df4628cbSrie$(PROG): $(OBJS) $(MAPFILES)
6458e78d16SToomas Soome	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
657c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
667c478bd9Sstevel@tonic-gate
677c478bd9Sstevel@tonic-gate$(LEXINTSRCS): $(LEXSRCS)
687c478bd9Sstevel@tonic-gate	$(LEX) $(LEXARGS) $(LEXSRCS)
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gate$(PSRC_C) + y.tab.h:    $(PSRC_Y)
717c478bd9Sstevel@tonic-gate	$(YACC) $(YFLAGS) $(PSRC_Y)
727c478bd9Sstevel@tonic-gate	$(MV) y.tab.c $(PSRC_C)
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gate$(OBJS): y.tab.h lex.yy.c
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gatecatalog:        $(POFILE)
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gate$(POFILE):      $(SRCS)
797c478bd9Sstevel@tonic-gate	$(RM) $@
807c478bd9Sstevel@tonic-gate	$(COMPILE.cpp) $(SRCS)  > $(POFILE).i
817c478bd9Sstevel@tonic-gate	$(XGETTEXT) $(XGETFLAGS)        $(POFILE).i
827c478bd9Sstevel@tonic-gate	$(SED) "/^domain/d" messages.po > $@
837c478bd9Sstevel@tonic-gate	$(RM) $(POFILE).i messages.po
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gateclean:
866e54a631Smuffin	$(RM) $(OBJS) $(PSRC_C) $(LEXINTSRCS) y.tab.h *.po
877c478bd9Sstevel@tonic-gate
887c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
89