2010-07-03 07:26:04 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
# -*- makefile -*-
|
|
|
|
|
|
|
|
# Uncomment this to turn on verbose mode.
|
|
|
|
# export DH_VERBOSE=1
|
|
|
|
|
|
|
|
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
|
|
|
|
CMAKE_BUILD_TYPE=Debug
|
|
|
|
else
|
|
|
|
CMAKE_BUILD_TYPE=Release
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
|
|
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
|
|
MAKEFLAGS += -j$(NUMJOBS)
|
|
|
|
endif
|
|
|
|
|
2010-07-08 19:03:55 +00:00
|
|
|
USER_CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
|
|
|
|
USER_CXXFLAGS=$(shell dpkg-buildflags --get CXXFLAGS)
|
|
|
|
|
2010-07-03 07:26:04 +00:00
|
|
|
build: build-stamp
|
|
|
|
build-stamp:
|
|
|
|
dh_testdir
|
|
|
|
|
|
|
|
# backup orig makefile
|
|
|
|
for makefile in `find ./ -name "Makefile"` ; do [ -f $${makefile}.orig ] || mv $${makefile} $${makefile}.orig ; done
|
|
|
|
|
|
|
|
# Cmake based makefile
|
2010-07-08 19:03:55 +00:00
|
|
|
cmake CMakeLists.txt \
|
|
|
|
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
|
|
|
|
-DCMAKE_BUILD_STRIP=FALSE \
|
|
|
|
-DFORCE_INTERNAL_SOUNDTOUCH=FALSE \
|
2010-07-27 06:09:24 +00:00
|
|
|
-DUSER_CMAKE_C_FLAGS:STRING="$(USER_CFLAGS)" \
|
|
|
|
-DUSER_CMAKE_CXX_FLAGS:STRING="$(USER_CXXFLAGS)"
|
2010-07-03 07:26:04 +00:00
|
|
|
$(MAKE) $(MAKEFLAGS)
|
|
|
|
|
|
|
|
touch build-stamp
|
|
|
|
|
|
|
|
clean:
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
rm -f build-stamp
|
|
|
|
|
|
|
|
# Backup some orig makefile if it not already done
|
|
|
|
# I hope some will be delete by upstream when cmake port is over
|
|
|
|
# Note in case we do not dl all plugins the test [ -f $${makefile} ] ensure the working
|
|
|
|
for makefile in plugins/CDVDlinuz/Src/Linux/Makefile \
|
|
|
|
plugins/CDVDiso/src/Linux/Makefile \
|
|
|
|
plugins/CDVDiso/src/Windows/Makefile \
|
|
|
|
plugins/USBnull/Windows/Makefile \
|
|
|
|
plugins/FWnull/Windows/Makefile \
|
|
|
|
plugins/PeopsSPU2/Makefile \
|
|
|
|
plugins/CDVDisoEFP/src/Linux/Makefile ; do \
|
|
|
|
[ -f $${makefile}.orig ] || ( [ -f $${makefile} ] && mv $${makefile} $${makefile}.orig ) || true ; done
|
|
|
|
|
|
|
|
# Add here commands to clean up after the build process.
|
|
|
|
[ -f Makefile ] && $(MAKE) clean || true
|
|
|
|
# Remove cmake stuff
|
|
|
|
rm -fr $$(find . -type d -name CMakeFiles)
|
|
|
|
rm -f $$(find . -type f -name CMakeCache.txt) $$(find . -type f -name cmake_install.cmake)
|
|
|
|
rm -f $$(find . -type f -name Makefile)
|
|
|
|
# File generated by bin2cpp
|
|
|
|
cd pcsx2/gui/Resources/ && rm -f App*.h Config*.h BackgroundLogo.h ButtonIcon_Camera.h Dualshock.h
|
|
|
|
# leftover of cmake
|
|
|
|
rm -f bin/plugins/ps2hw.dat
|
|
|
|
rm -f pcsx2/svnrev.h
|
|
|
|
# Restore orig makefile
|
|
|
|
for makefile_orig in `find ./ -name "Makefile.orig"` ; do [ -f $${makefile_orig} ] && mv $${makefile_orig} `echo $${makefile_orig} | sed -e 's/.orig//'` ; done
|
|
|
|
|
|
|
|
dh_clean
|
|
|
|
|
|
|
|
install:
|
|
|
|
install: build
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
dh_prep
|
|
|
|
dh_installdirs
|
|
|
|
|
|
|
|
### the project build usefull thing in ./bin so directly install
|
|
|
|
### from this directory to the debian pkg directory (skip debian/tmp)
|
2010-07-06 17:10:23 +00:00
|
|
|
# Ubuntu use debian/tmp as default sourcedir...
|
|
|
|
# copy bin into debian tmp
|
|
|
|
mkdir -p debian/tmp
|
|
|
|
cp -fr bin debian/tmp
|
|
|
|
dh_install --sourcedir=debian/tmp
|
2010-07-03 07:26:04 +00:00
|
|
|
|
|
|
|
# install menu and icon
|
|
|
|
cp debian/pcsx2.desktop debian/pcsx2-unstable/usr/share/applications
|
|
|
|
cp debian/pcsx2.xpm debian/pcsx2-unstable/usr/share/pixmaps
|
|
|
|
|
2010-07-05 15:43:21 +00:00
|
|
|
# lintian override
|
|
|
|
dh_lintian
|
|
|
|
|
2010-07-03 07:26:04 +00:00
|
|
|
# Build architecture-independent files here.
|
|
|
|
binary-indep: build install
|
|
|
|
dh_testdir -i
|
|
|
|
dh_testroot -i
|
|
|
|
dh_installchangelogs -i
|
|
|
|
dh_installdocs -i
|
|
|
|
dh_installman -i
|
|
|
|
dh_link -i
|
|
|
|
dh_compress -i
|
|
|
|
dh_fixperms -i
|
|
|
|
dh_installdeb -i
|
|
|
|
dh_gencontrol -i
|
|
|
|
dh_md5sums -i
|
|
|
|
dh_builddeb -i
|
|
|
|
|
|
|
|
# Build architecture-dependent files here.
|
|
|
|
binary-arch: build install
|
|
|
|
dh_testdir -a
|
|
|
|
dh_testroot -a
|
|
|
|
dh_installchangelogs -a
|
|
|
|
dh_installdocs -a
|
|
|
|
dh_installmenu -a
|
|
|
|
dh_installman -a
|
|
|
|
dh_strip --package=pcsx2-unstable --dbg-package=pcsx2-unstable-dbg
|
|
|
|
dh_strip --package=pcsx2-plugins-unstable --dbg-package=pcsx2-plugins-unstable-dbg
|
|
|
|
dh_link -a
|
|
|
|
dh_compress -a
|
|
|
|
dh_fixperms -a
|
|
|
|
dh_makeshlibs -a
|
|
|
|
dh_installdeb -a
|
|
|
|
# XXX: WARNING to test the package on my system I must add the option (--exclude)
|
|
|
|
# due to fglrx drivers modify libGL. It must be re-enable for final packaging
|
|
|
|
# dh_shlibdeps -a
|
|
|
|
dh_shlibdeps -a --exclude=libzzogl
|
|
|
|
dh_gencontrol -a
|
|
|
|
dh_md5sums -a
|
|
|
|
dh_builddeb -a
|
|
|
|
|
|
|
|
binary: binary-indep binary-arch
|
|
|
|
.PHONY: build clean binary-indep binary-arch binary install
|