1
1
# Compilers & flags
2
- CC = gcc ;
3
- C++ = g++ ;
4
- CCFLAGS = $(CFLAGS) ;
5
- C++FLAGS = $(CFLAGS) ;
6
- AS = nasm -f elf ;
7
- LINK = g++ ;
8
- OPTIM = -O3 -funroll-loops ;
2
+ CC = gcc ;
3
+ C++ = g++ ;
4
+ AS = nasm -f elf ;
5
+ LINK = g++ ;
6
+ OPTIM = -O3 -funroll-loops ;
9
7
10
- # HandBrake defines
11
- HB_VERSION = 0.6.0 ;
8
+ HB_VERSION = 0.6.1 ;
12
9
DEFINES = HB_$(OS) HB_VERSION=\\\"$(HB_VERSION)\\\" ;
13
- #DEFINES += HB_NOMMX ;
10
+ LANGUAGES = fr de it pl ru nl es pt ;
14
11
15
- LANGUAGES = fr de it pl ru nl es pt ;
12
+ NotFile clean-contrib clean-all ;
13
+ Always clean-contrib ;
14
+ Depends clean-all : clean clean-contrib ;
16
15
17
- # OS-specific
18
- if $(OS) = BEOS
19
- {
20
- CCFLAGS += -Wno-multichar ;
21
- C++FLAGS += -Wno-multichar ;
22
- }
23
- else if $(OS) = LINUX
24
- {
25
- LINKLIBS = -lpthread ;
26
- }
27
- else if $(OS) = MACOSX
28
- {
29
- # To clean HandBrake.app
30
- RM = rm -rf ;
31
- }
32
-
33
- # Contrib* rules: mostly the same than Jambase rules, except
34
- # * Targets aren't cleaned by jam clean (to prevent from deleting
16
+ # _Object: same as Jambase's Object, except
17
+ # * those aren't cleaned by 'jam clean' (to prevent from deleting
35
18
# every contrib library by accident)
36
- # * ContribObject handles *.asm files
37
- # * Temporary *.o files aren't removed
38
- rule ContribObject
19
+ # * it handles *.asm files
20
+ rule _Object
39
21
{
40
22
MakeLocate $(<) : $(LOCATE_TARGET) ;
41
23
SEARCH on $(>) = $(SEARCH_SOURCE) ;
@@ -51,33 +33,28 @@ rule ContribObject
51
33
case .asm : As $(<) : $(>) ;
52
34
case .nas : As $(<) : $(>) ;
53
35
case .c : Cc $(<) : $(>) ;
54
- case .C : C++ $(<) : $(>) ;
55
- case .cc : C++ $(<) : $(>) ;
56
36
case .cpp : C++ $(<) : $(>) ;
57
- case .f : Fortran $(<) : $(>) ;
58
- case .l : Cc $(<) : $(<:S=.c) ;
59
- Lex $(<:S=.c) : $(>) ;
60
- case .s : As $(<) : $(>) ;
61
- case .y : Cc $(<) : $(<:S=$(YACCGEN)) ;
62
- Yacc $(<:S=$(YACCGEN)) : $(>) ;
63
- case * : UserObject $(<) : $(>) ;
64
37
}
65
38
}
66
- rule ContribObjects
39
+ # _Objects: use _Object
40
+ rule _Objects
67
41
{
68
42
local _i ;
69
43
for _i in [ FGristFiles $(<) ]
70
44
{
71
- ContribObject $(_i:S=$(SUFOBJ)) : $(_i) ;
45
+ _Object $(_i:S=$(SUFOBJ)) : $(_i) ;
72
46
Depends obj : $(_i:S=$(SUFOBJ)) ;
73
47
}
74
48
}
75
- rule ContribLibrary
49
+
50
+ # Simplified LibraryFromObjects which doesn't clean the target library
51
+ # nor the temporary .o files
52
+ rule _Library
76
53
{
77
54
local _l _s ;
78
55
_s = [ FGristFiles $(>:S=$(SUFOBJ)) ] ;
79
56
_l = $(<:S=$(SUFLIB)) ;
80
- ContribObjects $(>) ;
57
+ _Objects $(>) ;
81
58
Depends obj : $(_s) ;
82
59
MakeLocate $(_l) $(_l)($(_s:BS)) : $(LOCATE_TARGET) ;
83
60
Depends $(_l) : $(_s) ;
@@ -86,40 +63,50 @@ rule ContribLibrary
86
63
Depends lib : $(_l) ;
87
64
}
88
65
89
- # Custom Library rule: same as ContribLibrary, except 'jam clean'
90
- # removes built objects
66
+ # ContribLibrary: library cleaned by 'jam clean-contrib'
67
+ rule ContribLibrary
68
+ {
69
+ _Library $(<) : $(>) ;
70
+ Clean clean-contrib : [ FGristFiles $(>:S=$(SUFOBJ)) ] ;
71
+ Clean clean-contrib : $(<:S=$(SUFLIB)) ;
72
+ }
73
+
74
+ # Library: library cleaned by 'jam clean'
91
75
rule Library
92
76
{
93
- ContribLibrary $(<) : $(>) ;
77
+ _Library $(<) : $(>) ;
94
78
Clean clean : [ FGristFiles $(>:S=$(SUFOBJ)) ] ;
95
79
Clean clean : $(<:S=$(SUFLIB)) ;
96
80
}
97
81
98
82
# Build HandBrake.app using Xcode
99
83
rule OSXApp
100
- {
101
- Clean clean : $(1) macosx/build ;
102
- BuildOSXApp $(1) ;
84
+ {
85
+ Depends exe : $(<) ;
86
+ Depends $(<) : $(>) ;
87
+ Clean clean : $(1) macosx/build ;
88
+ BuildOSXApp $(<) ;
103
89
}
104
90
actions BuildOSXApp
105
91
{
106
- $(RM) $(1 ) && \
92
+ $(RM) $(< ) && \
107
93
( cd macosx && xcodebuild ) && \
108
- cp -r macosx/build/HandBrake.app $(1 ) && \
94
+ cp -r macosx/build/HandBrake.app $(< ) && \
109
95
for i in $(LANGUAGES) ; do \
110
- ( cd $(1 )/Contents/Resources && \
96
+ ( cd $(< )/Contents/Resources && \
111
97
cp -r English.lproj $i.lproj && \
112
98
cp ../../../macosx/i18n/$i.strings \
113
99
$i.lproj/Localizable.strings ) \
114
100
done ;
115
101
}
116
102
rule OSXPackage
117
- {
118
- BuildOSXPackage $(1) ;
103
+ {
104
+ Depends $(<) : $(>) ;
105
+ BuildOSXPackage $(<) ;
119
106
}
120
107
actions BuildOSXPackage
121
108
{
122
- rm -rf $(1 ) "HandBrake $(HB_VERSION)" && \
109
+ rm -rf $(< ) "HandBrake $(HB_VERSION)" && \
123
110
mkdir "HandBrake $(HB_VERSION)" && \
124
111
cp AUTHORS "HandBrake $(HB_VERSION)/AUTHORS.txt" && \
125
112
cp COPYING "HandBrake $(HB_VERSION)/COPYING.txt" && \
@@ -128,7 +115,23 @@ actions BuildOSXPackage
128
115
( cd doc && ./genhtml.sh ) && \
129
116
cp doc/faq.html "HandBrake $(HB_VERSION)/FAQ.html" && \
130
117
cp -r HandBrake.app "HandBrake $(HB_VERSION)" && \
131
- zip -9 -r $(1 ) "HandBrake $(HB_VERSION)" && \
118
+ zip -9 -r $(< ) "HandBrake $(HB_VERSION)" && \
132
119
rm -rf "HandBrake $(HB_VERSION)"
133
120
}
134
121
122
+ rule SystemLibraries
123
+ {
124
+ LINKLIBS on [ FAppendSuffix $(<) : $(SUFEXE) ] += $(>) ;
125
+ }
126
+
127
+ # Jambase's ObjectHdrs doesn't seem to work when ObjectHdrs is called
128
+ # several times on a file, and it doesn't works for asm files. Fixed
129
+ # here.
130
+ rule ObjectHdrs
131
+ {
132
+ local s = [ FGristFiles $(<:S=$(SUFOBJ)) ] ;
133
+ HDRS on $(s) += $(>) ;
134
+ ASHDRS on $(s) += [ FIncludes $(>) ] ;
135
+ CCHDRS on $(s) += [ FIncludes $(>) ] ;
136
+ }
137
+
0 commit comments