1 #
   2 # CDDL HEADER START
   3 #
   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.
   7 #
   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.
  12 #
  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]
  18 #
  19 # CDDL HEADER END
  20 #
  21 #
  22 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23 # Use is subject to license terms.
  24 #
  25 
  26 LIBRARY=        libpiclevent.a
  27 VERS=           .1
  28 
  29 OBJECTS=        piclevent.o
  30 
  31 # include library definitions
  32 include $(SRC)/lib/Makefile.lib
  33 
  34 include $(SRC)/cmd/picl/plugins/Makefile.com
  35 
  36 MODULES = picl_slm.so
  37 MOD_SRCS = picl_slm.c
  38 MOD_OBJS = picl_slm.o
  39 MOD_LDLIBS = -L$(ROOT)/usr/lib -lsysevent -lnvpair -lc
  40 
  41 # sysevent SLM dirs
  42 SYSEVENT = sysevent
  43 MODDIR = modules
  44 ROOTLIBSYSEVENTDIR = $(ROOTLIB)/$(SYSEVENT)
  45 ROOTLIBSYSEVENTMODDIR = $(ROOTLIBSYSEVENTDIR)/$(MODDIR)
  46 ROOTLIBSYSEVENTMODULES = $(MODULES:%=$(ROOTLIBSYSEVENTMODDIR)/%)
  47 ROOTETCSYSEVENTDIR = $(ROOTETC)/$(SYSEVENT)
  48 
  49 SRCS=           $(OBJECTS:%.o=%.c)
  50 
  51 LIBS =          $(DYNLIB)
  52 
  53 ROOTLIBDIR =    $(USR_LIB_PLUGINDIR)
  54 ROOTETC =       $(ROOT)/etc
  55 ROOTLIB =       $(ROOT)/usr/lib
  56 
  57 CLEANFILES=     $(LINTOUT) $(LINTLIB) $(MOD_OBJS)
  58 CLOBBERFILES += $(LIBLINKS)
  59 CLOBBERFILES += $(MODULES)
  60 
  61 CPPFLAGS +=     -I$(SRC)/lib/libsysevent -I$(SRC)/uts/sun
  62 
  63 CFLAGS +=       $(CCVERBOSE) $(C_PICFLAGS)
  64 CPPFLAGS +=     -D_REENTRANT
  65 LDLIBS +=       -L$(SRC)/lib/libsysevent -L$(SRC)/lib/libpicltree/$(MACH)
  66 LDLIBS +=       -lc -lpicltree -lnvpair
  67 LDFLAGS +=      -Bdirect
  68 
  69 LINTFLAGS +=    -L$(SRC)/lib/libpicltree/$(MACH) -lpicltree
  70 
  71 .KEEP_STATE:
  72 
  73 SUBDIRS=
  74 
  75 POFILE= piclevent.po
  76 
  77 all :=          TARGET= all
  78 install :=      TARGET= install
  79 clean :=        TARGET= clean
  80 clobber :=      TARGET= clobber
  81 lint :=         TARGET= lint
  82 _msg :=         TARGET= _msg
  83 
  84 all: $(LIBS) $(LIBLINKS) $(MODULES)
  85 
  86 install:        $(ROOTLIBDIR) all $(ROOTLIBS) $(ROOTLINKS) \
  87         $(ROOTETCSYSEVENTDIR)           \
  88         $(ROOTLIBSYSEVENTDIR)           \
  89         $(ROOTLIBSYSEVENTMODDIR)        \
  90         $(ROOTLIBSYSEVENTMODULES)
  91 
  92 _msg:   $(MSGDOMAIN) $(POFILE)
  93         $(RM) $(MSGDOMAIN)/$(POFILE)
  94         $(CP) $(POFILE) $(MSGDOMAIN)
  95 
  96 
  97 $(MSGDOMAIN):
  98         $(INS.dir)
  99 
 100 $(LIBLINKS):    FRC
 101         $(RM) $@; $(SYMLINK) $(DYNLIB) $@
 102 
 103 # include library targets
 104 include $(SRC)/cmd/picl/plugins/Makefile.targ
 105 include $(SRC)/lib/Makefile.targ
 106 
 107 lint :
 108         $(LINT.c) $(SRCS)
 109 
 110 %.so: %.o
 111         $(LINK.c) -o $@ $(GSHARED) -h $@ $< $(MOD_LDLIBS)
 112 
 113 %.o: %.c
 114         $(COMPILE.c) -o $@ $<
 115 
 116 $(SUBDIRS): FRC
 117         @cd $@; pwd; $(MAKE) $(TARGET)
 118 
 119 $(ROOTLIBSYSEVENTDIR):
 120         $(INS.dir)
 121 
 122 $(ROOTETCSYSEVENTDIR):
 123         $(INS.dir)
 124 
 125 $(ROOTLIBSYSEVENTDIR)/%: %
 126         $(INS.file)
 127 
 128 $(ROOTLIBSYSEVENTMODDIR):
 129         $(INS.dir)
 130 
 131 $(ROOTLIBSYSEVENTMODDIR)/%.so: %.so
 132         $(INS.file)
 133 
 134 FRC: