OSDN Git Service

import 0.9.4
[handbrake-jp/handbrake-jp.git] / Makefile
1 include Makefile.config
2
3 SYSTEM = $(shell uname -s)
4
5 # Special case for Mac OS X: everything is handled from the Xcode project
6
7 #
8 # Darwin
9 #
10 ifeq ($(SYSTEM),Darwin)
11
12 snapshot:   clean unstable-libhb/hbversion.h snapshot-app
13 official:   clean force-hbversion app
14
15 force-hbversion:
16         rm -f libhb/hbversion.h
17
18 all:    clean app
19
20 all-chunky:    clean app-chunky
21
22 test:   clean cli
23
24 dev:    clean internal
25
26 ub-app:    libhb/hbversion.h
27         (./DownloadMacOsXContribBinaries.sh ; cd macosx ; xcodebuild -target libhb -target HandBrake -target HandBrakeCLI -configuration UB HB_BUILD="$(HB_BUILD)" HB_VERSION="$(HB_VERSION)" APPCAST_URL="http://handbrake.fr/appcast.xml" build | sed '/^$$/d'  )
28
29 app: contrib/.contrib libhb/hbversion.h
30                 ( cd macosx ; xcodebuild -target libhb -target HandBrake -target HandBrakeCLI -configuration Deployment HB_BUILD="$(HB_BUILD)" HB_VERSION="$(HB_VERSION)" CURRENT_PROJECT_VERSION="$(HB_VERSION)" APPCAST_URL="http://handbrake.fr/appcast.xml" build | sed '/^$$/d' )
31
32 contrib/.contrib:
33         @$(MAKE) --no-print-directory -C contrib all
34
35 snapshot-app: contrib/.contrib libhb/hbversion.h
36         ( cd macosx ; xcodebuild -target libhb -target HandBrake -target HandBrakeCLI -configuration Deployment HB_BUILD="$(SNAP_HB_BUILD)" HB_VERSION="$(SNAP_HB_VERSION)" CURRENT_PROJECT_VERSION="$(SNAP_HB_VERSION)" APPCAST_URL="http://handbrake.fr/appcast_unstable.xml" build | sed '/^$$/d' )
37
38 app-chunky: libhb/hbversion.h
39         (./DownloadMacOsXContribBinaries.sh ; cd macosx ; xcodebuild -alltargets -configuration UB HB_BUILD="$(HB_BUILD)" HB_VERSION="$(HB_VERSION)" APPCAST_URL="http://handbrake.fr/appcast.xml" build | sed '/^$$/d'  )
40
41 cli:    libhb/hbversion.h
42         (./DownloadMacOsXContribBinaries.sh ; cd macosx ; xcodebuild -target libhb -target HandBrakeCLI -configuration UB HB_BUILD="$(HB_BUILD)" HB_VERSION="$(HB_VERSION)" build | sed '/^$$/d' )
43
44 clean:
45         (cd macosx ; xcodebuild -alltargets -configuration UB clean | sed '/^$$/d' ; rm -f libhb/hbversion.h ; rm -f contrib/config.cache )
46
47 mrproper:
48         (rm -rf libhb/hbversion.h contrib/*tar.gz contrib/include contrib/lib contrib/DarwinContribVersion.txt ; cd macosx ; xcodebuild -alltargets -configuration UB clean | sed '/^$$/d' )
49
50 release:
51         (rm -rf HandBrake HandBrake*dmg ; mkdir -p HandBrake/api HandBrake/doc HandBrake/doc/pdf; cp test/BUILDSHARED AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/doc ; cp -rp pdf/ HandBrake/doc/pdf/ ; cp -rp HandBrake.app HandBrake ; cp -rp libhb/libhb.dylib HandBrake/api ; cp -rp libhb/hb.h libhb/common.h libhb/ports.h HandBrake/api ; cp -rp HandBrakeCLI HandBrake ; hdiutil create -srcfolder HandBrake  -format UDZO HandBrake-$(HB_VERSION)-MacOS_UB.dmg ; rm -rf HandBrake )
52
53 gui-release:
54         (rm -rf HandBrake HandBrake*GUI_UB.dmg ; mkdir -p HandBrake/docs ; cp AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/docs ; cp -rp HandBrake.app HandBrake  ; hdiutil create -srcfolder HandBrake  -format UDBZ HandBrake-$(HB_VERSION)-MacOSX.4_GUI_UB.dmg ; rm -rf HandBrake )
55
56 cli-release:
57         (rm -rf HandBrake HandBrake*CLI_UB.dmg ; mkdir -p HandBrake/docs ; cp test/BUILDSHARED AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/docs ; cp -rp HandBrakeCLI HandBrake ; hdiutil create -srcfolder HandBrake  -format UDZO HandBrake-$(HB_VERSION)-MacOSX.3_CLI_UB.dmg ; rm -rf HandBrake )
58
59 gui-snapshot-release:
60         (rm -rf HandBrake HandBrake*GUI_UB.dmg ; mkdir -p HandBrake/docs ; cp AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/docs ; cp -rp HandBrake.app HandBrake  ; hdiutil create -srcfolder HandBrake  -format UDBZ HandBrake-$(SNAP_HB_VERSION)-MacOSX.5_GUI_UB.dmg ; rm -rf HandBrake )
61
62 cli-snapshot-release:
63         (rm -rf HandBrake HandBrake*CLI_UB.dmg ; mkdir -p HandBrake/docs ; cp test/BUILDSHARED AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/docs ; cp -rp HandBrakeCLI HandBrake ; hdiutil create -srcfolder HandBrake  -format UDZO HandBrake-$(SNAP_HB_VERSION)-MacOSX.5_CLI_UB.dmg ; rm -rf HandBrake )
64
65 endif
66
67 #
68 # Linux
69 #
70 ifeq ($(SYSTEM),Linux)
71
72 snapshot: unstable-libhb/hbversion.h all
73
74 official: force-hbversion all
75
76 force-hbversion:
77         rm -f libhb/hbversion.h
78
79 all:    contrib/.contrib libhb/hbversion.h HandBrakeCLI
80         (rm -rf HandBrake HandBrake*.tar.gz ; mkdir -p HandBrake/api HandBrake/doc; cp test/BUILDSHARED AUTHORS BUILD COPYING CREDITS NEWS THANKS TRANSLATIONS HandBrake/doc ;  cp -rp libhb/hb.h libhb/common.h libhb/ports.h HandBrake/api ; cp -rp HandBrakeCLI HandBrake ; tar zcvf HandBrake-$(HB_VERSION)_i386.tar.gz HandBrake ; rm -rf HandBrake )
81
82 contrib/.contrib:
83         @$(MAKE) --no-print-directory -C contrib all
84
85 libhb/libhb.a: libhb/hbversion.h
86         @$(MAKE) --no-print-directory -C libhb all
87
88 HandBrakeCLI: libhb/libhb.a
89         @$(MAKE) --no-print-directory -C test all
90
91 clean:
92         @$(MAKE) --no-print-directory -C libhb clean
93         @$(MAKE) --no-print-directory -C test clean
94         @rm libhb/hbversion.h
95         @rm -f contrib/config.cache
96
97 mrproper: clean
98         @$(MAKE) --no-print-directory -C contrib mrproper
99
100 endif
101
102 #
103 # Cygwin
104 #
105 ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT)
106
107 all:    contrib/.contrib HandBrakeCLI
108
109 contrib/.contrib:
110         @$(MAKE) --no-print-directory -C contrib all
111
112 libhb/libhb.a: unstable-libhb/hbversion.h
113         @$(MAKE) --no-print-directory -C libhb all
114
115 HandBrakeCLI: libhb/libhb.a
116         @$(MAKE) --no-print-directory -C test all
117         
118 clean:
119         @$(MAKE) --no-print-directory -C libhb clean
120         @$(MAKE) --no-print-directory -C test clean
121         @rm libhb/hbversion.h
122
123 mrproper: clean
124         @$(MAKE) --no-print-directory -C contrib mrproper
125
126 endif
127
128 libhb/hbversion.h:
129         echo "#ifndef HB_BUILD" > libhb/hbversion.h
130         echo "#define HB_BUILD $(HB_BUILD)" >> libhb/hbversion.h
131         echo "#endif" >> libhb/hbversion.h
132         echo "#ifndef HB_VERSION" >> libhb/hbversion.h
133         echo "#define HB_VERSION \"$(HB_VERSION)\"" >> libhb/hbversion.h
134         echo "#endif" >> libhb/hbversion.h
135         echo "#ifndef HB_APPCAST_URL" >> libhb/hbversion.h
136         echo "#define APPCAST_URL \"http://handbrake.fr/appcast.xml\"" >> libhb/hbversion.h
137         echo "#endif" >> libhb/hbversion.h
138
139 unstable-libhb/hbversion.h:
140         echo "#ifndef HB_BUILD" > libhb/hbversion.h
141         echo "#define HB_BUILD $(SNAP_HB_BUILD)" >> libhb/hbversion.h
142         echo "#endif" >> libhb/hbversion.h
143         echo "#ifndef HB_VERSION" >> libhb/hbversion.h
144         echo "#define HB_VERSION \"$(SNAP_HB_VERSION)\"" >> libhb/hbversion.h
145         echo "#endif" >> libhb/hbversion.h
146         echo "#ifndef HB_APPCAST_URL" >> libhb/hbversion.h
147         echo "#define APPCAST_URL \"http://handbrake.fr/appcast_unstable.xml\"" >> libhb/hbversion.h
148         echo "#endif" >> libhb/hbversion.h