10063 basic support for smatch
[unleashed.git] / usr / src / cmd / geniconvtbl / Makefile.com
blob95049755ef4256e8e34d8d532ed113c10c6542c0
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
48 SRCSH   = $(SRCSH1:%.h=../%.h)
49 SRCCH   = $(SRCCH1:%.h=../%.h)
50 SRCSC   = $(SRCSC1:%.c=../%.c)
51 SRCI    = $(SRCI1:%.c=../%.c)
52 SRCY    = $(SRCY1:%.y=../%.y)
53 SRCL    = $(SRCL1:%.l=../%.l)
55 SRCYC   = $(SRCY:%.y=%.c)
56 SRCLC   = $(SRCL:%.l=%.c)
58 SRCS    = $(SRCSC) $(YTABC) $(LEXYY)
59 HDRS    = $(SRCCH1) $(ERNOSTRH)
63 SED     = sed
64 LEXSED  = ../lex.sed
65 YACCSED = ../yacc.sed
69 # include ../../../lib/Makefile.lib
70 include ../../Makefile.cmd
73 ROOTDIRS32=     $(ROOTLIB)/iconv
74 ROOTDIRS64=     $(ROOTLIB)/iconv/$(MACH64)
75 ROOTITM32 =     $(ROOTDIRS32)/$(ITM)
76 ROOTITM64 =     $(ROOTDIRS64)/$(ITM)
79 # definition for some useful target like clean, 
80 OBJS    = $(SRCSC1:%.c=%.o) $(YTABC:.c=.o) $(LEXYY:.c=.o)
82 CHECKHDRS = $(HDRS%.h=%.check)
84 CLOBBERFILES=   $(ITM) $(SRCYC)
85 CLEANFILES =    $(OBJS) $(YTABC) $(YTABH) $(LEXYY) $(YOUT) \
86                 $(POFILES) $(POFILE)
88 CPPFLAGS        += -I. -I..
89 CERRWARN        += -_gcc=-Wno-uninitialized
90 CERRWARN        += -_gcc=-Wno-unused-label
91 CERRWARN        += -_gcc=-Wno-switch
92 CERRWARN        += -_gcc=-Wno-unused-variable
93 CERRWARN        += -_gcc=-Wno-implicit-function-declaration
94 YFLAGS          += -d -v
95 CFLAGS          += -D_FILE_OFFSET_BITS=64
97 # dump_expr() is too hairy
98 SMATCH=off
100 $(ITM) :=       CFLAGS += $(GSHARED) $(C_PICFLAGS) $(ZTEXT) -h$@
101 $(ITM) :=       CPPFLAGS += -D_REENTRANT 
102 $(ITM) :=       sparc_CFLAGS += -xregs=no%appl
103 $(ITM) :=       sparcv9_CFLAGS += -xregs=no%appl
105 LDLIBS += -lgen
107 MY_NATIVE_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -I. -I..
108 MY_NATIVE_LDFLAGS = $(MAPFILE.NES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
109 MY_NATIVE_LDLIBS = -lgen
112 # Message catalog
114 POFILES= $(SRCSC1:%.c=%.po) $(SRCI1:%.c=%.po) \
115                 $(SRCY1:%.y=%.po) $(SRCL1:%.l=%.po)
117 POFILE= geniconvtbl_.po
123 .KEEP_STATE:
125 .PARALLEL: $(ITM) $(OBJS)
127 $(PROG): $(OBJS)
128         $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
129         $(POST_PROCESS)
131 $(ITM): $(SRCI)
132         $(CC) $(CFLAGS) $(CPPFLAGS) -M$(MAPFILE) -o $@ $(SRCI) $(LDLIBS)
133         $(POST_PROCESS_SO)
135 $(YTABC) $(YTABH): $(SRCY)
136         $(YACC) $(YFLAGS) $(SRCY)
137         @ $(MV) $(YTABC) $(YTABC)~
138         @ $(SED) -f $(YACCSED) $(YTABC)~ > $(YTABC)
139         @ $(RM) $(YTABC)~
141 $(LEXYY): $(SRCL) $(YTABH)
142         $(LEX) -t $(SRCL) | $(SED) -f $(LEXSED) > $(LEXYY)
145 $(POFILE):  .WAIT $(POFILES)
146         $(RM) $@
147         $(CAT) $(POFILES) >$@
149 $(POFILES): $(SRCSC) $(SRCI) $(SRCY) $(SRCL)
151 %.po:   ../%.c
152         $(COMPILE.cpp) $<  > $<.i
153         $(BUILD.po)
156 lint : lint_SRCS1  lint_SRCS2
159 lint_SRCS1: $(SRCS)
160         $(LINT.c) $(SRCS) $(LDLIBS)
162 lint_SRCS2: $(SRCI)
163         $(LINT.c) $(SRCI) $(LDLIBS)
167 hdrchk: $(HDRCHECKS)
169 cstyle: $(SRCS)
170         $(DOT_C_CHECK)
172 clean:
173         $(RM) $(CLEANFILES)
175 debug:
176         $(MAKE) all COPTFLAG='' COPTFLAG64='' CFLAGS='-g -DDEBUG'
179 %.o:    %.c 
180         $(COMPILE.c) $<
182 %.o:    ../%.c
183         $(COMPILE.c) $<
187 # install rule
189 $(ROOTDIRS32)/%: $(ROOTDIRS32) %
190         -$(INS.file)
192 $(ROOTDIRS64)/%: $(ROOTDIRS64) %
193         -$(INS.file)
195 $(ROOTDIRS32): $(ROOTLIB)
196         -$(INS.dir)
198 $(ROOTDIRS64): $(ROOTDIRS32)
199         -$(INS.dir)
201 $(ROOTLIB) $(ROOTBIN):
202         -$(INS.dir)
204 include ../../Makefile.targ