xref: /illumos-gate/usr/src/cmd/iconv/Makefile (revision 6cf138763efaab6b5998bc1ed6849459e376684d)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
14#
15
16PROG=iconv
17
18include ../Makefile.cmd
19include ../Makefile.ctf
20
21OBJS = iconv_main.o iconv_list.o charmap.o parser.tab.o scanner.o
22
23SRCS	= $(OBJS:%.o=%.c)
24
25C99MODE=	$(C99_ENABLE)
26LDLIBS		+= -lcmdutils -lavl
27YFLAGS		= -d -b parser
28CPPFLAGS	+= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
29$(RELEASE_BUILD) CPPFLAGS += -DNDEBUG
30
31CERRWARN +=	-_gcc=-Wno-unused-label
32
33CLEANFILES	= $(OBJS) parser.tab.c parser.tab.h
34CLOBBERFILES	= $(PROG) $(POFILE)
35PIFILES		= $(OBJS:%.o=%.i)
36POFILE		= iconv_cmd.po
37
38all: $(PROG)
39
40install: all $(ROOTPROG)
41
42$(PROG): $(OBJS)
43	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
44	$(POST_PROCESS)
45
46$(OBJS):	parser.tab.h
47
48parser.tab.c parser.tab.h: parser.y
49	$(YACC) $(YFLAGS) parser.y
50
51lint:	$(SRCS)
52	$(LINT.c) $(CPPFLAGS) $(SRCS)
53
54clean:
55	$(RM) $(CLEANFILES)
56
57$(POFILE):	$(PIFILES)
58	$(RM) $@
59	$(RM) messages.po
60	$(XGETTEXT) -s $(PIFILES)
61	$(SED) -e '/domain/d' messages.po > $@
62	$(RM) $(PIFILES) messages.po
63
64.KEEP_STATE:
65
66include ../Makefile.targ
67