1 include Makefile.config
3 SYSTEM = $(shell uname -s)
5 # Special case for Mac OS X: everything is handled from the Xcode project
10 ifeq ($(SYSTEM),Darwin)
12 snapshot: clean unstable-libhb/hbversion.h snapshot-app
13 official: clean force-hbversion app
16 rm -f libhb/hbversion.h
20 all-chunky: clean app-chunky
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' )
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' )
33 @$(MAKE) --no-print-directory -C contrib all
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' )
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' )
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' )
45 (cd macosx ; xcodebuild -alltargets -configuration UB clean | sed '/^$$/d' ; rm -f libhb/hbversion.h ; rm -f contrib/config.cache )
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' )
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 )
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 )
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 )
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 )
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 )
70 ifeq ($(SYSTEM),Linux)
72 snapshot: unstable-libhb/hbversion.h all
74 official: force-hbversion all
77 rm -f libhb/hbversion.h
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 )
83 @$(MAKE) --no-print-directory -C contrib all
85 libhb/libhb.a: libhb/hbversion.h
86 @$(MAKE) --no-print-directory -C libhb all
88 HandBrakeCLI: libhb/libhb.a
89 @$(MAKE) --no-print-directory -C test all
92 @$(MAKE) --no-print-directory -C libhb clean
93 @$(MAKE) --no-print-directory -C test clean
95 @rm -f contrib/config.cache
98 @$(MAKE) --no-print-directory -C contrib mrproper
105 ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT)
107 all: contrib/.contrib HandBrakeCLI
110 @$(MAKE) --no-print-directory -C contrib all
112 libhb/libhb.a: unstable-libhb/hbversion.h
113 @$(MAKE) --no-print-directory -C libhb all
115 HandBrakeCLI: libhb/libhb.a
116 @$(MAKE) --no-print-directory -C test all
119 @$(MAKE) --no-print-directory -C libhb clean
120 @$(MAKE) --no-print-directory -C test clean
121 @rm libhb/hbversion.h
124 @$(MAKE) --no-print-directory -C contrib mrproper
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
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