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