xref: /titanic_44/usr/src/cmd/genmsg/Makefile (revision 18c2aff776a775d34a4c9893a4c72e0434d68e36)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23#ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# cmd/genmsg/Makefile
29
30include ../Makefile.cmd
31
32PROG=		genmsg
33PSRC_Y=		genmsg.y
34C_OBJS=         main.o util.o lex.yy.o
35
36LEXARGS=
37LEXSRCS=	genmsg.l
38LEXINTSRCS=	lex.yy.c
39LEXOBJS=	lex.yy.o
40
41LDLIBS += -ll
42YFLAGS = -d
43CPPFLAGS = -I../head $(CPPFLAGS.master)
44
45OBJS =          $(C_OBJS) $(PSRC_Y:%.y=%.o)
46PSRC_C =        $(PSRC_Y:%.y=%.c)
47SRCS =          $(C_OBJS:%.o=%.c) $(PSRC_C)
48
49.KEEP_STATE:
50
51all:    $(PROG)
52
53install: all $(ROOTPROG)
54
55$(PROG): $(OBJS)
56	$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
57	$(POST_PROCESS)
58
59$(LEXINTSRCS): $(LEXSRCS)
60	$(LEX) $(LEXARGS) $(LEXSRCS)
61
62$(PSRC_C) + y.tab.h:    $(PSRC_Y)
63	$(YACC) $(YFLAGS) $(PSRC_Y)
64	$(MV) y.tab.c $(PSRC_C)
65
66$(OBJS): y.tab.h lex.yy.c
67
68catalog:        $(POFILE)
69
70$(POFILE):      $(SRCS)
71	$(RM) $@
72	$(COMPILE.cpp) $(SRCS)  > $(POFILE).i
73	$(XGETTEXT) $(XGETFLAGS)        $(POFILE).i
74	$(SED) "/^domain/d" messages.po > $@
75	$(RM) $(POFILE).i messages.po
76
77lint: $(SRCS) .WAIT lint_SRCS
78
79clean:
80	$(RM) $(OBJS) $(PSRC_C) y.tab.h lex.yy.c $(PSRC_C) *.po
81
82include ../Makefile.targ
83