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, Version 1.0 only
   6 # (the "License").  You may not use this file except in compliance
   7 # with the License.
   8 #
   9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 #
  23 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 # ident "%Z%%M% %I%     %E% SMI"
  27 #
  28 
  29 include $(SRC)/Makefile.master
  30 include $(SRC)/cmd/Makefile.cmd
  31 
  32 GUIDIR=$(SRC)/cmd/krb5/kadmin/gui
  33 
  34 TOGETHER= KdcGui KdcGuiMain KdcGuiOps KdcGuiRoot
  35 TOGETHERJ=$(TOGETHER:%=%.java)
  36 TOGETHERC=$(TOGETHER:%=classdir/%.class)
  37 
  38 OTHER=GuiResource GuiResource_en_US HelpData HelpData_en_US
  39 OTHERJ=$(OTHER:%=%.java)
  40 OTHERC=$(OTHER:%=classdir/%.class)
  41 
  42 CLASSES=$(TOGETHER) $(OTHER)
  43 JFILES=$(CLASSES:%=%.java)
  44 CLFILES=$(CLASSES:%=%.class)
  45 
  46 GKADMIN=gkadmin
  47 JARFILE=gkadmin.jar
  48 VISLIB=visualrt.jar
  49 HTML=HelpIndex.html
  50 MSGBUNDLEDIR=$(ROOT)/usr/lib/krb5/ListResourceBundle
  51 
  52 NONEXFILEMODE=444
  53 
  54 #
  55 # Set $KRB5GUILIB
  56 #
  57 KRB5GUILIB=     $(ROOT)/usr/lib/krb5
  58 
  59 $(KRB5GUILIB)/$(JARFILE)        :=      FILEMODE= 444
  60 $(KRB5GUILIB)/$(VISLIB)         :=      FILEMODE= 444
  61 $(KRB5GUILIB)/$(HTML)           :=      FILEMODE= 444
  62 
  63 $(KRB5GUILIB)/%:        %
  64                 $(INS.file)
  65 
  66 .SUFFIXES: .java .class $(SUFFIXES)
  67 
  68 CLASSPATH=$(GUIDIR):$(GUIDIR)/classdir:$(GUIDIR)/util:$(GUIDIR)/dataclasses:$(GUIDIR)/dchanger:$(GUIDIR)/native:$(GUIDIR)/visualrt:$(GUIDIR)/visualrt.jar:$(JAVA_ROOT)/jre/lib/rt.jar:$(JAVA_ROOT)/jre/lib/i18n.jar
  69 
  70 VISRT_CLASSPATH=$(GUIDIR)/visualrt:$(JAVA_ROOT)/jre/lib/rt.jar:$(JAVA_ROOT)/jre/lib/i18n.jar
  71 
  72 classdir/%.class: %.java
  73         $(JAVAC) $(JAVAFLAGS) -d classdir -classpath $(CLASSPATH) $<
  74 
  75 SUBDIRS= util dataclasses dchanger native
  76 VISDIR= visualrt
  77 
  78 def             :=      TARGET= def
  79 all             :=      TARGET= all
  80 install         :=      TARGET= install
  81 install_h       :=      TARGET= install_h
  82 clean           :=      TARGET= clean
  83 clobber         :=      TARGET= clobber
  84 javadoc         :=      TARGET= javadoc
  85 lint            :=      TARGET= lint
  86 clean.lint      :=      TARGET= clean.lint
  87 check           :=      TARGET= check
  88 _msg            :=      TARGET= _msg
  89 
  90 .KEEP_STATE:
  91 
  92 all: $(VISDIR) .WAIT KdcGui.java classdir $(SUBDIRS) all_local
  93 
  94 all_local: $(TOGETHERC) $(OTHERC) $(KRB5SBIN)/$(GKADMIN) \
  95         $(KRB5GUILIB)/$(JARFILE) $(KRB5GUILIB)/$(VISLIB) \
  96         $(KRB5GUILIB)/$(HTML)
  97 
  98 $(TOGETHERC): $(TOGETHERJ) $(VISLIB)
  99         $(JAVAC) $(JAVAFLAGS) -d classdir -classpath $(CLASSPATH) $(TOGETHERJ)
 100 
 101 $(VISLIB):
 102         cd $(VISDIR); $(MAKE) CLASSPATH=$(VISRT_CLASSPATH) install
 103 
 104 $(GKADMIN): $(GKADMIN).template
 105         cat $? | sed -e 's/version_number/$(SEAM_VERS)/' > $@
 106 
 107 classdir: FRC
 108         mkdir -p classdir
 109 
 110 $(VISDIR): FRC
 111         cd $@; $(MAKE) CLASSPATH=$(VISRT_CLASSPATH) $(TARGET)
 112 
 113 $(SUBDIRS): FRC
 114         cd $@; $(MAKE) CLASSPATH=$(CLASSPATH) $(TARGET)
 115 
 116 GuiResource_en_US.java: GuiResource.java
 117         cat $? | sed -e 's/GuiResource/GuiResource_en_US/' > $@
 118 
 119 HelpData_en_US.java: HelpData.java
 120         cat $? | sed -e 's/HelpData/HelpData_en_US/' > $@
 121 
 122 $(JARFILE): classdir/*.class
 123         -$(RM) $(JARFILE)
 124         (cd classdir; $(JAR) cf ../$(JARFILE) *.class)
 125 
 126 KdcGui.java: KdcGuiMain.java KdcGuiOps.java KdcGuiRoot.java
 127 
 128 install: $(VISDIR) .WAIT classdir $(SUBDIRS) install_local
 129 
 130 lint:   native
 131 
 132 ROOTSBINPROGS=  $(KRB5SBIN)/$(GKADMIN)
 133 LIBPROGS=       $(JARFILE) $(VISLIB) $(GIF) $(HTML)
 134 ROOTLIBPROGS=   $(LIBPROGS:%=$(KRB5LIB)/%)
 135 $(ROOTLIBPROGS):=       FILEMODE = 444
 136 
 137 install_local: all_local
 138 
 139 _msg: $(MSGBUNDLEDIR) $(MSGBUNDLEDIR)/GuiResource.java $(MSGBUNDLEDIR)/HelpData.java
 140 
 141 $(MSGBUNDLEDIR)/GuiResource.java $(MSGBUNDLEDIR)/HelpData.java:= FILEMODE = 444
 142 
 143 $(MSGBUNDLEDIR)/%: %
 144         $(INS.file)
 145 
 146 $(MSGBUNDLEDIR):
 147         $(INS.dir)
 148 
 149 javadoc:
 150         $(RM) -rf javadoc
 151         mkdir javadoc
 152         $(JAVADOC) -classpath $(CLASSPATH) -d javadoc *.java \
 153         dataclasses/*.java dchanger/*.java native/*.java util/*.java
 154         cd visualrt ; $(MAKE) CLASSPATH=$(VISRT_CLASSPATH) $@
 155 
 156 test: all
 157         /bin/env \
 158         LD_LIBRARY_PATH=/usr/java/lib:/usr/dt/lib:$(SRC)/cmd/kadmin/gui/native \
 159         /usr/bin/java -classpath \
 160         .:classdir:native:$(VISLIB):)$(ROOT)/usr/java/lib/rt.jar \
 161         KdcGuiMain &
 162 
 163 echo:
 164         @echo $(CLASSES)
 165         @echo $(JFILES)
 166         @echo $(CLFILES)
 167         @echo $(SUFFIXES)
 168 
 169 clobber: $(VISDIR) $(SUBDIRS) clobber_local
 170         -$(RM) visualrt.jar
 171         -$(RM) -rf javadoc
 172 
 173 clean: $(VISDIR) $(SUBDIRS) clean_local
 174 
 175 clobber_local: clean_local
 176 
 177 clean_local:
 178         $(RM) classdir/*.class $(JARFILE) $(GKADMIN) GuiResource_en_US.java HelpData_en_US.java
 179 
 180 FRC: