javarules.mk 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. #
  2. # BEGIN COPYRIGHT BLOCK
  3. # This Program is free software; you can redistribute it and/or modify it under
  4. # the terms of the GNU General Public License as published by the Free Software
  5. # Foundation; version 2 of the License.
  6. #
  7. # This Program is distributed in the hope that it will be useful, but WITHOUT
  8. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. #
  11. # You should have received a copy of the GNU General Public License along with
  12. # this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  13. # Place, Suite 330, Boston, MA 02111-1307 USA.
  14. #
  15. # In addition, as a special exception, Red Hat, Inc. gives You the additional
  16. # right to link the code of this Program with code not covered under the GNU
  17. # General Public License ("Non-GPL Code") and to distribute linked combinations
  18. # including the two, subject to the limitations in this paragraph. Non-GPL Code
  19. # permitted under this exception must only link to the code of this Program
  20. # through those well defined interfaces identified in the file named EXCEPTION
  21. # found in the source code files (the "Approved Interfaces"). The files of
  22. # Non-GPL Code may instantiate templates or use macros or inline functions from
  23. # the Approved Interfaces without causing the resulting work to be covered by
  24. # the GNU General Public License. Only Red Hat, Inc. may make changes or
  25. # additions to the list of Approved Interfaces. You must obey the GNU General
  26. # Public License in all respects for all of the Program code and other code used
  27. # in conjunction with the Program except the Non-GPL Code covered by this
  28. # exception. If you modify this file, you may extend this exception to your
  29. # version of the file, but you are not obligated to do so. If you do not wish to
  30. # provide this exception without modification, you must delete this exception
  31. # statement from your version and license this file solely under the GPL without
  32. # exception.
  33. #
  34. #
  35. # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  36. # Copyright (C) 2005 Red Hat, Inc.
  37. # All rights reserved.
  38. # END COPYRIGHT BLOCK
  39. #
  40. # javarules.mk
  41. #
  42. # Identify tools, directories, classpath for building the Directory
  43. # console
  44. # Where the source root is
  45. JAVA_SRC_DIR=$(ABS_ROOT)/ldap/admin/src/java
  46. # Where the class files go
  47. JAVA_BUILD_DIR=$(ABS_ROOT)/built/java/$(BUILD_DEBUG)/admin
  48. JAVA_DEST_DIR=$(BUILD_ROOT)/built/java/$(BUILD_DEBUG)
  49. CLASS_DIR=$(JAVA_DEST_DIR)/admin
  50. DSADMIN_DIR=$(CLASS_DIR)/com/netscape/admin
  51. # Where docs go
  52. DSADMIN_DOC_DIR=$(JAVA_DEST_DIR)/doc
  53. # Java setup ##############################################
  54. # disable optimized builds for now until we can figure out why
  55. # optimized doesn't build . . .
  56. ifeq ($(BUILD_DEBUG),optimize)
  57. # JAVAFLAGS=-O
  58. JAVAFLAGS=
  59. else
  60. JAVAFLAGS=-g
  61. endif
  62. PATH_SEP := :
  63. ifeq ($(OS), Windows_NT)
  64. GET_JAVA_FROM_PATH := 1
  65. PATH_SEP := ;
  66. EXE_SUFFIX := .exe
  67. endif
  68. # For NT, assume a locally installed JDK
  69. ifdef GET_JAVA_FROM_PATH
  70. # Figure out where the java lib .jar files are, from where javac is
  71. JDKCOMP := $(shell which javac)
  72. JDKPRELIB := $(subst bin/javac$(EXE_SUFFIX),lib,$(JDKCOMP))
  73. JDKLIB := $(addprefix $(JDKPRELIB)/,tools.jar)
  74. else
  75. # For UNIX, use JDK and JAR files over NFS
  76. # Use NT classes.zip; doesn't matter that it was compiled on NT
  77. #
  78. # Version 1.4.0_01 of the JDK does not seem to run well on RHEL 3.0
  79. ifeq ($(ARCH), Linux)
  80. JDK_VERSION=1.4.2
  81. else
  82. ifeq ($(ARCH), HPUX)
  83. JDK_VERSION=1.4.1_05
  84. else
  85. JDK_VERSION=1.4.0_01
  86. endif
  87. endif
  88. JDK_VERSDIR=jdk$(JDK_VERSION)
  89. JDKLIB=/share/builds/components/jdk/$(JDK_VERSION)/$(PRETTY_ARCH)/lib/tools.jar
  90. ifeq ($(NSOS_ARCH), IRIX)
  91. # Get IRIX compiler from tools directory, currently 1.1.3
  92. JAVABINDIR=/tools/ns/bin
  93. else
  94. ifeq ($(ARCH), AIX)
  95. # Get AIX compiler from tools directory, currently 1.1.2
  96. JAVABINDIR=/tools/ns/bin
  97. else
  98. ifeq ($(ARCH), OSF1)
  99. JAVABINDIR=/share/builds/components/jdk/1.1.6beta/OSF1/bin
  100. else
  101. # Solaris, Linux, HP/UX and any others:
  102. JDK_DIR=$(COMPONENTS_DIR)/jdk
  103. JAVABINDIR=$(JDK_DIR)/$(JDK_VERSION)/$(PRETTY_ARCH)/bin
  104. endif
  105. endif
  106. endif
  107. endif
  108. CLASSPATH := $(JAVA_SRC_DIR)$(PATH_SEP)$(NMCLFJARFILE)$(PATH_SEP)$(LDAPJARFILE)$(PATH_SEP)$(MCCJARFILE)$(PATH_SEP)$(JAVASSLJARFILE)$(PATH_SEP)$(BASEJARFILE)$(PATH_SEP)$(JSSJARFILE)
  109. #CLASSPATH := $(JAVA_SRC_DIR)$(PATH_SEP)$(SWINGJARFILE)$(PATH_SEP)$(NMCLFJARFILE)$(PATH_SEP)$(LDAPJARFILE)$(PATH_SEP)$(MCCJARFILE)$(PATH_SEP)$(JAVASSLJARFILE)$(PATH_SEP)$(BASEJARFILE)
  110. RUNCLASSPATH:=$(JAVA_BUILD_DIR) $(PACKAGE_UNDER_JAVA)
  111. ifndef JAVA
  112. ifdef JAVABINDIR
  113. JAVA= $(JAVABINDIR)/java
  114. else
  115. JAVA=java
  116. endif
  117. endif
  118. # Some java compilers run out of memory, so must be run as follows
  119. JAVAC_PROG=-mx32m sun.tools.javac.Main
  120. HEAVY_JAVAC=$(JAVA) $(JAVAC_PROG) $(JAVAFLAGS)
  121. ifndef JAVAC
  122. ifdef JAVABINDIR
  123. JAVAC= $(JAVABINDIR)/javac $(JAVAFLAGS)
  124. else
  125. JAVAC= javac $(JAVAFLAGS)
  126. endif
  127. endif
  128. ifndef JAVADOC
  129. JAVADOC=$(JAVA) -mx64m sun.tools.javadoc.Main -classpath "$(CLASSPATH)"
  130. endif
  131. # How to run ant (the Java "make" system)
  132. ANT = $(JAVA) -Dant.home=$(ANT_HOME) -classpath "$(ANT_CP)$(PATH_SEP)$(JDKLIB)" org.apache.tools.ant.Main
  133. ##########################################################