source: trunk/third/firefox/config/rules.mak @ 21695

Revision 21695, 30.0 KB checked in by rbasch, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21694, which included commits to RCS files with non-trunk default branches.
Line 
1# The contents of this file are subject to the Netscape Public
2# License Version 1.1 (the "License"); you may not use this file
3# except in compliance with the License. You may obtain a copy of
4# the License at http://www.mozilla.org/NPL/
5#
6# Software distributed under the License is distributed on an "AS
7# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8# implied. See the License for the specific language governing
9# rights and limitations under the License.
10#
11# The Original Code is mozilla.org code.
12#
13# The Initial Developer of the Original Code is Netscape
14# Communications Corporation.  Portions created by Netscape are
15# Copyright (C) 1998 Netscape Communications Corporation. All
16# Rights Reserved.
17#
18# Contributor(s):
19
20!if !defined(VERBOSE)
21.SILENT:
22!endif
23#//------------------------------------------------------------------------
24#//
25#// This makefile contains all of the common rules shared by all other
26#// makefiles.
27#//
28#//------------------------------------------------------------------------
29
30!if !defined(CONFIG_RULES_MAK)
31CONFIG_RULES_MAK=1
32
33
34#//------------------------------------------------------------------------
35#//  Assumed variables by the manifest.
36#//------------------------------------------------------------------------
37!if !defined(PACKAGE)
38PACKAGE=.
39!endif # PACKAGE
40
41!if !defined(JDK_GEN_DIR)
42JDK_GEN_DIR=_gen
43!endif
44
45!if !defined(JDK_STUB_DIR)
46JDK_STUB_DIR=_stubs
47!endif
48
49!if !defined(JMC_GEN_DIR)
50!if defined(JAVA_OR_NSJVM)
51JMC_GEN_DIR=_jmc
52!else
53JMC_GEN_DIR=$(LOCAL_JMC_SUBDIR)
54!endif
55!endif
56
57!if !defined(JRI_GEN_DIR)
58JRI_GEN_DIR=_jri
59!endif
60
61!if !defined(JNI_GEN_DIR)
62JNI_GEN_DIR=_jni
63!endif
64
65
66#//------------------------------------------------------------------------
67#//  Make sure that JDIRS is set after the manifest file is included
68#//  and before the rules for JDIRS get generated. We cannot put this line
69#//  in the makefile.win after including rules.mak as the rules would already
70#//  be generated based on JDIRS set in manifest.mn. We cannot put in ifdefs in
71#//  manifest.mn too I was told.
72#//------------------------------------------------------------------------
73
74!ifdef JDIRS
75JDIRS=$(JDIRS) $(JSCD)
76!if "$(STAND_ALONE_JAVA)" == "1"
77JDIRS=$(JDIRS) $(SAJDIRS)
78!endif
79!endif
80
81
82!if "$(MOZ_BITS)" == "16"
83#//------------------------------------------------------------------------
84#//  All public win16 headers go to a single directory
85#//     due to compiler limitations.
86#//------------------------------------------------------------------------
87MODULE=win16
88!endif # 16
89
90
91OBJS=$(OBJS) $(C_OBJS) $(CPP_OBJS)
92
93include <$(DEPTH)/config/config.mak>
94
95!if "$(WINOS)" == "WIN95"
96_NO_FLOCK=-l
97!else
98_NO_FLOCK=
99!endif
100
101#//------------------------------------------------------------------------
102#//
103#// Definitions for building components. A ``component'' is a module
104#// that has an NSGetModule entry point that can be called to enumerate
105#// the XPCOM components contained in the module. A component can either
106#// be built as a stand-alone DLL, or as a static library which can be
107#// linked with other components to form a ``meta-component'' or included
108#// in a final executable.
109#//
110#//   MODULE_NAME
111#//     If set, indicates that we're building a ``component''. This value
112#//     should be set to the name of the generic module (as declared by
113#//     the NS_IMPL_NSGENERICMODULE macro; e.g., ``nsLayoutModule'').
114#//
115#//   LIBRARY_NAME
116#//     For a component, the name of the library that will be generated;
117#//     e.g., ``gklayout''.
118#//
119#//   META_COMPONENT
120#//     If set, the component is included in the packaging list for the
121#//     specified meta-component; if unset, the component is linked into
122#//     the final executable. This is only meaningful during a static
123#//     build.
124#//
125#//   SUB_LIBRARIES
126#//     If the component is comprised of static libraries, then this
127#//     lists those libraries.
128#//
129#//   LLIBS
130#//     Any extra library dependencies that are required when the component
131#//     is built as a DLL.
132#//
133#// When doing a ``dynamic build'', the component will be linked as a stand-
134#// alone DLL which will be installed in the $(DIST)/bin/components directory.
135#// No import library will be created.
136#//
137#// When doing a ``static build'', the component will be linked into a
138#// static library which is installed in the $(DIST)/lib directory, and
139#// either linked with the appropriate META_COMPONENT DLL, or the final
140#// executable if no META_COMPONENT is set.
141#//
142#//------------------------------------------------------------------------
143!if defined(MODULE_NAME)
144# We're building a component
145!if defined(EXPORT_LIBRARY)
146!error "Can't define both MODULE_NAME and EXPORT_LIBRARY."
147!endif
148
149!if defined(MOZ_STATIC_COMPONENT_LIBS)
150MAKE_OBJ_TYPE=$(NULL)
151
152!if defined(META_COMPONENT)
153META_LINK_COMPS=$(DIST)\$(META_COMPONENT)-link-comps
154META_LINK_COMP_NAMES=$(DIST)\$(META_COMPONENT)-link-comp-names
155!endif
156
157LIBRARY=.\$(OBJDIR)\$(LIBRARY_NAME).lib
158
159!else
160
161# Build the component as a standalone DLL
162MAKE_OBJ_TYPE=DLL
163
164DLL=.\$(OBJDIR)\$(LIBRARY_NAME).dll
165
166LLIBS=$(SUB_LIBRARIES) $(LLIBS)
167!endif
168
169!endif
170
171#//------------------------------------------------------------------------
172#//
173#// Definitions for building top-level export libraries.
174#//
175#//   EXPORT_LIBRARY
176#//     If set (typically to ``1''), indicates that we're building a
177#//      ``top-level export library''.
178#//
179#//   LIBRARY_NAME
180#//     Set to the name of the library.
181#//
182#//   META_COMPONENT
183#//     If set, the name of the meta-component to which this export
184#//     library belongs. If unset, the export library is linked with
185#//     the final executable.
186#//
187#//------------------------------------------------------------------------
188!if defined(EXPORT_LIBRARY)
189# We're building a top-level, non-component library
190
191!if defined(MOZ_STATIC_COMPONENT_LIBS)
192
193# Build it as a static lib, not a DLL
194MAKE_OBJ_TYPE=$(NULL)
195
196!if defined(META_COMPONENT)
197META_LINK_LIBS=$(DIST)\$(META_COMPONENT)-link-libs
198!endif
199
200LIBRARY=.\$(OBJDIR)\$(LIBRARY_NAME).lib
201
202!else
203# Build the library as a standalone DLL
204MAKE_OBJ_TYPE=DLL
205
206DLL=.\$(OBJDIR)\$(LIBRARY_NAME).dll
207
208LLIBS=$(SUB_LIBRARIES) $(LLIBS)
209!endif
210
211!endif
212
213#//------------------------------------------------------------------------
214#//
215#// Definitions for miscellaneous libraries that are not components or
216#// top-level export libraries.
217#//
218#//   LIBRARY_NAME
219#//     The name of the library to be created.
220#//
221#//------------------------------------------------------------------------
222!if defined(LIBRARY_NAME) && !defined(MODULE_NAME) && !defined(EXPORT_LIBRARY)
223!if !defined(LIBRARY)
224LIBRARY=$(OBJDIR)\$(LIBRARY_NAME).lib
225!endif
226!endif
227
228#//------------------------------------------------------------------------
229#//
230#// Specify a default target if non was set...
231#//
232#//------------------------------------------------------------------------
233!ifndef TARGETS
234TARGETS=$(PROGRAM) $(LIBRARY) $(DLL)
235!endif
236
237!ifndef MAKE_ARGS
238#MAKE_ARGS=all
239!endif
240
241!if "$(WINOS)" == "WIN95"
242W95MAKE=$(DEPTH)\config\w95make.exe
243W32OBJS = $(OBJS:.obj=.obj, )
244W32LOBJS = $(OBJS: .= +-.)
245!endif
246
247all::
248    $(NMAKE) -f makefile.win export
249    $(NMAKE) -f makefile.win libs
250
251#//------------------------------------------------------------------------
252#//
253#// Setup tool flags for the appropriate type of objects being built
254#// (either DLL or EXE)
255#//
256#//------------------------------------------------------------------------
257!if "$(MAKE_OBJ_TYPE)" == "DLL"
258CFLAGS=$(DLL_CFLAGS) $(CFLAGS)
259LFLAGS=$(DLL_LFLAGS) $(LFLAGS)
260OS_LIBS=$(DLL_LIBS) $(OS_LIBS)
261!else
262CFLAGS=$(EXE_CFLAGS) $(CFLAGS)
263LFLAGS=$(EXE_LFLAGS) $(LFLAGS)
264OS_LIBS=$(EXE_LIBS) $(OS_LIBS)
265!endif
266
267#//------------------------------------------------------------------------
268#//
269#// Use various library names as default name for PDB Files
270#//
271#// LIBRARY_NAME - Static Library
272#// DLLNAME - Dynamic Load Library
273#//
274#//
275#//------------------------------------------------------------------------
276
277# Replace optimizer and pdb related flags to use our own conventions
278!ifdef LIBRARY_NAME
279PDBFILE=$(LIBRARY_NAME)
280!endif
281# Replace optimizer and pdb related flags to use our own conventions
282!ifdef DLLNAME
283PDBFILE=$(DLLNAME)
284!endif
285
286# Replace optimizer and mapinfo related flags to use our own conventions
287!if defined(MOZ_MAPINFO)
288!ifdef LIBRARY_NAME
289MAPFILE=$(LIBRARY_NAME)
290!endif
291
292!ifdef DLLNAME
293MAPFILE=$(DLLNAME)
294!endif
295!endif
296
297# Replace optimizer and codinfo related flags to use our own conventions
298!if defined(MOZ_CODINFO)
299!ifdef LIBRARY_NAME
300CODFILE=$(LIBRARY_NAME)
301!endif
302
303!ifdef DLLNAME
304CODFILE=$(DLLNAME)
305!endif
306!endif
307#//------------------------------------------------------------------------
308#//
309#// Prepend the "object directory" to any public make variables.
310#//    PDBFILE - File containing debug info
311#//    RESFILE - Compiled resource file
312#//    MAPFILE - MAP file for an executable
313#//    CODFILE - COD file for an executable
314#//
315#//------------------------------------------------------------------------
316!ifdef PDBFILE
317PDBFILE=.\$(OBJDIR)\$(PDBFILE).pdb
318!else
319PDBFILE=.\$*.pdb  # used for executables
320!endif
321!ifdef RESFILE
322RESFILE=.\$(OBJDIR)\$(RESFILE)
323!endif
324
325
326# if MOZ_MAPINFO is set. linker will generate map files for all the dll/exe.
327!if defined(MOZ_MAPINFO)
328!ifdef MAPFILE
329MAPFILE=.\$(OBJDIR)\$(MAPFILE).map
330!else
331MAPFILE=.\$*.map  # used for executables
332!endif
333!else
334!ifdef MAPFILE
335MAPFILE=.\$(OBJDIR)\$(MAPFILE)
336!endif
337!endif
338
339!if defined(MOZ_CODINFO)
340!ifdef CODFILE
341CODFILE=.\$(OBJDIR)\$(CODFILE).cod
342!else
343CODFILE=.\$*.cod  # used for executables
344!endif
345!endif
346
347!ifdef DIRS
348#//------------------------------------------------------------------------
349#//
350#// Rule to recursively make all subdirectories specified by the DIRS target
351#//
352#//------------------------------------------------------------------------
353$(DIRS)::
354!if "$(WINOS)" == "WIN95"
355!if defined(VERBOSE)
356    @echo +++ make: cannot recursively make on win95 using command.com, use w95make.
357!endif
358!else
359    @echo +++ make: %MAKE_ARGS% in $(MAKEDIR)\$@
360        @cd $@
361        @$(NMAKE) -f makefile.win %%MAKE_ARGS%%
362    @cd $(MAKEDIR)
363!endif
364
365!endif # DIRS
366
367#//------------------------------------------------------------------------
368#//
369#// Created directories
370#//
371#//------------------------------------------------------------------------
372
373
374$(JAVA_DESTPATH):
375!if "$(AWT_11)" == "1"
376    -mkdir $(XPDIST:/=\)\classes11
377!else
378    -mkdir $(XPDIST:/=\)\classes
379!endif
380
381$(JAVA_DESTPATH)\$(PACKAGE): $(JAVA_DESTPATH)
382!if "$(AWT_11)" == "1"
383    -mkdir $(XPDIST:/=\)\classes11\$(PACKAGE:/=\)
384!else
385    -mkdir $(XPDIST:/=\)\classes\$(PACKAGE:/=\)
386!endif
387$(JMCSRCDIR):
388    -mkdir $(JMCSRCDIR)
389
390$(PUBLIC):
391    -mkdir $(XPDIST:/=\)\include
392
393!ifdef IDL_GEN
394#//------------------------------------------------------------------------
395#//
396#// IDL Stuff
397#//
398#//------------------------------------------------------------------------
399
400idl::
401        @echo +++ make: Starting osagent
402        @start $(DEPTH)\modules\iiop\tools\win32\osagent
403        @echo +++ make: idl2java $(IDL_GEN)
404        @type <<cmd.cfg
405$(IDL2JAVA_FLAGS) $(IDL_GEN)
406<<
407        @$(IDL2JAVA_PROG) -argfile cmd.cfg
408        @del cmd.cfg
409
410!endif # IDL_GEN
411
412TMPDIR=$(MOZ_SRC)\tmp
413$(TMPDIR):
414        -mkdir $(TMPDIR)
415
416!if defined(INSTALL_FILE_LIST) && defined(INSTALL_DIR)
417#//------------------------------------------------------------------------
418#//
419#// Rule to install the files specified by the INSTALL_FILE_LIST variable
420#// into the directory specified by the INSTALL_DIR variable
421#//
422#//------------------------------------------------------------------------
423!if "$(MOZ_BITS)" == "16"
424#//------------------------------------------------------------------------
425#//  All public win16 headers go to a single directory
426#//     due to compiler limitations.
427#//------------------------------------------------------------------------
428INSTALL_DIR=$(PUBLIC)\win16
429!endif # 16
430INSTALL_FILES: $(INSTALL_FILE_LIST)
431    !$(MAKE_INSTALL) $** $(INSTALL_DIR)
432
433!endif # INSTALL_FILES
434
435#//------------------------------------------------------------------------
436#//
437#// Global rules...
438#//
439#//------------------------------------------------------------------------
440
441#//------------------------------------------------------------------------
442#//
443#// Rules for building components
444#//
445#//------------------------------------------------------------------------
446!if defined(MODULE_NAME)
447# We're building a component
448!if defined(EXPORT_LIBRARY)
449!error "Can't define both MODULE_NAME and EXPORT_LIBRARY."
450!endif
451
452!if defined(MOZ_STATIC_COMPONENT_LIBS)
453
454# We're building this component as a static lib
455!if defined(META_COMPONENT)
456
457# It's to be linked into a meta-component. Add the component name to
458# the meta component's list
459export::
460        $(PERL) -I$(DEPTH)\config $(DEPTH)\config\build-list.pl $(_NO_FLOCK) $(META_LINK_COMPS:\=/) $(LIBRARY_NAME)
461        $(PERL) -I$(DEPTH)\config $(DEPTH)\config\build-list.pl $(_NO_FLOCK) $(META_LINK_COMP_NAMES:\=/) $(MODULE_NAME)
462
463!else # defined(META_COMPONENT)
464# Otherwise, it's to be linked into the main executable. Add the component
465# name to the list of components, and the library name to the list of
466# static libs.
467export::
468        $(PERL) -I$(DEPTH)\config $(DEPTH)\config\build-list.pl $(_NO_FLOCK) $(FINAL_LINK_COMPS:\=/) $(LIBRARY_NAME)
469        $(PERL) -I$(DEPTH)\config $(DEPTH)\config\build-list.pl $(_NO_FLOCK) $(FINAL_LINK_COMP_NAMES:\=/) $(MODULE_NAME)
470
471!endif # defined(META_COMPONENT)
472
473libs:: $(LIBRARY)
474!ifndef NO_DIST_INSTALL
475        $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
476!endif
477
478clobber::
479        $(RM) $(DIST)\lib\$(LIBRARY_NAME).lib
480
481!else
482
483# Build the component as a standalone DLL. Do _not_ install the import
484# library, because it's a component; nobody should be linking against
485# it!
486
487libs:: $(DLL)
488!ifndef NO_DIST_INSTALL
489        $(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
490!endif
491
492clobber::
493        $(RM) $(DIST)\bin\components\$(DLL)
494
495!endif
496
497!endif
498
499#//------------------------------------------------------------------------
500#//
501#// Rules for building top-level export libraries
502#//
503#//------------------------------------------------------------------------
504!if defined(EXPORT_LIBRARY)
505# We're building a top-level, non-component library
506
507!if defined(MOZ_STATIC_COMPONENT_LIBS)
508
509!if defined(META_COMPONENT)
510# It's to be linked into a meta-component. Add the library to the
511# meta component's list
512
513export::
514        $(PERL) -I$(DEPTH)\config $(DEPTH)\config\build-list.pl $(_NO_FLOCK) $(META_LINK_LIBS:\=/) $(LIBRARY_NAME)
515
516!else # defined(META_COMPONENT)
517# Otherwise, it's to be linked into the main executable. Add the
518# library to the list of static libs.
519
520export::
521        $(PERL) -I$(DEPTH)\config $(DEPTH)\config\build-list.pl $(_NO_FLOCK) $(FINAL_LINK_LIBS:\=/) $(LIBRARY_NAME)
522
523!endif # defined(META_COMPONENT)
524
525libs:: $(LIBRARY)
526!ifndef NO_DIST_INSTALL
527        $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
528!endif
529
530clobber::
531        $(RM) $(DIST)\lib\$(LIBRARY_NAME).lib
532
533!else
534
535# Build the library as a standalone DLL. We _will_ install the import
536# library in this case, because people may link against it.
537
538libs:: $(DLL) $(OBJDIR)\$(LIBRARY_NAME).lib
539!ifndef NO_DIST_INSTALL
540        $(MAKE_INSTALL) $(DLL) $(DIST)\bin
541        $(MAKE_INSTALL) $(OBJDIR)\$(LIBRARY_NAME).lib $(DIST)\lib
542!endif
543
544clobber::
545        $(RM) $(DIST)\bin\$(DLL)
546        $(RM) $(DIST)\lib\$(LIBRARY_NAME).lib
547
548!endif
549
550!endif
551
552#//------------------------------------------------------------------------
553#//
554#// Rules for miscellaneous libraries
555#//
556#//------------------------------------------------------------------------
557!if defined(LIBRARY)
558
559libs:: $(LIBRARY)
560!ifndef NO_DIST_INSTALL
561        $(MAKE_INSTALL) $(LIBRARY) $(DIST)/lib
562!endif
563
564clobber::
565        rm -f $(DIST)/lib/$(LIBRARY_NAME).lib
566
567!endif
568
569
570#//------------------------------------------------------------------------
571#//
572#// Rules for recursion
573#//
574#//----------------------------------------------------------------------
575
576#//
577#// Set the MAKE_ARGS variable to indicate the target being built...  This is used
578#// when processing subdirectories via the $(DIRS) rule
579#//
580
581
582#
583# Nasty hack to get around the win95 shell's inability to set
584# environment variables whilst in a set of target commands
585#
586!if "$(WINOS)" == "WIN95"
587
588clean::
589!ifdef DIRS
590     @$(W95MAKE) clean $(MAKEDIR) $(DIRS)
591!endif
592    -$(RM) $(OBJS) $(NOSUCHFILE) NUL 2> NUL
593
594clobber::
595!ifdef DIRS
596     @$(W95MAKE) clobber $(MAKEDIR) $(DIRS)
597!endif
598
599clobber_all::
600!ifdef DIRS
601     @$(W95MAKE) clobber_all $(MAKEDIR) $(DIRS)
602!endif
603 
604export::
605!ifdef DIRS
606    @$(W95MAKE) export $(MAKEDIR) $(DIRS)
607!endif # DIRS
608
609libs::
610!ifdef DIRS
611    @$(W95MAKE) libs $(MAKEDIR) $(DIRS)
612!endif # DIRS
613
614depend::
615!ifdef DIRS
616    @$(W95MAKE) depend $(MAKEDIR) $(DIRS)
617!endif # DIRS
618
619mangle::
620!ifdef DIRS
621    @$(W95MAKE) mangle $(MAKEDIR) $(DIRS)
622!endif # DIRS
623    $(MAKE_MANGLE)
624
625unmangle::
626!ifdef DIRS
627    @$(W95MAKE) unmangle $(MAKEDIR) $(DIRS)
628!endif # DIRS
629    -$(MAKE_UNMANGLE)
630
631!else
632
633
634clean::
635        @set MAKE_ARGS=$@
636
637clobber::
638        @set MAKE_ARGS=$@
639
640clobber_all::
641        @set MAKE_ARGS=$@
642
643export::
644        @set MAKE_ARGS=$@
645
646libs::
647        @set MAKE_ARGS=$@
648
649libs::
650        @set MAKE_ARGS=$@
651
652mangle::
653        @set MAKE_ARGS=$@
654
655unmangle::
656        @set MAKE_ARGS=$@
657
658depend::
659        @set MAKE_ARGS=$@
660
661!endif
662
663#//------------------------------------------------------------------------
664#// DEPEND
665#//
666#//   If you ever need to change the set of includes (e.g., you go whack
667#//   the build rules over in obj.inc), make sure to update the input
668#//   to $(MAKEDEP). It only looks through the directories that you tell
669#//   it to.
670#//
671#//------------------------------------------------------------------------
672
673MAKEDEP=$(DEPTH)\config\makedep.exe
674MAKEDEPFILE=.\$(OBJDIR:/=\)\make.dep
675
676MAKEDEPDETECT=$(OBJS)
677MAKEDEPDETECT=$(MAKEDEPDETECT: =)
678MAKEDEPDETECT=$(MAKEDEPDETECT:  =)
679
680!if !defined(NODEPEND) && "$(MAKEDEPDETECT)" != ""
681
682depend:: $(OBJDIR)
683    @echo Analyzing dependencies...
684    $(MAKEDEP) -s -o $(MAKEDEPFILE) @<<
685$(LINCS)
686$(LINCS_1)
687$(INCS)
688-I$(MAKEDIR)
689$(OBJS)
690<<
691
692!endif
693
694!IF EXIST($(MAKEDEPFILE))
695!INCLUDE <$(MAKEDEPFILE)>
696!ENDIF
697
698export:: $(DIRS)
699
700libs:: $(DIRS)
701
702depend:: $(DIRS)
703
704mangle:: $(DIRS)
705    $(MAKE_MANGLE)
706
707unmangle:: $(DIRS)
708    -$(MAKE_UNMANGLE)
709
710
711alltags::
712        @echo +++ Making emacs tags
713        c:\\mksnt\\find . -name dist -prune -o ( -name '*.[hc]' -o -name '*.cpp' -o -name '*.idl' ) -print | c:\\mksnt\\xargs etags -a
714
715echo-dirs:
716        @echo.$(DIRS)
717
718echo-module:
719        @echo.$(MODULE)
720
721echo-requires:
722        @echo.$(REQUIRES)
723
724echo-incs:
725        @echo.$(INCS)
726
727#//------------------------------------------------------------------------
728#//
729#// Rule to create the object directory (if necessary)
730#//
731#//------------------------------------------------------------------------
732$(OBJDIR):
733        @echo +++ make: Creating directory: $(OBJDIR)
734    -mkdir $(OBJDIR)
735
736
737#//------------------------------------------------------------------------
738#//
739#// Include the makefile for building the various targets...
740#//
741#//------------------------------------------------------------------------
742include <$(DEPTH)/config/version.inc>
743include <$(DEPTH)/config/obj.inc>
744include <$(DEPTH)/config/exe.inc>
745include <$(DEPTH)/config/dll.inc>
746include <$(DEPTH)/config/lib.inc>
747include <$(DEPTH)/config/java.inc>
748
749
750#//------------------------------------------------------------------------
751#//
752#// EXPORTS
753#//
754#// Names of headers to be copied to common include directory
755#//
756#//------------------------------------------------------------------------
757!if "$(EXPORTS)" != "$(NULL)"
758
759export:: $(EXPORTS)
760!ifndef NO_DIST_INSTALL
761    @echo +++ make: exporting headers
762        $(MAKE_INSTALL:/=\) $(MKCPYFLAGS) $(EXPORTS) $(PUBLIC)
763        $(PERL) -I$(DEPTH)\config $(DEPTH)\config\build-list.pl $(PUBLIC)/.headerlist $(EXPORTS)
764!endif
765
766#// don't delete exported stuff on a local clobber, use clobber_all
767#clobber::
768#!if exist($(PUBLIC))
769#    @cd $(PUBLIC)
770#    -$(RM) $(EXPORTS)
771#    @cd $(MAKEDIR)
772#!endif # $(PUBLIC) exists
773
774clobber_all::
775!if exist($(PUBLIC))
776    @cd $(PUBLIC)
777    -$(RM) $(EXPORTS)
778    @cd $(MAKEDIR)
779!endif # $(PUBLIC) exists
780
781!endif # EXPORTS
782
783#//------------------------------------------------------------------------
784#//  These rules must follow all lines that define the macros they use
785#//------------------------------------------------------------------------
786!if defined(JAVA_OR_NSJVM)
787GARBAGE = $(GARBAGE) $(JMC_GEN_DIR) $(JMC_HEADERS) $(JMC_STUBS) \
788          $(JDK_STUB_DIR) $(JRI_GEN_DIR) $(JDK_GEN_DIR) $(JNI_GEN_DIR)
789!endif
790
791
792clean:: $(DIRS)
793    -$(RM) $(OBJS) $(NOSUCHFILE) NUL 2> NUL
794
795clobber:: $(DIRS)
796!if defined(GARBAGE) || exist($(OBJDIR))
797    -$(RM_R) $(GARBAGE) $(OBJDIR) 2> NUL
798!endif
799
800clobber_all:: $(DIRS)
801!if defined(GARBAGE) || "$(TARGETS)" != "  " || exist($(OBJDIR))
802    -$(RM_R) $(TARGETS) $(GARBAGE) $(OBJDIR) 2> NUL
803!endif
804
805!if "$(MOZ_BITS)"=="32"
806CFLAGS = $(CFLAGS) -DNO_JNI_STUBS
807!endif
808
809
810#//------------------------------------------------------------------------
811#//  XPIDL rules
812#//------------------------------------------------------------------------
813!if "$(XPIDLSRCS)" != "$(NULL)"
814!if "$(MODULE)" != "$(NULL)"
815
816# Generate header files and type libraries from the XPIDLSRCS variable.
817
818.SUFFIXES: .idl .xpt
819
820# XXX Note the direct use of '.\_xpidlgen' instead of
821# $(XPIDL_GEN_DIR). 'nmake' is too stupid to deal with recursive macro
822# substitution.
823
824XPIDL_INCLUDES=$(XPIDL_INCLUDES) -I$(XPDIST)\idl
825
826XPIDL_HEADERS=$(XPIDLSRCS:.idl=.h)
827XPIDL_HEADERS=$(XPIDL_HEADERS:.\=.\_xpidlgen\)
828
829!ifndef NO_GEN_XPT
830XPIDL_TYPELIBS=$(XPIDLSRCS:.idl=.xpt)
831XPIDL_TYPELIBS=$(XPIDL_TYPELIBS:.\=.\_xpidlgen\)
832
833.idl{$(XPIDL_GEN_DIR)}.xpt:
834        $(XPIDL_PROG) -m typelib -w $(XPIDL_INCLUDES) -o $* $<
835
836!ifndef XPIDL_MODULE
837XPIDL_MODULE = $(MODULE)
838!endif
839
840TYPELIB = $(XPIDL_GEN_DIR)\$(XPIDL_MODULE).xpt
841
842$(TYPELIB): $(XPIDL_TYPELIBS) $(XPTLINK_PROG)
843        @echo +++ make: Creating typelib: $(TYPELIB)
844        $(XPTLINK_PROG) $(TYPELIB) $(XPIDL_TYPELIBS)
845!endif
846
847$(XPIDL_GEN_DIR):
848        @echo +++ make: Creating directory: $(XPIDL_GEN_DIR)
849        -mkdir $(XPIDL_GEN_DIR)
850
851$(XPIDL_HEADERS): $(XPIDL_PROG)
852
853.idl{$(XPIDL_GEN_DIR)}.h:
854        $(XPIDL_PROG) -m header -w $(XPIDL_INCLUDES) -o $* $<
855
856$(DIST)\include:
857        @echo +++ make: Creating directory: $(DIST)\include
858        -mkdir $(DIST)\include
859
860$(XPDIST)\idl:
861        @echo +++ make: Creating directory: $(XPDIST)\idl
862        -mkdir $(XPDIST)\idl
863
864export:: $(XPDIST)\idl
865!ifndef NO_DIST_INSTALL
866        @echo +++ make: exporting IDL files
867        $(MAKE_INSTALL) $(XPIDLSRCS:/=\) $(XPDIST)\idl
868!endif
869
870export:: $(XPIDL_GEN_DIR) $(XPIDL_HEADERS) $(PUBLIC)
871!ifndef NO_DIST_INSTALL
872        @echo +++ make: exporting generated XPIDL header files
873        $(MAKE_INSTALL) $(XPIDL_HEADERS:/=\) $(PUBLIC)
874        $(PERL) -I$(DEPTH)\config $(DEPTH)\config\build-list.pl $(PUBLIC)/.headerlist $(XPIDL_HEADERS)
875!endif
876
877!ifndef NO_GEN_XPT
878libs:: $(XPIDL_GEN_DIR) $(TYPELIB)
879!ifndef NO_DIST_INSTALL
880        @echo +++ make: installing typelib '$(TYPELIB)' to components directory
881        $(MAKE_INSTALL) $(TYPELIB) $(DIST)\bin\components
882!endif
883!endif
884
885clobber::
886        -$(RM_R) $(XPIDL_GEN_DIR) 2> NUL
887       
888clobber_all::
889        -$(RM_R) $(XPIDL_GEN_DIR) 2> NUL
890!if exist($(PUBLIC))
891        @cd $(PUBLIC)
892        -$(RM) $(XPIDLSRCS:.idl=.h)
893        @cd $(MAKEDIR)
894!endif
895!if exist($(XPDIST:/=\)\idl)
896        @cd $(XPDIST:/=\)\idl
897        -$(RM) $(XPIDLSRCS)
898        @cd $(MAKEDIR)
899!endif
900!if exist($(DIST)\bin\components)
901        -$(RM) $(DIST)\bin\components\$(XPIDL_MODULE).xpt
902!endif
903
904!endif
905!endif
906
907#//----------------------------------------------------------------------
908#//
909#// Component packaging rules
910#//
911#//----------------------------------------------------------------------
912$(FINAL_LINK_COMPS):
913        @echo +++ make: creating file: $(FINAL_LINK_COMPS)
914        @echo. > $(FINAL_LINK_COMPS)
915
916$(FINAL_LINK_COMP_NAMES):
917        @echo +++ make: creating file: $(FINAL_LINK_COMP_NAMES)
918        @echo. > $(FINAL_LINK_COMP_NAMES)
919
920$(FINAL_LINK_LIBS):
921        @echo +++ make: creating file: $(FINAL_LINK_LIBS)
922        @echo. > $(FINAL_LINK_LIBS)
923
924
925################################################################################
926## CHROME PACKAGING
927
928JAR_MANIFEST = jar.mn
929
930chrome::
931
932libs:: chrome
933
934!ifdef MOZ_CHROME_FILE_FORMAT
935_CHROME_FILE_FORMAT=$(MOZ_CHROME_FILE_FORMAT)
936
937!if "$(_CHROME_FILE_FORMAT)" == "flat"
938_JAR_REGCHROME_DISABLE_JAR=1
939!else
940_JAR_REGCHROME_DISABLE_JAR=0
941!endif
942
943!else
944
945!ifdef MOZ_DISABLE_JAR_PACKAGING
946_CHROME_FILE_FORMAT=flat
947_JAR_REGCHROME_DISABLE_JAR=1
948!else
949_CHROME_FILE_FORMAT=jar
950_JAR_REGCHROME_DISABLE_JAR=0
951!endif
952
953!endif
954
955REGCHROME = @perl -I$(DEPTH)\config $(DEPTH)\config\add-chrome.pl $(_NO_FLOCK) $(DIST)\bin\chrome\installed-chrome.txt $(_JAR_REGCHROME_DISABLE_JAR)
956
957!ifndef MOZ_OLD_JAR_PACKAGING
958
959!if exist($(JAR_MANIFEST))
960
961!ifdef NO_JAR_AUTO_REG
962_JAR_AUTO_REG=-a
963!endif
964
965chrome:: $(CHROME_DEPS)
966        $(PERL) -I$(DEPTH)\config $(DEPTH)\config\make-jars.pl -f $(_CHROME_FILE_FORMAT) $(_NO_FLOCK) $(_JAR_AUTO_REG) -d $(DIST)\bin\chrome < $(JAR_MANIFEST)
967        $(PERL) -I$(DEPTH)\config $(DEPTH)\config\make-chromelist.pl $(DIST)\bin\chrome $(JAR_MANIFEST) $(_NO_FLOCK)
968!endif
969
970regchrome:
971
972!else # !MOZ_OLD_JAR_PACKAGING
973
974################################################################################
975# Generate chrome building rules.
976#
977# You need to set these in your makefile.win to utilize this support:
978#   CHROME_DIR - specifies the chrome subdirectory where your chrome files
979#                go; e.g., CHROME_DIR=navigator or CHROME_DIR=global
980#
981# Note:  All file listed in the next three macros MUST be prefaced with .\ (or ./)!
982#
983#   CHROME_CONTENT - list of chrome content files; these can be prefaced with
984#                arbitrary paths; e.g., CHROME_CONTENT=./content/default/foobar.xul
985#   CHROME_SKIN - list of skin files
986#   CHROME_L10N - list of localization files, e.g., CHROME_L10N=./locale/en-US/foobar.dtd
987#
988# These macros are optional, if not specified, each defaults to ".".
989#   CHROME_CONTENT_DIR - Specifies a subdirectory within CHROME_DIR where
990#                  all CHROME_CONTENT files will be installed.
991#   CHROME_SKIN_DIR - Like above, but for skin files
992#   CHROME_L10N_DIR - Like above, but for localization files
993#   CHROME_TYPE - The type of chrome being generated (content, skin, locale).
994#                  Top-level makefiles (the same one copying the rdf manifests
995#                  and generating the jar file) should define this macro.
996#                  This will notify the chrome registry of a new installation.
997
998!if "$(CHROME_DIR)" != "$(NULL)"
999
1000# Figure out root of chrome dist dir.
1001CHROME_DIST=$(DIST)\bin\chrome\$(CHROME_DIR:/=\)
1002
1003# Content
1004!if "$(CHROME_CONTENT)" != "$(NULL)"
1005
1006CHROME_CONTENT=$(CHROME_CONTENT:/=\)
1007
1008# Content goes to CHROME_DIR unless specified otherwise.
1009!if "$(CHROME_CONTENT_DIR)" == "$(NULL)"
1010CHROME_CONTENT_DIR=.
1011!endif
1012
1013# Export content files by copying to dist.
1014chrome:: $(CHROME_CONTENT:.\=INSTALL\.\)
1015
1016# Pseudo-target specifying how to install content files.
1017$(CHROME_CONTENT:.\=INSTALL\.\):
1018!ifndef NO_DIST_INSTALL
1019    $(MAKE_INSTALL) $(@:INSTALL\.=.) $(CHROME_DIST)\$(CHROME_CONTENT_DIR)
1020!endif
1021
1022# Clobber content files.
1023clobber_all:: $(CHROME_CONTENT:.\=CLOBBER\.\)
1024
1025# Pseudo-target specifying how to clobber content files.
1026$(CHROME_CONTENT:.\=CLOBBER\.\):
1027    -@$(RM) $(CHROME_DIST)\$(CHROME_CONTENT_DIR)\$(@:CLOBBER\.=.)
1028
1029!endif # content
1030
1031# Skin
1032!if "$(CHROME_SKIN)" != "$(NULL)"
1033
1034CHROME_SKIN=$(CHROME_SKIN:/=\)
1035
1036# Skin goes to CHROME_DIR unless specified otherwise.
1037!if "$(CHROME_SKIN_DIR)" == "$(NULL)"
1038CHROME_SKIN_DIR=.
1039!endif
1040
1041# Export skin files by copying to dist.
1042chrome:: $(CHROME_SKIN:.\=INSTALL\.\)
1043
1044# Pseudo-target specifying how to install chrome files.
1045$(CHROME_SKIN:.\=INSTALL\.\):
1046!ifndef NO_DIST_INSTALL
1047    $(MAKE_INSTALL) $(@:INSTALL\.=.) $(CHROME_DIST)\$(CHROME_SKIN_DIR)
1048!endif
1049
1050# Clobber content files.
1051clobber_all:: $(CHROME_SKIN:.\=CLOBBER\.\)
1052
1053# Pseudo-target specifying how to clobber content files.
1054$(CHROME_SKIN:.\=CLOBBER\.\):
1055    -@$(RM) $(CHROME_DIST)\$(CHROME_SKIN_DIR)\$(@:CLOBBER\.=.)
1056
1057!endif # skin
1058
1059# Localization.
1060!if "$(CHROME_L10N)" != "$(NULL)"
1061
1062CHROME_L10N=$(CHROME_L10N:/=\)
1063
1064# L10n goes to CHROME_DIR unless specified otherwise.
1065!if "$(CHROME_L10N_DIR)" == "$(NULL)"
1066CHROME_L10N_DIR=.
1067!endif
1068
1069# Export l10n files by copying to dist.
1070chrome:: $(CHROME_L10N:.\=INSTALL\.\)
1071
1072# Pseudo-target specifying how to install l10n files.
1073$(CHROME_L10N:.\=INSTALL\.\):
1074!ifndef NO_DIST_INSTALL
1075    $(MAKE_INSTALL) $(@:INSTALL\.=.) $(CHROME_DIST)\$(CHROME_L10N_DIR)
1076!endif
1077
1078# Clobber l10n files.
1079clobber_all:: $(CHROME_L10N:.\=CLOBBER\.\)
1080
1081# Pseudo-target specifying how to clobber l10n files.
1082$(CHROME_L10N:.\=CLOBBER\.\):
1083    -@$(RM) $(CHROME_DIST)\$(CHROME_L10N_DIR)\$(@:CLOBBER\.=.)
1084
1085!endif # localization
1086
1087# miscellaneous chrome
1088!if "$(CHROME_MISC)" != "$(NULL)"
1089
1090CHROME_MISC=$(CHROME_MISC:/=\)
1091
1092# misc goes to CHROME_DIR unless specified otherwise.
1093!if "$(CHROME_MISC_DIR)" == "$(NULL)"
1094CHROME_MISC_DIR=.
1095!endif
1096
1097# Export misc files by copying to dist.
1098chrome:: $(CHROME_MISC:.\=INSTALL\.\)
1099
1100# Pseudo-target specifying how to install misc files.
1101$(CHROME_MISC:.\=INSTALL\.\):
1102!ifndef NO_DIST_INSTALL
1103    $(MAKE_INSTALL) $(@:INSTALL\.=.) $(CHROME_DIST)\$(CHROME_MISC_DIR)
1104!endif
1105
1106# Clobber misc files.
1107clobber_all:: $(CHROME_MISC:.\=CLOBBER\.\)
1108
1109# Pseudo-target specifying how to clobber misc files.
1110$(CHROME_MISC:.\=CLOBBER\.\):
1111    -@$(RM) $(CHROME_DIST)\$(CHROME_MISC_DIR)\$(@:CLOBBER\.=.)
1112
1113!endif # miscellaneous chrome
1114
1115!ifdef MOZ_DISABLE_JAR_PACKAGING
1116!if "$(CHROME_TYPE)" != "$(NULL)"
1117chrome::
1118    -for %t in ($(CHROME_TYPE)) do echo %t,install,url,resource:/chrome/$(CHROME_DIR:\=/)/ >>$(DIST)\bin\chrome\installed-chrome.txt
1119!endif
1120!endif
1121
1122chrome::
1123        @echo.
1124        @echo ****************** IF YOU ADD OR REMOVE CHROME FILES, PLEASE UPDATE $(MAKEDIR)\$(JAR_MANIFEST) (or tell warren@netscape.com) **********************
1125        @echo.
1126
1127!endif # chrome
1128
1129regchrome:
1130!if !defined(MOZ_DISABLE_JAR_PACKAGING)
1131  $(PERL) $(DEPTH)\config\zipchrome.pl win32 update $(DIST)\bin\chrome
1132  $(PERL) $(DEPTH)\config\installchrome.pl win32 jar $(DIST)\bin\chrome
1133!else
1134#  XXX do it this way once everyone has perl installed. For now some
1135#  people apparently have trouble with that so do the rules.mak stuff instead
1136#    $(PERL) $(DEPTH)\config\installchrome.pl win32 resource $(DIST)\bin\chrome
1137!endif
1138
1139!endif # !MOZ_OLD_JAR_PACKAGING
1140
1141################################################################################
1142
1143# Easier than typing it by hand, works from any directory:
1144debug::
1145        start msdev $(DIST)\bin\mozilla.exe
1146
1147# Easier than typing it by hand, works from any directory:
1148run::
1149        $(DIST)\bin\mozilla.exe
1150
1151################################################################################
1152!endif # CONFIG_RULES_MAK
1153################################################################################
Note: See TracBrowser for help on using the repository browser.