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 
  68 LINTFLAGS +=    -L$(SRC)/lib/libpicltree/$(MACH) -lpicltree
  69 
  70 .KEEP_STATE:
  71 
  72 SUBDIRS=
  73 
  74 POFILE= piclevent.po
  75 
  76 all :=          TARGET= all
  77 install :=      TARGET= install
  78 clean :=        TARGET= clean
  79 clobber :=      TARGET= clobber
  80 lint :=         TARGET= lint
  81 _msg :=         TARGET= _msg
  82 
  83 all: $(LIBS) $(LIBLINKS) $(MODULES)
  84 
  85 install:        $(ROOTLIBDIR) all $(ROOTLIBS) $(ROOTLINKS) \
  86         $(ROOTETCSYSEVENTDIR)           \
  87         $(ROOTLIBSYSEVENTDIR)           \
  88         $(ROOTLIBSYSEVENTMODDIR)        \
  89         $(ROOTLIBSYSEVENTMODULES)
  90 
  91 _msg:   $(MSGDOMAIN) $(POFILE)
  92         $(RM) $(MSGDOMAIN)/$(POFILE)
  93         $(CP) $(POFILE) $(MSGDOMAIN)
  94 
  95 
  96 $(MSGDOMAIN):
  97         $(INS.dir)
  98 
  99 $(LIBLINKS):    FRC
 100         $(RM) $@; $(SYMLINK) $(DYNLIB) $@
 101 
 102 # include library targets
 103 include $(SRC)/cmd/picl/plugins/Makefile.targ
 104 include $(SRC)/lib/Makefile.targ
 105 
 106 lint :
 107         $(LINT.c) $(SRCS)
 108 
 109 %.so: %.o
 110         $(LINK.c) -o $@ $(GSHARED) -h $@ $< $(MOD_LDLIBS)
 111 
 112 %.o: %.c
 113         $(COMPILE.c) -o $@ $<
 114 
 115 $(SUBDIRS): FRC
 116         @cd $@; pwd; $(MAKE) $(TARGET)
 117 
 118 $(ROOTLIBSYSEVENTDIR):
 119         $(INS.dir)
 120 
 121 $(ROOTETCSYSEVENTDIR):
 122         $(INS.dir)
 123 
 124 $(ROOTLIBSYSEVENTDIR)/%: %
 125         $(INS.file)
 126 
 127 $(ROOTLIBSYSEVENTMODDIR):
 128         $(INS.dir)
 129 
 130 $(ROOTLIBSYSEVENTMODDIR)/%.so: %.so
 131         $(INS.file)
 132 
 133 FRC: