xref: /illumos-gate/usr/src/cmd/msgfmt/Makefile (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
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# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#       Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
27#         All Rights Reserved
28#
29
30#ident	"%Z%%M%	%I%	%E% SMI"
31
32# cmd/msgfmt/Makefile
33
34include ../Makefile.cmd
35
36XOBJS=	xgettext.o
37
38LXOBJS=	xgettext.lx.o
39
40GOBJS=	gnu_msgfmt.o gnu_handle.o gnu_lex.o gnu_hash.o gnu_check.o
41
42YOBJS=	gnu_po.o
43
44BOBJS=	gnu_msgs.o
45
46LOBJS=	gnu_msgs_rev.o
47
48SOBJS=	msgfmt.o check_header.o
49
50COBJS=	option.o util.o
51
52BINPROG= msgfmt xgettext
53LIBPROG= gmsgfmt
54PROG=  $(BINPROG) $(LIBPROG)
55
56YFLAGS += -d
57LINTFLAGS +=	-um
58
59POFILE= msgfmt_all.po
60POFILES= $(SOBJS:%.o=%.po) $(GOBJS:%.o=%.po) $(COBJS:%.o=%.po) \
61	$(BOBJS:%.o=%.po) $(YOBJS:%.o=%.po)
62
63CLOBBERFILES += gmsgfmt_rev
64
65ROOTBINPROG= $(BINPROG:%=$(ROOTBIN)/%)
66ROOTLIBPROG= $(LIBPROG:%=$(ROOTLIB)/%)
67
68.KEEP_STATE:
69
70.PARALLEL:	$(SOBJS) $(GOBJS) $(YOBJS) $(COBJS) $(BOBJS) $(LOBJS) \
71		$(XOBJS) $(LXOBJS)
72
73all: $(PROG) gmsgfmt_rev
74
75msgfmt:	$(SOBJS) $(COBJS)
76	$(LINK.c) $(SOBJS) $(COBJS) -o $@ $(LDLIBS)
77	$(POST_PROCESS)
78
79gmsgfmt:	$(GOBJS) $(YOBJS) $(BOBJS) $(COBJS)
80	$(LINK.c) $(GOBJS) $(YOBJS) $(BOBJS) $(COBJS) -o $@ $(LDLIBS)
81	$(POST_PROCESS)
82
83gmsgfmt_rev:	$(GOBJS) $(YOBJS) $(LOBJS) $(COBJS)
84	$(LINK.c) $(GOBJS) $(YOBJS) $(LOBJS) $(COBJS) -o $@ $(LDLIBS)
85	$(POST_PROCESS)
86
87xgettext: $(XOBJS) $(LXOBJS)
88	$(LINK.c) $(XOBJS) $(LXOBJS) -o $@ $(LDLIBS)
89	$(POST_PROCESS)
90
91$(POFILE):	$(POFILES)
92	$(RM) $@
93	cat $(POFILES) > $@
94
95install: all $(ROOTBINPROG) $(ROOTLIBPROG)
96
97clean:
98	$(RM) $(SOBJS) $(GOBJS) $(YOBJS) $(COBJS) \
99		$(XOBJS) $(LXOBJS) $(BOBJS) $(LOBJS) \
100		$(POFILE) $(POFILES) gnu_po.c y.tab.h
101
102lint:	gnu_po.c y.tab.h
103	$(LINT.c) $(SOBJS:%.o=%.c) $(COBJS:%.o=%.c) $(LDLIBS)
104	$(LINT.c) $(GOBJS:%.o=%.c) $(BOBJS:%.o=%.c) $(COBJS:%.o=%.c) $(LDLIBS)
105	$(LINT.c) $(GOBJS:%.o=%.c) $(LOBJS:%.o=%.c) $(COBJS:%.o=%.c) $(LDLIBS)
106	$(LINT.c) $(XOBJS:%.o=%.c) $(LDLIBS)
107
108gnu_po.c + y.tab.h:	gnu_po.y
109	$(RM) gnu_po.c y.tab.h
110	$(YACC.y) gnu_po.y
111	mv y.tab.c gnu_po.c
112
113gnu_lex.o:	y.tab.h
114
115include ../Makefile.targ
116