Merge commit '00f1a4f432b3d8aad1aa270e91c44c57f03ef407'
[unleashed.git] / usr / src / cmd / genmsg / Makefile
blob0873935769fb2beb7d81cfa848e93886ff0cee86
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 2007 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
26 include ../Makefile.cmd
28 PROG= genmsg
29 PSRC_Y= genmsg.y
30 C_OBJS= main.o util.o
32 LEXARGS=
33 LEXSRCS= genmsg.l
34 LEXINTSRCS= lex.yy.c
35 LEXOBJS= lex.yy.o
37 CERRWARN += -Wno-unused-label
38 CERRWARN += -Wno-parentheses
39 CERRWARN += -Wno-unused-variable
41 LDLIBS += -ll
42 YFLAGS = -d
43 CPPFLAGS = -I../../../include $(CPPFLAGS.master)
45 # genmsg has a name clash with main() and libl.so.1. However, genmsg must
46 # still export a number of "yy*" (libl) interfaces. Reduce all other symbols
47 # to local scope.
48 MAPFILES += $(MAPFILE.LEX) $(MAPFILE.NGB)
49 MAPOPTS = $(MAPFILES:%=-Wl,-M%)
51 LDFLAGS += $(MAPOPTS)
53 OBJS = $(C_OBJS) $(PSRC_Y:%.y=%.o) $(LEXOBJS)
54 PSRC_C = $(PSRC_Y:%.y=%.c)
55 SRCS = $(C_OBJS:%.o=%.c) $(PSRC_C) $(LEXINTSRCS)
57 .KEEP_STATE:
59 all: $(PROG)
61 install: all $(ROOTPROG)
63 $(PROG): $(OBJS) $(MAPFILES)
64 $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
65 $(POST_PROCESS)
67 $(LEXINTSRCS): $(LEXSRCS)
68 $(LEX) $(LEXARGS) $(LEXSRCS)
70 $(PSRC_C) + y.tab.h: $(PSRC_Y)
71 $(YACC) $(YFLAGS) $(PSRC_Y)
72 $(MV) y.tab.c $(PSRC_C)
74 $(OBJS): y.tab.h lex.yy.c
76 catalog: $(POFILE)
78 $(POFILE): $(SRCS)
79 $(RM) $@
80 $(COMPILE.cpp) $(SRCS) > $(POFILE).i
81 $(XGETTEXT) $(XGETFLAGS) $(POFILE).i
82 $(SED) "/^domain/d" messages.po > $@
83 $(RM) $(POFILE).i messages.po
85 clean:
86 $(RM) $(OBJS) $(PSRC_C) $(LEXINTSRCS) y.tab.h *.po
88 include ../Makefile.targ