xref: /titanic_51/usr/src/cmd/genmsg/Makefile (revision 27c48ed935c6a5f6015c6534b98e3090b1ddfdb6)
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 lex.yy.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# genmsg has a name clash with main() and libl.so.1.  Localize all symbols.
45LDFLAGS +=	$(MAPFILE.NGB:%=-M%)
46
47OBJS =          $(C_OBJS) $(PSRC_Y:%.y=%.o)
48PSRC_C =        $(PSRC_Y:%.y=%.c)
49SRCS =          $(C_OBJS:%.o=%.c) $(PSRC_C)
50
51.KEEP_STATE:
52
53all:    $(PROG) $(MAPFILE.NGB)
54
55install: all $(ROOTPROG)
56
57$(PROG): $(OBJS)
58	$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
59	$(POST_PROCESS)
60
61$(LEXINTSRCS): $(LEXSRCS)
62	$(LEX) $(LEXARGS) $(LEXSRCS)
63
64$(PSRC_C) + y.tab.h:    $(PSRC_Y)
65	$(YACC) $(YFLAGS) $(PSRC_Y)
66	$(MV) y.tab.c $(PSRC_C)
67
68$(OBJS): y.tab.h lex.yy.c
69
70catalog:        $(POFILE)
71
72$(POFILE):      $(SRCS)
73	$(RM) $@
74	$(COMPILE.cpp) $(SRCS)  > $(POFILE).i
75	$(XGETTEXT) $(XGETFLAGS)        $(POFILE).i
76	$(SED) "/^domain/d" messages.po > $@
77	$(RM) $(POFILE).i messages.po
78
79lint: $(SRCS) .WAIT lint_SRCS
80
81clean:
82	$(RM) $(OBJS) $(PSRC_C) y.tab.h lex.yy.c $(PSRC_C) *.po
83
84include ../Makefile.targ
85