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
  27 include ../../../Makefile.master
  28 
  29 LIBRARY= libunistat.a
  30 VERS= .1
  31 
  32 OBJECTS= spcs_s_u.o spcs_log.o
  33 
  34 # include library definitions
  35 include ../../Makefile.lib
  36 
  37 SRCS=           $(OBJECTS:%.o=../common/%.c)
  38 SRCDIR=         ../common
  39 
  40 LIBS    +=      $(DYNLIB) $(LINTLIB)
  41 
  42 # definitions for lint
  43 
  44 LINTFLAGS       += -u -I..
  45 LINTFLAGS       += -erroff=E_UNDEFINED_SYMBOL
  46 LINTFLAGS       += -erroff=E_STATIC_UNUSED
  47 LINTFLAGS       += -erroff=E_BAD_PTR_INT_COMB_ARG
  48 LINTFLAGS       += -erroff=E_VAR_USED_BEFORE_SET
  49 LINTFLAGS       += -erroff=E_SEC_FORBIDDEN_WARN_CFTIME
  50 LINTFLAGS       += -erroff=E_SEC_PRINTF_VAR_FMT
  51 LINTFLAGS       += -erroff=E_OLD_STYLE_DECL_OR_BAD_TYPE
  52 LINTFLAGS       += -erroff=E_YACC_ERROR
  53 LINTFLAGS       += -erroff=E_FUNC_RET_MAYBE_IGNORED2
  54 LINTFLAGS       += -erroff=E_FUNC_RET_ALWAYS_IGNOR2
  55 LINTOUT=        lint.out
  56 LINTOUT_INTER=  lintinter.out
  57 
  58 CERRWARN        += -_gcc=-Wno-parentheses
  59 CERRWARN        += -_gcc=-Wno-unused-variable
  60 
  61 LINTSRC=        $(LINTLIB:%.ln=%)
  62 ROOTLINTDIR=    $(ROOTLIBDIR)
  63 ROOTLINT=       $(LINTSRC:%=$(ROOTLINTDIR)/%)
  64 
  65 CLEANFILES +=   $(LINTOUT) $(LINTLIB) $(LINTOUT_INTER) $(LINT_INTER) 
  66 
  67 all:=     TARGET= all
  68 clean:=   TARGET= clean
  69 clobber:= TARGET= clobber
  70 install:= TARGET= install
  71 lint:=    TARGET= lint
  72 lintinter:=       TARGET= lintinter
  73 
  74 MODS=   dsw \
  75         rdc \
  76         spcs \
  77         sdbc \
  78         solaris \
  79         sv
  80 
  81 ERRS=   $(MODS:%=$(SRCDIR)/%/%.err)
  82 MSGS=   $(MODS:%=$(SRCDIR)/%/%.msg)
  83 EDEFS=  $(MODS:%=$(SRCDIR)/%/%.edef)
  84 TRNKS=  $(MODS:%=$(SRCDIR)/%/%.trnk)
  85 DTRNKS= $(MODS:%=$(SRCDIR)/%/%.dtrnk)
  86 
  87 ERRGEN_DIR=     $(SRC)/cmd/avs/errgen
  88 ERRGEN=         $(ERRGEN_DIR)/errgen
  89 
  90 # production (non-debug)
  91 DFLAGS =        -DISSTATIC=static
  92 
  93 # development (debug) - cstyle prohibits use of "STATIC"
  94 DFLAGS =        -g -DISSTATIC=" "
  95 
  96 CFLAGS +=       $(CCVERBOSE) $(DFLAGS) -I. -DLIBSPCS_CLIENT\
  97                 -I$(JAVAINC) -I$(JAVAINCSOL)\
  98                 -DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
  99 CFLAGS64 +=     $(CCVERBOSE) $(DFLAGS) -I. -DLIBSPCS_CLIENT\
 100                 -I$(JAVAINC) -I$(JAVAINCSOL)\
 101                 -DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\"
 102 LDLIBS +=       -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 
 122 COMMENT=        "/* THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT */"
 123 
 124 CLEANFILES +=   *.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 
 148 all:    spcs_etext.h spcs_errors.h spcs_etrinkets.h spcs_dtrinkets.h $(LIB)
 149 
 150 spcs_dtrinkets.h: $(ERRGEN) $(DTRNKS)
 151         @echo $(COMMENT) > $@
 152         cat $(DTRNKS) >>spcs_dtrinkets.h
 153 
 154 spcs_etrinkets.h: $(ERRGEN) $(TRNKS)
 155         @echo $(COMMENT) > $@
 156         cat $(TRNKS) $(SRCDIR)/spcs_etrinkets.stub >> $@
 157 
 158 spcs_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 
 165 spcs_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 
 175 FRC:
 176 
 177 lint: lintcheck $(LINTLIB)
 178 lintinter: $(LINT_INTER)
 179 
 180 # include library targets
 181 include ../../Makefile.targ
 182 
 183 objs/%.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)