Merge commit '8fd2e913f04a71b9e820a088819d5b3d5205945b'
[unleashed.git] / usr / src / cmd / msgfmt / Makefile
blob29a46a997bf2080e0d6b463e364e7011f0d59105
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 2006 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
26 # All Rights Reserved
28 # Copyright 2017 Joyent, Inc.
31 # cmd/msgfmt/Makefile
33 include ../Makefile.cmd
35 XOBJS= xgettext.o
37 LXOBJS= xgettext.lx.o
39 GOBJS= gnu_msgfmt.o gnu_handle.o gnu_lex.o gnu_hash.o gnu_check.o
41 YOBJS= gnu_po.o
43 BOBJS= gnu_msgs.o
45 LOBJS= gnu_msgs_rev.o
47 SOBJS= msgfmt.o check_header.o
49 COBJS= option.o util.o
51 BINPROG= msgfmt xgettext
52 LIBPROG= gmsgfmt
53 PROG= $(BINPROG) $(LIBPROG)
55 YFLAGS += -d
57 POFILE= msgfmt_all.po
58 POFILES= $(SOBJS:%.o=%.po) $(GOBJS:%.o=%.po) $(COBJS:%.o=%.po) \
59 $(BOBJS:%.o=%.po) $(YOBJS:%.o=%.po)
61 CLOBBERFILES += gmsgfmt_rev
63 ROOTBINPROG= $(BINPROG:%=$(ROOTBIN)/%)
64 ROOTLIBPROG= $(LIBPROG:%=$(ROOTLIB)/%)
66 CERRWARN += -Wno-parentheses
67 CERRWARN += -Wno-unused-label
68 CERRWARN += -Wno-uninitialized
69 CERRWARN += -Wno-unused-variable
71 .KEEP_STATE:
73 .PARALLEL: $(SOBJS) $(GOBJS) $(YOBJS) $(COBJS) $(BOBJS) $(LOBJS) \
74 $(XOBJS) $(LXOBJS)
76 all: $(PROG) gmsgfmt_rev
78 msgfmt: $(SOBJS) $(COBJS)
79 $(LINK.c) $(SOBJS) $(COBJS) -o $@ $(LDLIBS)
80 $(POST_PROCESS)
82 gmsgfmt: $(GOBJS) $(YOBJS) $(BOBJS) $(COBJS)
83 $(LINK.c) $(GOBJS) $(YOBJS) $(BOBJS) $(COBJS) -o $@ $(LDLIBS)
84 $(POST_PROCESS)
86 gmsgfmt_rev: $(GOBJS) $(YOBJS) $(LOBJS) $(COBJS)
87 $(LINK.c) $(GOBJS) $(YOBJS) $(LOBJS) $(COBJS) -o $@ $(LDLIBS)
88 $(POST_PROCESS)
90 xgettext: $(XOBJS) $(LXOBJS)
91 $(LINK.c) $(XOBJS) $(LXOBJS) -o $@ $(LDLIBS)
92 $(POST_PROCESS)
94 $(POFILES): y.tab.h
96 $(POFILE): $(POFILES)
97 $(RM) $@
98 cat $(POFILES) > $@
100 install: all $(ROOTBINPROG) $(ROOTLIBPROG)
102 clean:
103 $(RM) $(SOBJS) $(GOBJS) $(YOBJS) $(COBJS) \
104 $(XOBJS) $(LXOBJS) $(BOBJS) $(LOBJS) \
105 $(POFILE) $(POFILES) gnu_po.c y.tab.h xgettext.lx.c
107 gnu_po.c + y.tab.h: gnu_po.y
108 $(RM) gnu_po.c y.tab.h
109 $(YACC.y) gnu_po.y
110 mv y.tab.c gnu_po.c
112 gnu_lex.o: y.tab.h
114 include ../Makefile.targ