1
# ***** BEGIN LICENSE BLOCK *****
2
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
# The contents of this file are subject to the Mozilla Public License Version
5
# 1.1 (the "License"); you may not use this file except in compliance with
6
# the License. You may obtain a copy of the License at
7
# http://www.mozilla.org/MPL/
9
# Software distributed under the License is distributed on an "AS IS" basis,
10
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
# for the specific language governing rights and limitations under the
14
# The Original Code is mozilla.org code.
16
# The Initial Developer of the Original Code is
17
# Netscape Communications Corporation.
18
# Portions created by the Initial Developer are Copyright (C) 1998
19
# the Initial Developer. All Rights Reserved.
23
# Alternatively, the contents of this file may be used under the terms of
24
# either of the GNU General Public License Version 2 or later (the "GPL"),
25
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26
# in which case the provisions of the GPL or the LGPL are applicable instead
27
# of those above. If you wish to allow use of your version of this file only
28
# under the terms of either the GPL or the LGPL, and not to allow others to
29
# use your version of this file under the terms of the MPL, indicate your
30
# decision by deleting the provisions above and replace them with the notice
31
# and other provisions required by the GPL or the LGPL. If you do not delete
32
# the provisions above, a recipient may use your version of this file under
33
# the terms of any one of the MPL, the GPL or the LGPL.
35
# ***** END LICENSE BLOCK *****
37
# This file contains make rules for building java files using mozilla's
38
# make system. To use this file, you must include this file before
39
# including rules.mak. Like this:
41
# include <$(DEPTH)\config\javarules.mak>
42
# include <$(DEPTH)\config\rules.mak>
46
!if defined(JAVA_OR_NSJVM)
47
#//------------------------------------------------------------------------
49
#// Rule to recursively make all subdirectories specified by the JDIRS target
51
#//------------------------------------------------------------------------
53
export:: $(JAVA_DESTPATH) $(JDIRS)
55
$(JDIRS):: $(JAVA_DESTPATH) $(TMPDIR)
57
!if "$(WINOS)" == "WIN95"
64
@echo +++ make: building package: $@
65
@echo $(JAVAC_PROG) $(JAVAC_FLAGS) > $(TMPDIR)\javac.cfg
66
-@$(DEPTH)\config\buildpkg $(TMPDIR)\javac.cfg $@
67
@$(RM) $(TMPDIR)\javac.cfg
68
@$(DEPTH)\config\buildpkg $@ $(DEPTH)\dist\classes
72
# compile using symantec cafe's super-speedy compiler!
74
@echo +++ make: building package $@
75
!if "$(WINOS)" == "WIN95"
76
-@$(MKDIR) $(DEPTH)\dist\classes\$(@:/=\)
78
-@$(MKDIR) $(DEPTH)\dist\classes\$@ 2> NUL
80
$(MOZ_TOOLS)\bin\sj -classpath $(JAVA_DESTPATH);$(JAVA_SOURCEPATH) \
81
-d $(JAVA_DESTPATH) $(JAVAC_OPTIMIZER) $@\*.java
87
-for %g in ($(JDIRS)) do $(RM_R) $(XPDIST:/=\)/classes/%g
89
!endif # JAVA_OR_NSJVM
94
#//------------------------------------------------------------------------
98
#// JSRCS .java files to be compiled (.java extension included)
100
#//------------------------------------------------------------------------
101
!if defined(JAVA_OR_NSJVM)
104
JSRCS_DEPS = $(JAVA_DESTPATH) $(JAVA_DESTPATH)\$(PACKAGE) $(TMPDIR)
106
# Can't get moz cafe to compile a single file
109
export:: $(JSRCS_DEPS)
110
@echo +++ make: building package: $(PACKAGE)
111
$(PERL) $(DEPTH)\config\outofdate.pl \
112
-d $(JAVA_DESTPATH)\$(PACKAGE) $(JSRCS) >> $(TMPDIR)\javac.cfg
113
-$(JAVAC_PROG) -argfile $(TMPDIR)\javac.cfg
115
# @$(RM) $(TMPDIR)\javac.cfg
118
# compile using symantec cafe's super-speedy compiler!
119
export:: $(JSRC_DEPS)
120
@echo +++ make: building package: $(PACKAGE)
121
@echo -d $(JAVA_DESTPATH) $(JAVAC_OPTIMIZER) \
122
-classpath $(JAVA_DESTPATH);$(JAVA_SOURCEPATH) > $(TMPDIR)\javac.cfg
123
@$(PERL) $(DEPTH)\config\sj.pl \
124
$(JAVA_DESTPATH)\$(PACKAGE)\ $(TMPDIR)\javac.cfg <<
131
-for %g in ($(JSRCS:.java=.class)) do $(RM) $(XPDIST:/=\)/classes/$(PACKAGE:/=\)/%g
135
#//------------------------------------------------------------------------
139
#// JMC_EXPORT .class files to be copied from XPDIST/classes/PACKAGE to
140
#// XPDIST/jmc (without the .class extension)
142
#//------------------------------------------------------------------------
143
!if defined(JMC_EXPORT)
144
export:: $(JMCSRCDIR)
145
for %g in ($(JMC_EXPORT)) do $(MAKE_INSTALL:/=\) $(JAVA_DESTPATH)\$(PACKAGE:/=\)\%g.class $(JMCSRCDIR)
148
-for %f in ($(JMC_EXPORT)) do $(RM) $(JMCSRCDIR:/=\)\%f.class
150
!endif # JAVA_OR_NSJVM
152
#//------------------------------------------------------------------------
156
#// JMC_GEN Names of classes to be run through JMC
157
#// Generated .h and .c files go to JMC_GEN_DIR
159
#//------------------------------------------------------------------------
160
!if defined(JAVA_OR_NSJVM)
163
export:: $(JMC_HEADERS)
165
# Don't delete them if they don't compile (makes it hard to debug)
166
.PRECIOUS: $(JMC_HEADERS) $(JMC_STUBS)
169
# They may want to generate/compile the stubs
171
{$(JMC_GEN_DIR)\}.c{$(OBJDIR)\}.obj:
177
$(JMC_GEN_DIR)\$(*B).c
180
export:: $(JMC_STUBS) $(OBJDIR) $(JMC_OBJS)
184
!endif # JAVA_OR_NSJVM