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 (the "License"). 6# You may not use this file except in compliance with the License. 7# 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. 12# 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] 18# 19# CDDL HEADER END 20# 21# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 22# Use is subject to license terms. 23# 24# Copyright (c) 2019, Joyent, Inc. 25# 26 27LIB = geniconvtbl.so 28PROG = geniconvtbl 29 30SRCDIR = $(SRC)/cmd/geniconvtbl 31 32MAPFILE = $(SRCDIR)/mapfile 33 34OBJS = itmcomp.o assemble.o disassemble.o itm_util.o y.tab.o lex.yy.o 35MSGFILES = itmcomp.i assemble.i disassemble.i itm_util.i y.tab.i lex.yy.i geniconvtbl.i 36 37include $(SRC)/cmd/Makefile.cmd 38 39POFILE = geniconvtbl_.po 40 41ROOTDIRS32= $(ROOTLIB)/iconv 42ROOTDIRS64= $(ROOTLIB)/iconv/$(MACH64) 43ROOTLIB32 = $(ROOTDIRS32)/$(LIB) 44ROOTLIB64 = $(ROOTDIRS64)/$(LIB) 45 46CLOBBERFILES= $(LIB) 47CLEANFILES = $(OBJS) y.tab.c y.tab.h lex.yy.c \ 48 $(POFILE) 49 50CPPFLAGS += -I. -I$(SRCDIR) 51CERRWARN += $(CNOWARN_UNINIT) 52CERRWARN += -_gcc=-Wno-unused-label 53CERRWARN += -_gcc=-Wno-switch 54CERRWARN += -_gcc=-Wno-unused-variable 55CERRWARN += -_gcc=-Wno-implicit-function-declaration 56YFLAGS += -d 57CFLAGS += -D_FILE_OFFSET_BITS=64 58 59# dump_expr() is too hairy 60SMATCH=off 61 62$(LIB) := LDFLAGS += $(GSHARED) -Wl,-h$@ $(ZTEXT) $(ZDEFS) $(BDIRECT) \ 63 $(C_PICFLAGS) $(MAPFILE:%=-Wl,-M%) \ 64 $(MAPFILE.PGA:%=-Wl,-M%) $(MAPFILE.NED:%=-Wl,-M%) 65$(LIB) := CPPFLAGS += -D_REENTRANT 66$(LIB) := LDLIBS += -lc 67 68$(PROG) := LDLIBS += -lgen 69 70.KEEP_STATE: 71 72.PARALLEL: $(LIB) $(OBJS) 73 74$(PROG): $(OBJS) 75 $(LINK.c) $(OBJS) -o $@ $(LDLIBS) 76 $(POST_PROCESS) 77 78$(LIB): $(SRCDIR)/geniconvtbl.c 79 $(LINK.c) -o $@ $(SRCDIR)/geniconvtbl.c $(LDLIBS) 80 $(POST_PROCESS_SO) 81 82y.tab.c + y.tab.h: $(SRCDIR)/itm_comp.y 83 $(YACC) $(YFLAGS) $(SRCDIR)/itm_comp.y 84 @ $(MV) y.tab.c y.tab.c~ 85 @ $(SED) -f $(SRCDIR)/yacc.sed y.tab.c~ > y.tab.c 86 @ $(RM) y.tab.c~ 87 88lex.yy.c: $(SRCDIR)/itm_comp.l y.tab.h 89 $(LEX) -t $(SRCDIR)/itm_comp.l | $(SED) -f $(SRCDIR)/lex.sed > $(@) 90 91clean: 92 $(RM) $(CLEANFILES) 93 94$(POFILE): $(MSGFILES) 95 $(BUILDPO.msgfiles) 96 97%.o: %.c 98 $(COMPILE.c) $< 99 100%.o: $(SRCDIR)/%.c 101 $(COMPILE.c) $< 102 103%.i: $(SRCDIR)/%.c 104 $(CPPFORPO) $< > $@ 105 106# install rule 107$(ROOTDIRS32)/%: $(ROOTDIRS32) % 108 $(INS.file) 109 110$(ROOTDIRS64)/%: $(ROOTDIRS64) % 111 $(INS.file) 112 113$(ROOTDIRS32): $(ROOTLIB) 114 $(INS.dir) 115 116$(ROOTDIRS64): $(ROOTDIRS32) 117 $(INS.dir) 118 119include $(SRC)/cmd/Makefile.targ 120include $(SRC)/Makefile.msg.targ 121