8672 proc_t changes broke genunix dmods and walker
[unleashed.git] / usr / src / cmd / genmsg / Makefile
blobaafd07c84338e0f17e9de06d4ff366679aa4e312
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 += -_gcc=-Wno-unused-label
38 CERRWARN += -_gcc=-Wno-parentheses
39 CERRWARN += -_gcc=-Wno-unused-variable
41 LDLIBS += -ll
42 YFLAGS = -d
43 CPPFLAGS = -I../head $(CPPFLAGS.master)
45 # lex and yacc generates lint-unclean C code.
46 LINTSUPPRESS= \
47 -erroff=E_FUNC_RET_MAYBE_IGNORED2 \
48 -erroff=E_EQUALITY_NOT_ASSIGNMENT \
49 -erroff=E_BLOCK_DECL_UNUSED
51 LINTFLAGS += -um
53 # genmsg has a name clash with main() and libl.so.1. However, genmsg must
54 # still export a number of "yy*" (libl) interfaces. Reduce all other symbols
55 # to local scope.
56 MAPFILES += $(MAPFILE.LEX) $(MAPFILE.NGB)
57 MAPOPTS = $(MAPFILES:%=-M%)
59 LDFLAGS += $(MAPOPTS)
61 OBJS = $(C_OBJS) $(PSRC_Y:%.y=%.o) $(LEXOBJS)
62 PSRC_C = $(PSRC_Y:%.y=%.c)
63 SRCS = $(C_OBJS:%.o=%.c) $(PSRC_C) $(LEXINTSRCS)
65 .KEEP_STATE:
67 all: $(PROG)
69 install: all $(ROOTPROG)
71 $(PROG): $(OBJS) $(MAPFILES)
72 $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
73 $(POST_PROCESS)
75 $(LEXINTSRCS): $(LEXSRCS)
76 $(LEX) $(LEXARGS) $(LEXSRCS)
78 $(PSRC_C) + y.tab.h: $(PSRC_Y)
79 $(YACC) $(YFLAGS) $(PSRC_Y)
80 $(MV) y.tab.c $(PSRC_C)
82 $(OBJS): y.tab.h lex.yy.c
84 catalog: $(POFILE)
86 $(POFILE): $(SRCS)
87 $(RM) $@
88 $(COMPILE.cpp) $(SRCS) > $(POFILE).i
89 $(XGETTEXT) $(XGETFLAGS) $(POFILE).i
90 $(SED) "/^domain/d" messages.po > $@
91 $(RM) $(POFILE).i messages.po
93 lint: $(LEXINTSRCS) $(PSRC_C)
94 $(LINT.c) $(C_OBJS:%.o=%.c) $(LDLIBS)
95 $(LINT.c) $(LEXINTSRCS) $(PSRC_C) $(LINTSUPPRESS) $(LDLIBS)
97 clean:
98 $(RM) $(OBJS) $(PSRC_C) $(LEXINTSRCS) y.tab.h *.po
100 include ../Makefile.targ