xref: /titanic_52/usr/src/cmd/geniconvtbl/Makefile.com (revision b6805bf78d2bbbeeaea8909a05623587b42d58b3)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
580ab886dSwesolows# Common Development and Distribution License (the "License").
680ab886dSwesolows# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
2124da5b34Srie# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
227c478bd9Sstevel@tonic-gate# Use is subject to license terms.
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gate
2580ab886dSwesolows$(NOT_NATIVE)NATIVE_BUILD = $(POUND_SIGN)
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateITM	= geniconvtbl.so
287c478bd9Sstevel@tonic-gatePROG	= geniconvtbl
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gateSRCSH1  = iconv_tm.h hash.h
317c478bd9Sstevel@tonic-gateSRCCH1  = itmcomp.h itm_util.h maptype.h
327c478bd9Sstevel@tonic-gateSRCSC1  = itmcomp.c assemble.c disassemble.c itm_util.c
337c478bd9Sstevel@tonic-gateSRCY1   = itm_comp.y
347c478bd9Sstevel@tonic-gateSRCL1   = itm_comp.l
357c478bd9Sstevel@tonic-gateSRCI1   = geniconvtbl.c
367c478bd9Sstevel@tonic-gate
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gateYTABC   = y.tab.c
397c478bd9Sstevel@tonic-gateYTABH   = y.tab.h
407c478bd9Sstevel@tonic-gateLEXYY   = lex.yy.c
417c478bd9Sstevel@tonic-gateYOUT    = y.output
427c478bd9Sstevel@tonic-gateMAPFILE	= ../mapfile
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gate
467c478bd9Sstevel@tonic-gateSRCSH	= $(SRCSH1:%.h=../%.h)
477c478bd9Sstevel@tonic-gateSRCCH	= $(SRCCH1:%.h=../%.h)
487c478bd9Sstevel@tonic-gateSRCSC	= $(SRCSC1:%.c=../%.c)
497c478bd9Sstevel@tonic-gateSRCI	= $(SRCI1:%.c=../%.c)
507c478bd9Sstevel@tonic-gateSRCY    = $(SRCY1:%.y=../%.y)
517c478bd9Sstevel@tonic-gateSRCL    = $(SRCL1:%.l=../%.l)
527c478bd9Sstevel@tonic-gate
537c478bd9Sstevel@tonic-gateSRCYC	= $(SRCY:%.y=%.c)
547c478bd9Sstevel@tonic-gateSRCLC	= $(SRCL:%.l=%.c)
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gateSRCS    = $(SRCSC) $(YTABC) $(LEXYY)
577c478bd9Sstevel@tonic-gateHDRS	= $(SRCCH1) $(ERNOSTRH)
587c478bd9Sstevel@tonic-gate
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gateSED	= sed
627c478bd9Sstevel@tonic-gateLEXSED	= ../lex.sed
637c478bd9Sstevel@tonic-gateYACCSED	= ../yacc.sed
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gate
667c478bd9Sstevel@tonic-gate
677c478bd9Sstevel@tonic-gate# include ../../../lib/Makefile.lib
687c478bd9Sstevel@tonic-gateinclude ../../Makefile.cmd
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gateROOTDIRS32=	$(ROOTLIB)/iconv
727c478bd9Sstevel@tonic-gateROOTDIRS64=	$(ROOTLIB)/iconv/$(MACH64)
737c478bd9Sstevel@tonic-gateROOTITM32 =	$(ROOTDIRS32)/$(ITM)
747c478bd9Sstevel@tonic-gateROOTITM64 =	$(ROOTDIRS64)/$(ITM)
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gate#
777c478bd9Sstevel@tonic-gate# definition for some useful target like clean,
787c478bd9Sstevel@tonic-gateOBJS	= $(SRCSC1:%.c=%.o) $(YTABC:.c=.o) $(LEXYY:.c=.o)
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gateCHECKHDRS = $(HDRS%.h=%.check)
817c478bd9Sstevel@tonic-gate
82*b6805bf7SGordon RossCLOBBERFILES=	$(ITM) $(SRCYC)
837c478bd9Sstevel@tonic-gateCLEANFILES = 	$(OBJS) $(YTABC) $(YTABH) $(LEXYY) $(YOUT) \
847c478bd9Sstevel@tonic-gate		$(POFILES) $(POFILE)
857c478bd9Sstevel@tonic-gate
867c478bd9Sstevel@tonic-gateCPPFLAGS	+= -I. -I..
877014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-uninitialized
887014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-label
897014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-switch
907014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-variable
917014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-implicit-function-declaration
927c478bd9Sstevel@tonic-gateYFLAGS		+= -d -v
937c478bd9Sstevel@tonic-gateCFLAGS 		+= -D_FILE_OFFSET_BITS=64
947c478bd9Sstevel@tonic-gate
957c478bd9Sstevel@tonic-gate$(ITM) :=	CFLAGS += $(GSHARED) $(C_PICFLAGS) $(ZTEXT) -h $@
967c478bd9Sstevel@tonic-gate$(ITM) :=	CPPFLAGS += -D_REENTRANT
977c478bd9Sstevel@tonic-gate$(ITM) :=	sparc_CFLAGS += -xregs=no%appl
987c478bd9Sstevel@tonic-gate$(ITM) :=	sparcv9_CFLAGS += -xregs=no%appl
997c478bd9Sstevel@tonic-gate
1007c478bd9Sstevel@tonic-gateLDLIBS += -lgen
1017c478bd9Sstevel@tonic-gate
10280ab886dSwesolowsMY_NATIVE_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -I. -I..
10324da5b34SrieMY_NATIVE_LDFLAGS = $(MAPFILE.NES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
10480ab886dSwesolowsMY_NATIVE_LDLIBS = -lgen
10580ab886dSwesolows
1067c478bd9Sstevel@tonic-gate#
1077c478bd9Sstevel@tonic-gate# Message catalog
1087c478bd9Sstevel@tonic-gate#
1097c478bd9Sstevel@tonic-gatePOFILES= $(SRCSC1:%.c=%.po) $(SRCI1:%.c=%.po) \
1107c478bd9Sstevel@tonic-gate		$(SRCY1:%.y=%.po) $(SRCL1:%.l=%.po)
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gatePOFILE= geniconvtbl_.po
1137c478bd9Sstevel@tonic-gate
1147c478bd9Sstevel@tonic-gate
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gate
1177c478bd9Sstevel@tonic-gate
1187c478bd9Sstevel@tonic-gate.KEEP_STATE:
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gate.PARALLEL: $(ITM) $(OBJS)
1217c478bd9Sstevel@tonic-gate
1227c478bd9Sstevel@tonic-gate$(PROG): $(OBJS)
1237c478bd9Sstevel@tonic-gate	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
1247c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gate$(ITM): $(SRCI)
1277c478bd9Sstevel@tonic-gate	$(CC) $(CFLAGS) $(CPPFLAGS) -M$(MAPFILE) -o $@ $(SRCI) $(LDLIBS)
1287c478bd9Sstevel@tonic-gate	$(POST_PROCESS_SO)
1297c478bd9Sstevel@tonic-gate
1307c478bd9Sstevel@tonic-gate$(YTABC) $(YTABH): $(SRCY)
1317c478bd9Sstevel@tonic-gate	$(YACC) $(YFLAGS) $(SRCY)
1327c478bd9Sstevel@tonic-gate	@ $(MV) $(YTABC) $(YTABC)~
1337c478bd9Sstevel@tonic-gate	@ $(SED) -f $(YACCSED) $(YTABC)~ > $(YTABC)
1347c478bd9Sstevel@tonic-gate	@ $(RM) $(YTABC)~
1357c478bd9Sstevel@tonic-gate
1367c478bd9Sstevel@tonic-gate$(LEXYY): $(SRCL) $(YTABH)
1377c478bd9Sstevel@tonic-gate	$(LEX) -t $(SRCL) | $(SED) -f $(LEXSED) > $(LEXYY)
1387c478bd9Sstevel@tonic-gate
1397c478bd9Sstevel@tonic-gate
1407c478bd9Sstevel@tonic-gate$(POFILE):  .WAIT $(POFILES)
1417c478bd9Sstevel@tonic-gate	$(RM) $@
1427c478bd9Sstevel@tonic-gate	$(CAT) $(POFILES) >$@
1437c478bd9Sstevel@tonic-gate
1447c478bd9Sstevel@tonic-gate$(POFILES): $(SRCSC) $(SRCI) $(SRCY) $(SRCL)
1457c478bd9Sstevel@tonic-gate
1467c478bd9Sstevel@tonic-gate%.po:	../%.c
1477c478bd9Sstevel@tonic-gate	$(COMPILE.cpp) $<  > $<.i
1487c478bd9Sstevel@tonic-gate	$(BUILD.po)
1497c478bd9Sstevel@tonic-gate
1507c478bd9Sstevel@tonic-gate
1517c478bd9Sstevel@tonic-gatelint : lint_SRCS1  lint_SRCS2
1527c478bd9Sstevel@tonic-gate
1537c478bd9Sstevel@tonic-gate
1547c478bd9Sstevel@tonic-gatelint_SRCS1: $(SRCS)
1557c478bd9Sstevel@tonic-gate	$(LINT.c) $(SRCS) $(LDLIBS)
1567c478bd9Sstevel@tonic-gate
1577c478bd9Sstevel@tonic-gatelint_SRCS2: $(SRCI)
1587c478bd9Sstevel@tonic-gate	$(LINT.c) $(SRCI) $(LDLIBS)
1597c478bd9Sstevel@tonic-gate
1607c478bd9Sstevel@tonic-gate
1617c478bd9Sstevel@tonic-gate
1627c478bd9Sstevel@tonic-gatehdrchk: $(HDRCHECKS)
1637c478bd9Sstevel@tonic-gate
1647c478bd9Sstevel@tonic-gatecstyle: $(SRCS)
1657c478bd9Sstevel@tonic-gate	$(DOT_C_CHECK)
1667c478bd9Sstevel@tonic-gate
1677c478bd9Sstevel@tonic-gateclean:
1687c478bd9Sstevel@tonic-gate	$(RM) $(CLEANFILES)
1697c478bd9Sstevel@tonic-gate
1707c478bd9Sstevel@tonic-gatedebug:
1717c478bd9Sstevel@tonic-gate	$(MAKE)	all COPTFLAG='' COPTFLAG64='' CFLAGS='-g -DDEBUG'
1727c478bd9Sstevel@tonic-gate
1737c478bd9Sstevel@tonic-gate
1747c478bd9Sstevel@tonic-gate%.o:	%.c
1757c478bd9Sstevel@tonic-gate	$(COMPILE.c) $<
1767c478bd9Sstevel@tonic-gate
1777c478bd9Sstevel@tonic-gate%.o:	../%.c
1787c478bd9Sstevel@tonic-gate	$(COMPILE.c) $<
1797c478bd9Sstevel@tonic-gate
1807c478bd9Sstevel@tonic-gate
1817c478bd9Sstevel@tonic-gate
1827c478bd9Sstevel@tonic-gate# install rule
1837c478bd9Sstevel@tonic-gate#
1847c478bd9Sstevel@tonic-gate$(ROOTDIRS32)/%: $(ROOTDIRS32) %
1857c478bd9Sstevel@tonic-gate	-$(INS.file)
1867c478bd9Sstevel@tonic-gate
1877c478bd9Sstevel@tonic-gate$(ROOTDIRS64)/%: $(ROOTDIRS64) %
1887c478bd9Sstevel@tonic-gate	-$(INS.file)
1897c478bd9Sstevel@tonic-gate
1907c478bd9Sstevel@tonic-gate$(ROOTDIRS32): $(ROOTLIB)
1917c478bd9Sstevel@tonic-gate	-$(INS.dir)
1927c478bd9Sstevel@tonic-gate
1937c478bd9Sstevel@tonic-gate$(ROOTDIRS64): $(ROOTDIRS32)
1947c478bd9Sstevel@tonic-gate	-$(INS.dir)
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gate$(ROOTLIB) $(ROOTBIN):
1977c478bd9Sstevel@tonic-gate	-$(INS.dir)
1987c478bd9Sstevel@tonic-gate
1997c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ
2007c478bd9Sstevel@tonic-gate
201