Back to index

lightning-sunbird  0.9+nobinonly
java.inc
Go to the documentation of this file.
00001 # ***** BEGIN LICENSE BLOCK *****
00002 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003 #
00004 # The contents of this file are subject to the Mozilla Public License Version
00005 # 1.1 (the "License"); you may not use this file except in compliance with
00006 # the License. You may obtain a copy of the License at
00007 # http://www.mozilla.org/MPL/
00008 #
00009 # Software distributed under the License is distributed on an "AS IS" basis,
00010 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011 # for the specific language governing rights and limitations under the
00012 # License.
00013 #
00014 # The Original Code is mozilla.org code.
00015 #
00016 # The Initial Developer of the Original Code is
00017 # Netscape Communications Corporation.
00018 # Portions created by the Initial Developer are Copyright (C) 1998
00019 # the Initial Developer. All Rights Reserved.
00020 #
00021 # Contributor(s):
00022 #
00023 # Alternatively, the contents of this file may be used under the terms of
00024 # either the GNU General Public License Version 2 or later (the "GPL"), or
00025 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026 # in which case the provisions of the GPL or the LGPL are applicable instead
00027 # of those above. If you wish to allow use of your version of this file only
00028 # under the terms of either the GPL or the LGPL, and not to allow others to
00029 # use your version of this file under the terms of the MPL, indicate your
00030 # decision by deleting the provisions above and replace them with the notice
00031 # and other provisions required by the GPL or the LGPL. If you do not delete
00032 # the provisions above, a recipient may use your version of this file under
00033 # the terms of any one of the MPL, the GPL or the LGPL.
00034 #
00035 # ***** END LICENSE BLOCK *****
00036 
00037 !if !defined(VERBOSE)
00038 .SILENT:
00039 !endif
00040 #//------------------------------------------------------------------------
00041 #//
00042 #// This makefile contains all of the rules necessary to build Java Header
00043 #// and Stub files
00044 #//
00045 #//------------------------------------------------------------------------
00046 !if !defined(CONFIG_JAVA_INC)
00047 CONFIG_JAVA_INC=1
00048 
00049 #//------------------------------------------------------------------------
00050 #// Setup to generate Mac java headers (checkout ns/lib/mac/Java
00051 #//------------------------------------------------------------------------
00052 
00053 !ifdef MOZ_GENMAC
00054 MAC_JAVA_HEADERS_DIR = $(DEPTH)/lib/mac/Java
00055 
00056 #//------------------------------------------------------------------------
00057 #// Figure out how to do the pull.
00058 #//------------------------------------------------------------------------
00059 !if "$(MOZ_BRANCH)" != ""
00060 CVS_BRANCH=-r $(MOZ_BRANCH)
00061 HAVE_BRANCH=1
00062 !else
00063 HAVE_BRANCH=0
00064 !endif
00065 
00066 !if "$(MOZ_TIP)" != ""
00067 CVS_BRANCH=-A
00068 !endif
00069 
00070 
00071 !if "$(MOZ_DATE)" != ""
00072 CVS_BRANCH=-D "$(MOZ_DATE)"
00073 HAVE_DATE=1
00074 !else
00075 HAVE_DATE=0
00076 !endif
00077 
00078 !if $(HAVE_DATE) && $(HAVE_BRANCH)
00079 ERR_MESSAGE=$(ERR_MESSAGE)^
00080 Cannot specify both MOZ_BRANCH and MOZ_DATE
00081 !endif
00082 
00083 $(MAC_JAVA_HEADERS_DIR):
00084         @echo +++ Checking out $(MAC_JAVA_HEADERS_DIR) +++
00085         $(PERL) $(DEPTH)/config/cvsco.pl $(CVS_BRANCH) ns/lib/mac/Java
00086         @echo +++ Done Checking out $(MAC_JAVA_HEADERS_DIR) +++
00087 !endif 
00088 
00089 !ifdef JDK_GEN
00090 !ifdef JAVA_OR_OJI
00091 #//------------------------------------------------------------------------
00092 #//
00093 #// Rule to generate Java header files using javah.
00094 #//
00095 #//------------------------------------------------------------------------
00096 $(JDK_GEN):: display_java_header_msg
00097        !$(JAVAH) -d _gen $@
00098 
00099 !ifdef NSBUILDROOT
00100 LINCS = $(LINCS) -I$(JDK_GEN_DIR) -I$(XPDIST)
00101 !else
00102 LINCS = $(LINCS) -I$(JDK_GEN_DIR)
00103 !endif
00104 
00105 display_java_header_msg:
00106        echo +++ make: Generating java header files...
00107 
00108 !ifdef MOZ_GENMAC
00109 $(JDK_GEN)::display_java_header_msg_mac $(MAC_JAVA_HEADERS_DIR)
00110         echo +++ make: creating JDK header for $@
00111         !$(JAVAH) -mac -d $(MAC_JAVA_HEADERS_DIR)/_gen $@
00112          
00113 display_java_header_msg_mac:
00114         echo +++ make: Generating Macintosh JDK header files +++
00115 !endif
00116 !endif # JAVA_OR_OJI
00117 !endif
00118 
00119 
00120 !ifdef JDK_GEN
00121 !ifdef JAVA_OR_OJI
00122 #//------------------------------------------------------------------------
00123 #//
00124 #// Rules to generate Java stub files using javah.
00125 #//
00126 #//------------------------------------------------------------------------
00127 $(JDK_GEN)::display_java_stub_msg 
00128        !$(JAVAH) -stubs -d _stubs $@
00129 
00130 display_java_stub_msg:
00131        echo +++ make: Generating java stub files...
00132 
00133 !ifdef MOZ_GENMAC
00134 $(JDK_GEN)::display_java_stub_msg_mac $(MAC_JAVA_HEADERS_DIR)
00135         echo +++ make: creating JDK stub for $@
00136         !$(JAVAH) -mac -stubs -d $(MAC_JAVA_HEADERS_DIR)/_stubs $@
00137          
00138 display_java_stub_msg_mac:
00139         echo +++ make: Generating Macintosh JDK stub files +++
00140 !endif
00141 
00142 export:: $(JDK_GEN)
00143 
00144 !endif # JAVA_OR_OJI
00145 !endif
00146 
00147 !ifdef JAVA_LIBSTUB_FILES
00148 !ifdef JAVA_OR_OJI
00149 #//------------------------------------------------------------------------
00150 #//
00151 #// Rules to generate libstubs.c using javah.
00152 #//
00153 #//------------------------------------------------------------------------
00154 libstubs.c::$(JAVA_LIBSTUB_FILES)
00155        echo +++ make: Generating libstubs.c...
00156     $(JAVAH) -o libstubs.c -stubs $**
00157 
00158 stubs$(MOZ_BITS).c::$(JAVA_LIBSTUB_FILES)
00159        echo +++ make: Generating stubs$(MOZ_BITS).c...
00160     $(JAVAH) -o stubs$(MOZ_BITS).c -stubs $**
00161 
00162 !endif # JAVA_OR_OJI
00163 !endif
00164 
00165 !ifdef JRI_GEN
00166 !ifdef JAVA_OR_OJI
00167 #//------------------------------------------------------------------------
00168 #//
00169 #// Rule to generate JRI header files using javah.
00170 #//
00171 #//------------------------------------------------------------------------
00172 $(JRI_GEN):: display_jri_header_msg
00173     !$(JAVAH) -jri -d _jri $@
00174 
00175 !ifdef NSBUILDROOT
00176 LINCS = $(LINCS) -I$(JRI_GEN_DIR) -I$(XPDIST)
00177 !else
00178 LINCS = $(LINCS) -I$(JRI_GEN_DIR)
00179 !endif
00180 
00181 display_jri_header_msg:
00182        echo +++ make: Generating JRI header files...
00183 
00184 !ifdef MOZ_GENMAC
00185 $(JRI_GEN)::display_jri_header_msg_mac $(MAC_JAVA_HEADERS_DIR)
00186         echo +++ make: creating JRI header for $@
00187         !$(JAVAH) -mac -jri -d $(MAC_JAVA_HEADERS_DIR)/_jri $@
00188          
00189 display_jri_header_msg_mac:
00190         echo +++ make: Generating Macintosh java JRI header files +++
00191 !endif
00192 !endif # JAVA_OR_OJI
00193 !endif
00194 
00195 !ifdef JRI_GEN
00196 !ifdef JAVA_OR_OJI
00197 #//------------------------------------------------------------------------
00198 #//
00199 #// Rules to generate JRI stub files using javah.
00200 #//
00201 #//------------------------------------------------------------------------
00202 $(JRI_GEN)::display_jri_stub_msg
00203     !$(JAVAH) -stubs -jri -d _jri $@
00204 
00205 display_jri_stub_msg:
00206        echo +++ make: Generating JRI stub files...
00207 
00208 !ifdef MOZ_GENMAC
00209 $(JRI_GEN)::display_jri_stub_msg_mac $(MAC_JAVA_HEADERS_DIR)
00210         echo +++ make: creating JRI stub for $@
00211         !$(JAVAH) -mac -jri -stubs -d $(MAC_JAVA_HEADERS_DIR)/_jri $@
00212          
00213 display_jri_stub_msg_mac:
00214         echo +++ make: Generating Macintosh java JRI stub files +++
00215 !endif
00216 
00217 export:: $(JRI_GEN)
00218 
00219 !endif # JAVA_OR_OJI
00220 !endif
00221 
00222 
00223 !ifdef JNI_GEN
00224 !ifdef JAVA_OR_OJI
00225 #//------------------------------------------------------------------------
00226 #//
00227 #// Rule to generate JNI header files using javah.
00228 #//
00229 #//------------------------------------------------------------------------
00230 $(JNI_GEN):: display_jni_header_msg
00231     !echo $(JAVAH) -jni -d _jni $@
00232     !$(JAVAH) -jni -d _jni $@
00233 
00234 !ifdef NSBUILDROOT
00235 LINCS = $(LINCS) -I$(JNI_GEN_DIR) -I$(XPDIST)
00236 !else
00237 LINCS = $(LINCS) -I$(JNI_GEN_DIR)
00238 !endif
00239 
00240 display_jni_header_msg:
00241        echo +++ make: Generating JNI header files...
00242 
00243 !ifdef MOZ_GENMAC
00244 $(JNI_GEN)::display_jni_header_msg_mac $(MAC_JAVA_HEADERS_DIR)
00245         echo +++ make: creating JRI header for $@
00246         !$(JAVAH) -mac -jni -d $(MAC_JAVA_HEADERS_DIR)/_jni $@
00247          
00248 display_jni_header_msg_mac:
00249         echo +++ make: Generating Macintosh java JNI header files +++
00250 !endif
00251 !endif # JAVA_OR_OJI
00252 export:: $(JNI_GEN)
00253 !endif # JNI_GEN
00254 
00255 !endif # CONFIG_JAVA_INC