1 |
#!/usr/bin/make -f |
2 |
# -*- makefile -*- |
3 |
|
4 |
# Uncomment this to turn on verbose mode. |
5 |
# export DH_VERBOSE=1 |
6 |
|
7 |
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) |
8 |
CMAKE_BUILD_TYPE=Debug |
9 |
else |
10 |
CMAKE_BUILD_TYPE=Release |
11 |
endif |
12 |
|
13 |
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
14 |
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
15 |
MAKEFLAGS += -j$(NUMJOBS) |
16 |
endif |
17 |
|
18 |
USER_CFLAGS=$(shell dpkg-buildflags --get CFLAGS) |
19 |
USER_CXXFLAGS=$(shell dpkg-buildflags --get CXXFLAGS) |
20 |
|
21 |
build: build-stamp |
22 |
build-stamp: |
23 |
dh_testdir |
24 |
|
25 |
# backup orig makefile |
26 |
for makefile in `find ./ -name "Makefile"` ; do [ -f $${makefile}.orig ] || mv $${makefile} $${makefile}.orig ; done |
27 |
|
28 |
# Cmake based makefile |
29 |
cmake CMakeLists.txt \ |
30 |
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \ |
31 |
-DCMAKE_BUILD_STRIP=FALSE \ |
32 |
-DFORCE_INTERNAL_SOUNDTOUCH=FALSE \ |
33 |
-DL10N_PORTABLE=FALSE \ |
34 |
-DUSER_CMAKE_C_FLAGS:STRING="$(USER_CFLAGS)" \ |
35 |
-DUSER_CMAKE_CXX_FLAGS:STRING="$(USER_CXXFLAGS)" \ |
36 |
-DCMAKE_INSTALL_PREFIX="/usr" \ |
37 |
-DPACKAGE_MODE=TRUE |
38 |
$(MAKE) $(MAKEFLAGS) |
39 |
|
40 |
touch build-stamp |
41 |
|
42 |
clean: |
43 |
dh_testdir |
44 |
dh_testroot |
45 |
rm -f build-stamp |
46 |
|
47 |
# Backup some orig makefile if it's not already done. |
48 |
# I hope that some will be delete by upstream when the cmake port is over. |
49 |
# Note: In case that we do not dl all the plugins, the test [ -f $${makefile} ] ensures it works |
50 |
for makefile in plugins/CDVDlinuz/Src/Linux/Makefile \ |
51 |
plugins/CDVDiso/src/Linux/Makefile \ |
52 |
plugins/CDVDiso/src/Windows/Makefile \ |
53 |
plugins/USBnull/Windows/Makefile \ |
54 |
plugins/FWnull/Windows/Makefile \ |
55 |
plugins/PeopsSPU2/Makefile \ |
56 |
plugins/CDVDisoEFP/src/Linux/Makefile ; do \ |
57 |
[ -f $${makefile}.orig ] || ( [ -f $${makefile} ] && mv $${makefile} $${makefile}.orig ) || true ; done |
58 |
|
59 |
# Add here the commands to clean up after the build process. |
60 |
[ -f Makefile ] && $(MAKE) clean || true |
61 |
# Remove cmake stuff |
62 |
rm -fr $$(find . -type d -name CMakeFiles) |
63 |
rm -f $$(find . -type f -name CMakeCache.txt) $$(find . -type f -name cmake_install.cmake) |
64 |
rm -f $$(find . -type f -name Makefile) |
65 |
# leftover of cmake |
66 |
rm -f bin/plugins/ps2hw.dat |
67 |
rm -f pcsx2/svnrev.h |
68 |
# Restore orig makefile |
69 |
for makefile_orig in `find ./ -name "Makefile.orig"` ; do [ -f $${makefile_orig} ] && mv $${makefile_orig} `echo $${makefile_orig} | sed -e 's/.orig//'` ; done |
70 |
# do not know who create this file.... |
71 |
rm -f install_manifest.txt |
72 |
|
73 |
dh_clean |
74 |
|
75 |
## Uncomment this, if fglrx driver is installed |
76 |
#override_dh_shlibdeps: |
77 |
# dh_shlibdeps -- --ignore-missing-info |
78 |
|
79 |
override_dh_strip: |
80 |
dh_strip --package=pcsx2-unstable --dbg-package=pcsx2-unstable-dbg |
81 |
dh_strip --package=pcsx2-plugins-unstable --dbg-package=pcsx2-plugins-unstable-dbg |
82 |
|
83 |
# Avoid to relaunch the compilation twice. (build and dh_auto_build target) |
84 |
override_dh_auto_build: |
85 |
# Do nothing |
86 |
|
87 |
%: |
88 |
dh $@ |
89 |
|
90 |
.PHONY: build clean install |