OSDN Git Service

HandBrake 0.6.2
[handbrake-jp/handbrake-jp-git.git] / Jamrules
1 # $Id: Jamrules,v 1.38 2004/05/25 17:50:12 titer Exp $
2 #
3 # This file is part of the HandBrake source code.
4 # Homepage: <http://handbrake.m0k.org/>.
5 # It may be used under the terms of the GNU General Public License.
6
7 HB_VERSION = 0.6.2 ;
8 LANGUAGES  = fr de it pl ru nl es pt ja ;
9
10 # Compilers & flags
11 CC      = gcc ;
12 C++     = g++ ;
13 AS      = nasm ;
14 LINK    = g++ ;
15 OPTIM   = -O3 -funroll-loops ;
16 DEFINES = HB_$(OS) HB_VERSION=\\\"$(HB_VERSION)\\\" ;
17
18 if $(OS) = BEOS
19 {
20     # Avoid multichar warnings caused by BeOS system headers
21     CCFLAGS   = -Wno-multichar ;
22     C++FLAGS  = -Wno-multichar ;
23     # BeOS' gcc tends to crash with -funroll-loops
24     OPTIM     = -O3 ;
25     ASFLAGS   = -f elf ;
26 }
27 if $(OS) = MACOSX
28 {
29     # For libdvdread
30     DEFINES  += WORDS_BIGENDIAN ;
31 }
32 if $(OS) = LINUX
33 {
34     ASFLAGS   = -f elf ;
35 }
36 if $(OS) = CYGWIN
37 {
38     # Build under cygwin but without the emulation layer
39     CCFLAGS   = -mno-cygwin ;
40     C++FLAGS  = -mno-cygwin ;
41     LINKFLAGS = -mno-cygwin ;
42     ASFLAGS   = -f win32 ;
43 }
44
45 NotFile clean-contrib clean-all ;
46 Always  clean-contrib ;
47 Depends clean-all : clean clean-contrib ;
48
49 # _Object: same as Jambase's Object, except
50 #  * those aren't cleaned by 'jam clean' (to prevent from deleting
51 #    every contrib library by accident)
52 #  * it handles *.asm files
53 rule _Object
54 {
55     MakeLocate $(<) : $(LOCATE_TARGET) ;
56     SEARCH on $(>) = $(SEARCH_SOURCE) ;
57     HDRS on $(<) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ;
58     HDRRULE on $(>) = HdrRule ;
59     HDRSCAN on $(>) = $(HDRPATTERN) ;
60     HDRSEARCH on $(>) =
61             $(SEARCH_SOURCE:E) $(SUBDIRHDRS) $(HDRS) $(STDHDRS) ;
62     HDRGRIST on $(>) = $(HDRGRIST) ;
63     DEFINES on $(<) += $(DEFINES) ;
64     switch $(>:S)
65     {   
66         case .asm : As $(<) : $(>) ;
67         case .nas : As $(<) : $(>) ;
68         case .c :   Cc $(<) : $(>) ;
69         case .cpp : C++ $(<) : $(>) ;
70     }
71 }
72 # _Objects: use _Object
73 rule _Objects
74 {
75     local _i ;
76     for _i in [ FGristFiles $(<) ]
77     {
78         _Object $(_i:S=$(SUFOBJ)) : $(_i) ;
79         Depends obj : $(_i:S=$(SUFOBJ)) ;
80     }
81 }
82
83 # Simplified LibraryFromObjects which doesn't clean the target library
84 # nor the temporary .o files
85 rule _Library
86 {
87     local _l _s ;
88     _s = [ FGristFiles $(>:S=$(SUFOBJ)) ] ;
89     _l = $(<:S=$(SUFLIB)) ;
90     _Objects $(>) ;
91     Depends obj : $(_s) ;
92     MakeLocate $(_l) $(_l)($(_s:BS)) : $(LOCATE_TARGET) ;
93     Depends $(_l) : $(_s) ;
94     Archive $(_l) : $(_s) ;
95     if $(RANLIB) { Ranlib $(_l) ; }
96     Depends lib : $(_l) ;
97 }
98
99 # ContribLibrary: library cleaned by 'jam clean-contrib'
100 rule ContribLibrary
101 {
102     _Library $(<) : $(>) ;
103     Clean clean-contrib : [ FGristFiles $(>:S=$(SUFOBJ)) ] ;
104     Clean clean-contrib : $(<:S=$(SUFLIB)) ;
105 }
106
107 # Library: library cleaned by 'jam clean'
108 rule Library
109 {
110     _Library $(<) : $(>) ;
111     Clean clean : [ FGristFiles $(>:S=$(SUFOBJ)) ] ;
112     Clean clean : $(<:S=$(SUFLIB)) ;
113 }
114
115 # Build HandBrake.app using Xcode
116 rule OSXApp
117 {
118     Depends     exe   : $(<) ;
119     Depends     $(<)  : $(>) ;
120     Clean       clean : $(1) macosx/build ;
121     BuildOSXApp $(<) ;
122 }
123 actions BuildOSXApp
124 {
125     $(RM) $(<) macosx/build/HandBrake.app && \
126       ( cd macosx && xcodebuild ) && \
127       cp -r macosx/build/HandBrake.app $(<) && \
128       for i in $(LANGUAGES) ; do \
129         ( cd $(<)/Contents/Resources && \
130           cp -r English.lproj $i.lproj && \
131           cp ../../../macosx/i18n/$i.strings \
132             $i.lproj/Localizable.strings ) \
133       done ;
134 }
135 rule OSXPackage 
136 {
137     Depends         $(<) : $(>) ;
138     BuildOSXPackage $(<) ;
139 }   
140 actions BuildOSXPackage
141 {                 
142     rm -rf $(<) "HandBrake $(HB_VERSION)" && \
143       mkdir "HandBrake $(HB_VERSION)" && \
144       cp AUTHORS "HandBrake $(HB_VERSION)/AUTHORS.txt" && \
145       cp COPYING "HandBrake $(HB_VERSION)/COPYING.txt" && \
146       cp CREDITS "HandBrake $(HB_VERSION)/CREDITS.txt" && \
147       cp THANKS "HandBrake $(HB_VERSION)/THANKS.txt" && \
148       ( cd doc && ./genhtml.sh ) && \
149       cp doc/faq.html "HandBrake $(HB_VERSION)/FAQ.html" && \
150       cp -r HandBrake.app "HandBrake $(HB_VERSION)" && \
151       zip -9 -r $(<) "HandBrake $(HB_VERSION)" && \
152       rm -rf "HandBrake $(HB_VERSION)"
153 }
154
155 rule SystemLibraries
156 {
157     LINKLIBS on [ FAppendSuffix $(<) : $(SUFEXE) ] +=  $(>) ;
158 }
159
160 # Jambase's ObjectHdrs doesn't seem to work when ObjectHdrs is called
161 # several times on a file, and it doesn't works for asm files. Fixed
162 # here.
163 rule ObjectHdrs
164 {
165     local s = [ FGristFiles $(<:S=$(SUFOBJ)) ] ;
166     HDRS   on $(s) += $(>) ;
167     ASHDRS on $(s) += [ FIncludes $(>) ] ;
168     CCHDRS on $(s) += [ FIncludes $(>) ] ;
169 }
170