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# Copyright (c) 2018, Joyent, Inc. 15# 16 17PROG=iconv 18 19include ../Makefile.cmd 20include ../Makefile.ctf 21 22OBJS = iconv_main.o iconv_list.o charmap.o parser.tab.o scanner.o 23 24CSTD= $(CSTD_GNU99) 25LDLIBS += -lcmdutils -lavl 26YFLAGS = -d -b parser 27CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 28$(RELEASE_BUILD) CPPFLAGS += -DNDEBUG 29 30# because of labels from yacc 31parser.tab.o := CERRWARN += -_gcc=-Wno-unused-label 32 33# not linted 34SMATCH=off 35 36CLEANFILES = $(OBJS) parser.tab.c parser.tab.h 37CLOBBERFILES = $(PROG) $(POFILE) 38PIFILES = $(OBJS:%.o=%.i) 39POFILE = iconv_cmd.po 40 41all: $(PROG) 42 43install: all $(ROOTPROG) 44 45$(PROG): $(OBJS) 46 $(LINK.c) $(OBJS) -o $@ $(LDLIBS) 47 $(POST_PROCESS) 48 49$(OBJS): parser.tab.h 50$(PIFILES): parser.tab.h 51 52parser.tab.c parser.tab.h: parser.y 53 $(YACC) $(YFLAGS) parser.y 54 55clean: 56 $(RM) $(CLEANFILES) 57 58$(POFILE): $(PIFILES) 59 $(RM) $@ 60 $(RM) messages.po 61 $(XGETTEXT) -s $(PIFILES) 62 $(SED) -e '/domain/d' messages.po > $@ 63 $(RM) $(PIFILES) messages.po 64 65.KEEP_STATE: 66 67include ../Makefile.targ 68