File: rules

package info (click to toggle)
view3dscene 3.18.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 19,616 kB
  • sloc: pascal: 3,559; sh: 533; xml: 159; makefile: 120
file content (66 lines) | stat: -rwxr-xr-x 1,961 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS := hardening=+bindnow
export DH_ALWAYS_EXCLUDE := COPYING:LICENSE
export LANG:=C

# Set FPCVER
FPCVER=$(shell fpc -iV)

# Get directories
CURDIR:=$(shell pwd)
TMP_DIR=$(CURDIR)/debian/tmp

# Get current upstream CGE version as that is used in the path of it's files
CGEVERSION := $(shell dpkg-query -f '$${Version}'  -W 'fp-units-castle-game-engine' | sed -e 's/-[^-]*$$//g;s/+dfsg[0-9]*//g')

# Set default compilation options
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LDFLAGS=$(strip $(shell DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \
	dpkg-buildflags --get LDFLAGS | \
	sed -e 's/-Wl,//g' -e 's/,/ /g' -e 's1-specs=/usr/share/dpkg/.*\.specs11'))
BUILDOPTS=-k"${LDFLAGS}"\
	-dRELEASE \
	-Mobjfpc \
	-Sh \
	-Ci \
	-Sm \
	-Sc \
	-Sg \
	-Si \
	-O2 \
	-Xs \
	-Fu/usr/lib/${DEB_HOST_MULTIARCH}/fp-units-${FPCVER}/castle-game-engine-${CGEVERSION}/

#export DH_VERBOSE=1

%:
	dh ${@}

override_dh_auto_clean:
	$(MAKE) clean-code
	dh_auto_clean

override_dh_auto_build-arch:
	mkdir -p $(TMP_DIR)

	# Once pasdoc ships file_to_pascal_string, the next lines can be simplified
	fpc -FE$(TMP_DIR) debian/file_to_pascal_string.dpr
	PATH=${PATH}:$(TMP_DIR) $(MAKE) generate-code

	fpc $(BUILDOPTS) code/view3dscene.lpr
	fpc $(BUILDOPTS) code/tovrmlx3d.lpr

	inkscape --export-width=48 --export-height=48 desktop/view3dscene.svg --export-png=desktop/view3dscene.png

override_dh_auto_test:
	# Code to run the package test suite.
	# We need the directories where the files to test are to be
	# writeable by the current (non-root) user. Copying them in
	# the current tree is the easiest way to accomplish that.
	mkdir -p $(TMP_DIR)/whitedune
	cp -R /usr/share/doc/whitedune-docs/ $(TMP_DIR)/whitedune
	PATH=$$PATH:$(CURDIR)/code jenkins_scripts/run_tests.sh $(TMP_DIR)/run_tests_errors.txt $(TMP_DIR)/run_tests_output.txt
	cat $(TMP_DIR)/run_tests_errors.txt

override_dh_auto_install: