summaryrefslogtreecommitdiff
path: root/usr/src/lib/libunistat/Makefile.com
blob: 522a938a4b268b3006f3d7d7dcd996f5d8bda8fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# lib/libunistat/Makefile.com
#
# include global definitions
include ../../../Makefile.master

LIBRARY= libunistat.a
VERS= .1

OBJECTS= spcs_s_u.o spcs_log.o

# include library definitions
include ../../Makefile.lib

SRCS=		$(OBJECTS:%.o=../common/%.c)
SRCDIR=		../common

LIBS 	+=	$(DYNLIB) $(LINTLIB)

# definitions for lint

LINTFLAGS	+= -u -I..
LINTFLAGS	+= -erroff=E_UNDEFINED_SYMBOL
LINTFLAGS	+= -erroff=E_STATIC_UNUSED
LINTFLAGS	+= -erroff=E_BAD_PTR_INT_COMB_ARG
LINTFLAGS	+= -erroff=E_VAR_USED_BEFORE_SET
LINTFLAGS	+= -erroff=E_SEC_FORBIDDEN_WARN_CFTIME
LINTFLAGS	+= -erroff=E_SEC_PRINTF_VAR_FMT
LINTFLAGS	+= -erroff=E_OLD_STYLE_DECL_OR_BAD_TYPE
LINTFLAGS	+= -erroff=E_YACC_ERROR
LINTFLAGS	+= -erroff=E_FUNC_RET_MAYBE_IGNORED2
LINTFLAGS	+= -erroff=E_FUNC_RET_ALWAYS_IGNOR2
LINTOUT=	lint.out
LINTOUT_INTER=	lintinter.out

CERRWARN	+= -_gcc=-Wno-parentheses
CERRWARN	+= -_gcc=-Wno-unused-variable

LINTSRC=	$(LINTLIB:%.ln=%)
ROOTLINTDIR=	$(ROOTLIBDIR)
ROOTLINT=	$(LINTSRC:%=$(ROOTLINTDIR)/%)

CLEANFILES +=	$(LINTOUT) $(LINTLIB) $(LINTOUT_INTER) $(LINT_INTER) 

all:=	  TARGET= all
clean:=   TARGET= clean
clobber:= TARGET= clobber
install:= TARGET= install
lint:=	  TARGET= lint
lintinter:=	  TARGET= lintinter

MODS=	dsw \
	rdc \
	spcs \
	sdbc \
	solaris \
	sv

ERRS=	$(MODS:%=$(SRCDIR)/%/%.err)
MSGS=	$(MODS:%=$(SRCDIR)/%/%.msg)
EDEFS=	$(MODS:%=$(SRCDIR)/%/%.edef)
TRNKS=	$(MODS:%=$(SRCDIR)/%/%.trnk)
DTRNKS=	$(MODS:%=$(SRCDIR)/%/%.dtrnk)

ERRGEN_DIR=	$(SRC)/cmd/avs/errgen
ERRGEN=		$(ERRGEN_DIR)/errgen

# production (non-debug)
DFLAGS =	-DISSTATIC=static

# development (debug) - cstyle prohibits use of "STATIC"
DFLAGS =	-g -DISSTATIC=" "

CFLAGS +=	$(CCVERBOSE) $(DFLAGS) -I. -DLIBSPCS_CLIENT\
		-I$(JAVAINC) -I$(JAVAINCSOL)\
		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
CFLAGS64 +=	$(CCVERBOSE) $(DFLAGS) -I. -DLIBSPCS_CLIENT\
		-I$(JAVAINC) -I$(JAVAINCSOL)\
		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
LDLIBS +=	-lc

$(LINTLIB) :=	SRCS = ../common/llib-lunistat
$(LINTLIB) :=	LINTFLAGS = -nvx -DLIBSPCS_CLIENT -I$(JAVAINC) -I$(JAVAINCSOL)\
		-DISSTATIC=static \
		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
$(LINTLIB) :=	LINTFLAGS64 = -nvx -Xarch=v9 -DLIBSPCS_CLIENT \
			-I$(JAVAINC) -I$(JAVAINCSOL) \
			-DISSTATIC=static \
		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"

$(LINT_INTER) :=	SRCS += ../common/llib-lunistat
$(LINT_INTER) :=	LINTFLAGS = -nvx -DLIBSPCS_CLIENT -I$(JAVAINC) -I$(JAVAINCSOL)\
		-DISSTATIC=static \
		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
$(LINT_INTER) :=	LINTFLAGS64 = -nvx -Xarch=v9 -DLIBSPCS_CLIENT \
			-I$(JAVAINC) -I$(JAVAINCSOL) \
			-DISSTATIC=static \
		-DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"

COMMENT=	"/* THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT */"

CLEANFILES +=	*.h *.po\
		$(SRCDIR)/*/*.msg\
		$(SRCDIR)/*/*.properties\
		$(SRCDIR)/*/*.exc\
		$(SRCDIR)/*/*.edef\
		$(SRCDIR)/*/*.trnk\
		$(SRCDIR)/*/*.dtrnk

# note that the properties files are generated in ../libspcs/java

.SUFFIXES: .err .exc .properties .edef .msg .trnk .dtrnk

.err.msg: 
	$(ERRGEN) -m `basename $*` <$*.err >$*.msg

.err.edef:
	$(ERRGEN) -c `basename $*` <$*.err >$*.edef

.err.trnk:
	$(ERRGEN) -t `basename $*` <$*.err >$*.trnk

.err.dtrnk:
	$(ERRGEN) -x `basename $*` <$*.err >$*.dtrnk

all:	spcs_etext.h spcs_errors.h spcs_etrinkets.h spcs_dtrinkets.h $(LIB)

spcs_dtrinkets.h: $(ERRGEN) $(DTRNKS)
	@echo $(COMMENT) > $@
	cat $(DTRNKS) >>spcs_dtrinkets.h

spcs_etrinkets.h: $(ERRGEN) $(TRNKS)
	@echo $(COMMENT) > $@
	cat $(TRNKS) $(SRCDIR)/spcs_etrinkets.stub >> $@

spcs_etext.h: $(ERRGEN) $(MSGS)
	@echo $(COMMENT) > $@
	$(CAT) $(MSGS) $(SRCDIR)/spcs_etext.stub >> $@
	$(SED) "s/	\"/	gettext(\"/" < $@ |\
		 sed "s/\",/\"),/" > temp 
	xgettext -d unistat temp ; rm temp

spcs_errors.h: $(ERRGEN) $(EDEFS)
	@echo $(COMMENT) > $@
	$(CAT) $(EDEFS) $(SRCDIR)/spcs_errors.stub >> $@

$(ERRGEN):
	@cd $(ERRGEN_DIR); pwd; $(MAKE) install


.KEEP_STATE:

FRC:

lint: lintcheck $(LINTLIB)
lintinter: $(LINT_INTER)

# include library targets
include ../../Makefile.targ

objs/%.o pics/%.o: ../common/%.c
	$(COMPILE.c) -o $@ $<
	$(POST_PROCESS_O)

# install rule for lint library target
$(ROOTLINTDIR)/%:	../common/%
	$(INS.file)