move 32-bit libs to lib/i386 subdirs & 64-bit libs to lib/
[unleashed.git] / usr / src / cmd / geniconvtbl / Makefile.com
blob1e84242e0984df36d76b362798309cf3de506de9
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
21 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
22 # Use is subject to license terms.
24 # Copyright (c) 2019, Joyent, Inc.
27 $(NOT_NATIVE)NATIVE_BUILD = $(POUND_SIGN)
29 ITM     = geniconvtbl.so
30 PROG    = geniconvtbl
32 SRCSH1  = iconv_tm.h hash.h
33 SRCCH1  = itmcomp.h itm_util.h maptype.h
34 SRCSC1  = itmcomp.c assemble.c disassemble.c itm_util.c
35 SRCY1   = itm_comp.y
36 SRCL1   = itm_comp.l
37 SRCI1   = geniconvtbl.c
40 YTABC   = y.tab.c
41 YTABH   = y.tab.h
42 LEXYY   = lex.yy.c
43 YOUT    = y.output
44 MAPFILE = ../mapfile
46 SRCSH   = $(SRCSH1:%.h=../%.h)
47 SRCCH   = $(SRCCH1:%.h=../%.h)
48 SRCSC   = $(SRCSC1:%.c=../%.c)
49 SRCI    = $(SRCI1:%.c=../%.c)
50 SRCY    = $(SRCY1:%.y=../%.y)
51 SRCL    = $(SRCL1:%.l=../%.l)
53 SRCYC   = $(SRCY:%.y=%.c)
54 SRCLC   = $(SRCL:%.l=%.c)
56 SRCS    = $(SRCSC) $(YTABC) $(LEXYY)
57 HDRS    = $(SRCCH1) $(ERNOSTRH)
59 SED     = sed
60 LEXSED  = ../lex.sed
61 YACCSED = ../yacc.sed
63 # include ../../../lib/Makefile.lib
64 include ../../Makefile.cmd
67 ROOTDIRS32=     $(ROOTLIB64)/iconv
68 ROOTDIRS64=     $(ROOTLIB64)/iconv/$(MACH64)
69 ROOTITM32 =     $(ROOTDIRS32)/$(ITM)
70 ROOTITM64 =     $(ROOTDIRS64)/$(ITM)
73 # definition for some useful target like clean, 
74 OBJS    = $(SRCSC1:%.c=%.o) $(YTABC:.c=.o) $(LEXYY:.c=.o)
76 CHECKHDRS = $(HDRS%.h=%.check)
78 CLOBBERFILES=   $(ITM) $(SRCYC)
79 CLEANFILES =    $(OBJS) $(YTABC) $(YTABH) $(LEXYY) $(YOUT) \
80                 $(POFILES) $(POFILE)
82 CPPFLAGS        += -I. -I..
83 CERRWARN        += -Wno-uninitialized
84 CERRWARN        += -Wno-unused-label
85 CERRWARN        += -Wno-switch
86 CERRWARN        += -Wno-unused-variable
87 CERRWARN        += -Wno-implicit-function-declaration
88 YFLAGS          += -d -v
90 # dump_expr() is too hairy
91 SMATCH=off
93 $(ITM) :=       CFLAGS += $(GSHARED) $(C_PICFLAGS) $(ZTEXT) -Wl,-h$@
94 $(ITM) :=       sparc_CFLAGS += -mno-app-regs
95 $(ITM) :=       sparcv9_CFLAGS += -mno-app-regs
97 LDLIBS += -lgen
99 MY_NATIVE_CPPFLAGS = -I. -I..
100 MY_NATIVE_LDFLAGS = $(MAPFILE.PGA:%=-Wl,-M%)
101 MY_NATIVE_LDLIBS = -lgen
104 # Message catalog
106 POFILES= $(SRCSC1:%.c=%.po) $(SRCI1:%.c=%.po) \
107                 $(SRCY1:%.y=%.po) $(SRCL1:%.l=%.po)
109 POFILE= geniconvtbl_.po
111 .KEEP_STATE:
113 .PARALLEL: $(ITM) $(OBJS)
115 $(PROG): $(OBJS)
116         $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
117         $(POST_PROCESS)
119 $(ITM): $(SRCI)
120         $(CC) $(CFLAGS) $(CPPFLAGS) -Wl,-M$(MAPFILE) -o $@ $(SRCI) $(LDLIBS)
121         $(POST_PROCESS_SO)
123 $(YTABC) $(YTABH): $(SRCY)
124         $(YACC) $(YFLAGS) $(SRCY)
125         @ $(MV) $(YTABC) $(YTABC)~
126         @ $(SED) -f $(YACCSED) $(YTABC)~ > $(YTABC)
127         @ $(RM) $(YTABC)~
129 $(LEXYY): $(SRCL) $(YTABH)
130         $(LEX) -t $(SRCL) | $(SED) -f $(LEXSED) > $(LEXYY)
133 $(POFILE):  .WAIT $(POFILES)
134         $(RM) $@
135         $(CAT) $(POFILES) >$@
137 $(POFILES): $(SRCSC) $(SRCI) $(SRCY) $(SRCL)
139 %.po:   ../%.c
140         $(COMPILE.cpp) $<  > $<.i
141         $(BUILD.po)
143 hdrchk: $(HDRCHECKS)
145 cstyle: $(SRCS)
146         $(DOT_C_CHECK)
148 clean:
149         $(RM) $(CLEANFILES)
151 debug:
152         $(MAKE) all COPTFLAG='' COPTFLAG64='' CFLAGS='-g -DDEBUG'
155 %.o:    %.c 
156         $(COMPILE.c) $<
158 %.o:    ../%.c
159         $(COMPILE.c) $<
161 # install rule
163 $(ROOTDIRS32)/%: $(ROOTDIRS32) %
164         -$(INS.file)
166 $(ROOTDIRS64)/%: $(ROOTDIRS64) %
167         -$(INS.file)
169 $(ROOTDIRS32): $(ROOTLIB64)
170         -$(INS.dir)
172 $(ROOTDIRS64): $(ROOTDIRS32)
173         -$(INS.dir)
175 $(ROOTLIB64) $(ROOTBIN):
176         -$(INS.dir)
178 include ../../Makefile.targ