Bug 459878, fix up errors for 3.0.5 -> 3.1b2 MU test
[mozilla-1.9.git] / config / javarules.mak
blob1a81b727f0e9580e59b5150183ae233cd7ae34e1
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
12 # License.
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.
21 # Contributor(s):
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>
45 !ifdef JDIRS
46 !if defined(JAVA_OR_NSJVM)
47 #//------------------------------------------------------------------------
48 #//
49 #// Rule to recursively make all subdirectories specified by the JDIRS target
50 #//
51 #//------------------------------------------------------------------------
53 export:: $(JAVA_DESTPATH) $(JDIRS)
55 $(JDIRS):: $(JAVA_DESTPATH) $(TMPDIR)
57 !if "$(WINOS)" == "WIN95"
58 JDIRS = $(JDIRS:/=\)
59 !endif
61 !if defined(NO_CAFE)
63 $(JDIRS)::
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
70 !else
72 # compile using symantec cafe's super-speedy compiler!
73 $(JDIRS)::
74 @echo +++ make: building package $@
75 !if "$(WINOS)" == "WIN95"
76 -@$(MKDIR) $(DEPTH)\dist\classes\$(@:/=\)
77 !else
78 -@$(MKDIR) $(DEPTH)\dist\classes\$@ 2> NUL
79 !endif
80 $(MOZ_TOOLS)\bin\sj -classpath $(JAVA_DESTPATH);$(JAVA_SOURCEPATH) \
81 -d $(JAVA_DESTPATH) $(JAVAC_OPTIMIZER) $@\*.java
84 !endif # NO_CAFE
86 clobber clobber_all::
87 -for %g in ($(JDIRS)) do $(RM_R) $(XPDIST:/=\)/classes/%g
89 !endif # JAVA_OR_NSJVM
90 !endif # JDIRS
94 #//------------------------------------------------------------------------
95 #//
96 #// JMC
97 #//
98 #// JSRCS .java files to be compiled (.java extension included)
99 #//
100 #//------------------------------------------------------------------------
101 !if defined(JAVA_OR_NSJVM)
102 !if defined(JSRCS)
104 JSRCS_DEPS = $(JAVA_DESTPATH) $(JAVA_DESTPATH)\$(PACKAGE) $(TMPDIR)
106 # Can't get moz cafe to compile a single file
107 !if defined(NO_CAFE)
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
114 @echo $(TMPDIR)
115 # @$(RM) $(TMPDIR)\javac.cfg
116 !else
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 <<
125 $(JSRCS)
128 !endif #NO_CAFE
130 clobber::
131 -for %g in ($(JSRCS:.java=.class)) do $(RM) $(XPDIST:/=\)/classes/$(PACKAGE:/=\)/%g
133 !endif # JSRCS
135 #//------------------------------------------------------------------------
137 #// JMC
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)
147 clobber::
148 -for %f in ($(JMC_EXPORT)) do $(RM) $(JMCSRCDIR:/=\)\%f.class
149 !endif # JMC_EXPORT
150 !endif # JAVA_OR_NSJVM
152 #//------------------------------------------------------------------------
154 #// JMC
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)
162 !if defined(JMC_GEN)
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
170 !if defined(CCJMC)
171 {$(JMC_GEN_DIR)\}.c{$(OBJDIR)\}.obj:
172 @$(CC) @<<$(CFGFILE)
173 -c $(CFLAGS)
174 -I. -I$(JMC_GEN_DIR)
175 -Fd$(PDBFILE)
176 -Fo.\$(OBJDIR)\
177 $(JMC_GEN_DIR)\$(*B).c
178 <<KEEP
180 export:: $(JMC_STUBS) $(OBJDIR) $(JMC_OBJS)
182 !endif # CCJMC
183 !endif # JMC_GEN
184 !endif # JAVA_OR_NSJVM