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 #
  27 # Makefile for Java Print Manager server
  28 #
  29 
  30 LIBRARY =       libpmgr.a
  31 VERS =          .1
  32 
  33 JNIHDR_FILES =  com_sun_admin_pm_server_DoPrinterNS.h
  34 
  35 OBJECTS =       DoPrinterNS.o NS.o
  36 
  37 CLASSFILES =    Printer.class \
  38                 Host.class \
  39                 SysCommand.class \
  40                 NameService.class \
  41                 PrinterUtil.class \
  42                 DoPrinterView.class \
  43                 DoPrinterAdd.class \
  44                 DoPrinterDelete.class \
  45                 DoPrinterUtil.class \
  46                 DoPrinterMod.class \
  47                 DoPrinterNS.class \
  48                 Valid.class \
  49                 Test.class \
  50                 Debug.class \
  51                 PrinterDebug.class \
  52                 pmException.class \
  53                 pmAuthException.class \
  54                 pmAuthRhostException.class \
  55                 pmCmdFailedException.class \
  56                 pmInternalErrorException.class \
  57                 pmHostNotPingableException.class \
  58                 pmNSNotConfiguredException.class \
  59                 pmMisc.class
  60 
  61 JNICLASSFILES = DoPrinterNS.class
  62 
  63 include         $(SRC)/lib/Makefile.lib
  64 
  65 SRCDIR =        .
  66 
  67 # There should be a mapfile here
  68 MAPFILES =
  69 
  70 CLASSPATH=      $(SRC)/cmd/print/printmgr
  71 
  72 JAVAFILES =     $(CLASSFILES:.class=.java)
  73 
  74 ROOTDIRS =      $(ROOT)/usr/sadm/admin \
  75                 $(ROOT)/usr/sadm/admin/printmgr \
  76                 $(ROOT)/usr/sadm/admin/printmgr/lib
  77 
  78 # override ROOTLIBDIR and ROOTLINKS
  79 ROOTLIBDIR =    $(ROOT)/usr/sadm/admin/printmgr/lib
  80 ROOTLIBS=       $(LIBS:%=$(ROOTLIBDIR)/%)
  81 
  82 
  83 # Following variables define where to find header files
  84 CPPFLAGS +=     -I$(JAVA_ROOT)/include -I$(JAVA_ROOT)/include/solaris -I.
  85 
  86 CERRWARN +=     -_gcc=-Wno-unused-variable
  87 CERRWARN +=     -_gcc=-Wno-uninitialized
  88 
  89 LDLIBS +=       -lprint -lnsl -lsocket -lc
  90 
  91 CLEANFILES=     *.class $(LINTLIB) $(LINTOUT)
  92 CLOBBERFILES=   $(JNIHDR_FILES) $(LIBLINKS)
  93 
  94 all: $(CLASSFILES) $(JNIHDR_FILES) $(DYNLIB)
  95 
  96 install: all $(ROOTDIRS) $(ROOTLINKS)
  97 
  98 #
  99 # Build jni header file
 100 # Use $@ instead of the "unreliable" $*
 101 #
 102 $(JNIHDR_FILES): $(JNICLASSFILES)
 103         $(JAVAH) -jni -classpath $(CLASSPATH) \
 104                 `echo $@ | sed 's/.h$$//' | tr _ .`
 105 
 106 #
 107 # Build standalone programs for testing
 108 #
 109 NS: NS.c
 110         $(CC) NS.c -g $(ILDOFF) -o NS -DMAIN=1 $(ENVLDLIBS1) $(ENVLIBS2) \
 111             -lprint -lnsl -lsocket
 112 
 113 lint: $(JNIHDR_FILES) lintcheck
 114 
 115 cstyle:
 116         cstyle $(SRCS)
 117 
 118 jstyle:
 119         jstyle $(JAVAFILES)
 120 
 121 _msg:
 122 
 123 $(ROOTDIRS):
 124         $(INS.dir)
 125 
 126 include $(SRC)/lib/Makefile.targ