File: rules

package info (click to toggle)
fgrun 3.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,352 kB
  • ctags: 701
  • sloc: cpp: 7,615; sh: 507; makefile: 26; ansic: 8
file content (38 lines) | stat: -rwxr-xr-x 1,102 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE=1

#http://wiki.debian.org/Hardening#Notes_for_packages_using_CMake
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

CMAKE_FLAGS = \
	-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
	-DCMAKE_C_FLAGS="$(CFLAGS)" \
	-DCMAKE_CXX_FLAGS="$(CXXFLAGS)" \
	-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-g -DNDEBUG" \
	-DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS)" \
	-DCMAKE_VERBOSE_MAKEFILE=ON \
	-DCMAKE_INSTALL_PREFIX:PATH=/usr \
	-DCMAKE_INSTALL_BINDIR:PATH=games \
	-DSIMGEAR_SHARED:BOOL=ON

%:
	dh $@ --buildsystem=cmake --builddirectory=build --parallel

override_dh_auto_configure:
	mkdir build
	cd build && cmake .. $(CMAKE_FLAGS)

override_dh_auto_install:
	dh_auto_install

#	The CMAKE_INSTALL_BINDIR might be ignored
	if [ -d debian/fgrun/usr/bin ]; then \
		dh_installdirs --package=fgrun usr/games; \
		mv debian/fgrun/usr/bin/* -t debian/fgrun/usr/games; \
		rmdir debian/fgrun/usr/bin; \
	fi