xref: /titanic_41/usr/src/lib/libunistat/Makefile.com (revision 7535ae1914017b0e648abd7a139aca709fa82be3)
1# CDDL HEADER START
2#
3# The contents of this file are subject to the terms of the
4# Common Development and Distribution License (the "License").
5# You may not use this file except in compliance with the License.
6#
7# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8# or http://www.opensolaris.org/os/licensing.
9# See the License for the specific language governing permissions
10# and limitations under the License.
11#
12# When distributing Covered Code, include this CDDL HEADER in each
13# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14# If applicable, add the following below this CDDL HEADER, with the
15# fields enclosed by brackets "[]" replaced with your own identifying
16# information: Portions Copyright [yyyy] [name of copyright owner]
17#
18# CDDL HEADER END
19#
20#
21# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24# lib/libunistat/Makefile.com
25#
26# include global definitions
27include ../../../Makefile.master
28
29LIBRARY= libunistat.a
30VERS= .1
31
32OBJECTS= spcs_s_u.o spcs_log.o
33
34# include library definitions
35include ../../Makefile.lib
36
37SRCS=		$(OBJECTS:%.o=../common/%.c)
38SRCDIR=		../common
39
40LIBS 	+=	$(DYNLIB) $(LINTLIB)
41
42# definitions for lint
43
44LINTFLAGS	+= -u -I..
45LINTFLAGS	+= -erroff=E_UNDEFINED_SYMBOL
46LINTFLAGS	+= -erroff=E_STATIC_UNUSED
47LINTFLAGS	+= -erroff=E_BAD_PTR_INT_COMB_ARG
48LINTFLAGS	+= -erroff=E_VAR_USED_BEFORE_SET
49LINTFLAGS	+= -erroff=E_SEC_FORBIDDEN_WARN_CFTIME
50LINTFLAGS	+= -erroff=E_SEC_PRINTF_VAR_FMT
51LINTFLAGS	+= -erroff=E_OLD_STYLE_DECL_OR_BAD_TYPE
52LINTFLAGS	+= -erroff=E_YACC_ERROR
53LINTFLAGS	+= -erroff=E_FUNC_RET_MAYBE_IGNORED2
54LINTFLAGS	+= -erroff=E_FUNC_RET_ALWAYS_IGNOR2
55LINTOUT=	lint.out
56LINTOUT_INTER=	lintinter.out
57
58CERRWARN	+= -_gcc=-Wno-parentheses
59CERRWARN	+= -_gcc=-Wno-unused-variable
60
61LINTSRC=	$(LINTLIB:%.ln=%)
62ROOTLINTDIR=	$(ROOTLIBDIR)
63ROOTLINT=	$(LINTSRC:%=$(ROOTLINTDIR)/%)
64
65CLEANFILES +=	$(LINTOUT) $(LINTLIB) $(LINTOUT_INTER) $(LINT_INTER)
66
67all:=	  TARGET= all
68clean:=   TARGET= clean
69clobber:= TARGET= clobber
70install:= TARGET= install
71lint:=	  TARGET= lint
72lintinter:=	  TARGET= lintinter
73
74MODS=	dsw \
75	rdc \
76	spcs \
77	sdbc \
78	solaris \
79	sv
80
81ERRS=	$(MODS:%=$(SRCDIR)/%/%.err)
82MSGS=	$(MODS:%=$(SRCDIR)/%/%.msg)
83EDEFS=	$(MODS:%=$(SRCDIR)/%/%.edef)
84TRNKS=	$(MODS:%=$(SRCDIR)/%/%.trnk)
85DTRNKS=	$(MODS:%=$(SRCDIR)/%/%.dtrnk)
86
87ERRGEN_DIR=	$(SRC)/cmd/avs/errgen
88ERRGEN=		$(ERRGEN_DIR)/errgen
89
90# production (non-debug)
91DFLAGS =	-DISSTATIC=static
92
93# development (debug) - cstyle prohibits use of "STATIC"
94DFLAGS =	-g -DISSTATIC=" "
95
96CFLAGS +=	$(CCVERBOSE) $(DFLAGS) -I. -DLIBSPCS_CLIENT\
97		-I$(JAVAINC) -I$(JAVAINCSOL)\
98		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
99CFLAGS64 +=	$(CCVERBOSE) $(DFLAGS) -I. -DLIBSPCS_CLIENT\
100		-I$(JAVAINC) -I$(JAVAINCSOL)\
101		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
102LDLIBS +=	-lc
103
104$(LINTLIB) :=	SRCS = ../common/llib-lunistat
105$(LINTLIB) :=	LINTFLAGS = -nvx -DLIBSPCS_CLIENT -I$(JAVAINC) -I$(JAVAINCSOL)\
106		-DISSTATIC=static \
107		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
108$(LINTLIB) :=	LINTFLAGS64 = -nvx -Xarch=v9 -DLIBSPCS_CLIENT \
109			-I$(JAVAINC) -I$(JAVAINCSOL) \
110			-DISSTATIC=static \
111		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
112
113$(LINT_INTER) :=	SRCS += ../common/llib-lunistat
114$(LINT_INTER) :=	LINTFLAGS = -nvx -DLIBSPCS_CLIENT -I$(JAVAINC) -I$(JAVAINCSOL)\
115		-DISSTATIC=static \
116		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
117$(LINT_INTER) :=	LINTFLAGS64 = -nvx -Xarch=v9 -DLIBSPCS_CLIENT \
118			-I$(JAVAINC) -I$(JAVAINCSOL) \
119			-DISSTATIC=static \
120		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
121
122COMMENT=	"/* THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT */"
123
124CLEANFILES +=	*.h *.po\
125		$(SRCDIR)/*/*.msg\
126		$(SRCDIR)/*/*.properties\
127		$(SRCDIR)/*/*.exc\
128		$(SRCDIR)/*/*.edef\
129		$(SRCDIR)/*/*.trnk\
130		$(SRCDIR)/*/*.dtrnk
131
132# note that the properties files are generated in ../libspcs/java
133
134.SUFFIXES: .err .exc .properties .edef .msg .trnk .dtrnk
135
136.err.msg:
137	$(ERRGEN) -m `basename $*` <$*.err >$*.msg
138
139.err.edef:
140	$(ERRGEN) -c `basename $*` <$*.err >$*.edef
141
142.err.trnk:
143	$(ERRGEN) -t `basename $*` <$*.err >$*.trnk
144
145.err.dtrnk:
146	$(ERRGEN) -x `basename $*` <$*.err >$*.dtrnk
147
148all:	spcs_etext.h spcs_errors.h spcs_etrinkets.h spcs_dtrinkets.h $(LIB)
149
150spcs_dtrinkets.h: $(ERRGEN) $(DTRNKS)
151	@echo $(COMMENT) > $@
152	cat $(DTRNKS) >>spcs_dtrinkets.h
153
154spcs_etrinkets.h: $(ERRGEN) $(TRNKS)
155	@echo $(COMMENT) > $@
156	cat $(TRNKS) $(SRCDIR)/spcs_etrinkets.stub >> $@
157
158spcs_etext.h: $(ERRGEN) $(MSGS)
159	@echo $(COMMENT) > $@
160	$(CAT) $(MSGS) $(SRCDIR)/spcs_etext.stub >> $@
161	$(SED) "s/	\"/	gettext(\"/" < $@ |\
162		 sed "s/\",/\"),/" > temp
163	xgettext -d unistat temp ; rm temp
164
165spcs_errors.h: $(ERRGEN) $(EDEFS)
166	@echo $(COMMENT) > $@
167	$(CAT) $(EDEFS) $(SRCDIR)/spcs_errors.stub >> $@
168
169$(ERRGEN):
170	@cd $(ERRGEN_DIR); pwd; $(MAKE) install
171
172
173.KEEP_STATE:
174
175FRC:
176
177lint: lintcheck $(LINTLIB)
178lintinter: $(LINT_INTER)
179
180# include library targets
181include ../../Makefile.targ
182
183objs/%.o pics/%.o: ../common/%.c
184	$(COMPILE.c) -o $@ $<
185	$(POST_PROCESS_O)
186
187# install rule for lint library target
188$(ROOTLINTDIR)/%:	../common/%
189	$(INS.file)
190