File: rules

package info (click to toggle)
ldc 1:1.21.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 52,516 kB
  • sloc: cpp: 57,473; ansic: 10,568; sh: 1,260; makefile: 800; asm: 507; objc: 91; exp: 30; python: 12
file content (80 lines) | stat: -rwxr-xr-x 2,431 bytes parent folder | download | duplicates (2)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1

include /usr/share/dpkg/architecture.mk

CFLAGS += $(CPPFLAGS)
CXXFLAGS += $(CPPFLAGS)

LDC_BUILD_FLAGS = -DINCLUDE_INSTALL_DIR='/usr/lib/ldc/${DEB_HOST_MULTIARCH}/include/d'
BOOTSTRAP_LDC_FLAGS = -DD_COMPILER=/usr/bin/gdmd -DBUILD_SHARED_LIBS=ON

ifeq ($(DEB_HOST_ARCH),armhf)
LDC_BUILD_FLAGS += -DD_COMPILER_FLAGS=-mattr=-neon
endif

BOOTSTRAP_S1_BUILD_DIR := $(CURDIR)/bootstrap-stage1
STAGE1_LDMD = $(BOOTSTRAP_S1_BUILD_DIR)/bin/ldmd2

BOOTSTRAP_S2_BUILD_DIR := $(CURDIR)/bootstrap-stage2
STAGE2_LDMD = $(BOOTSTRAP_S2_BUILD_DIR)/bin/ldmd2

%:
	dh $@

override_dh_auto_configure:
	# Bootstrap LDC using the GNU D Compiler
	dh_auto_configure -B$(BOOTSTRAP_S1_BUILD_DIR) -- $(BOOTSTRAP_LDC_FLAGS)
	dh_auto_build -B$(BOOTSTRAP_S1_BUILD_DIR)

	# Build LDC again using the previously bootstrapped copy
	dh_auto_configure -B$(BOOTSTRAP_S2_BUILD_DIR) -- \
			-DD_COMPILER=$(STAGE1_LDMD) \
			-DBUILD_SHARED_LIBS=OFF $(LDC_BUILD_FLAGS)
	dh_auto_build -B$(BOOTSTRAP_S2_BUILD_DIR)

	# Configure the to-be-released LDC versions, build them with S2 self-built LDC
	[ -d build-static ] || mkdir build-static
	dh_auto_configure -B$(CURDIR)/build-static -- \
			-DD_COMPILER=$(STAGE2_LDMD) \
			-DBUILD_SHARED_LIBS=OFF $(LDC_BUILD_FLAGS)

	[ -d build-shared ] || mkdir build-shared
	dh_auto_configure -B$(CURDIR)/build-shared -- \
			-DD_COMPILER=$(STAGE2_LDMD) \
			-DBUILD_SHARED_LIBS=ON $(LDC_BUILD_FLAGS)

override_dh_auto_build:
	dh_auto_build -Bbuild-static
	dh_auto_build -Bbuild-shared

override_dh_auto_install:
	(cd build-static && $(MAKE) install DESTDIR="$(CURDIR)/debian/tmp")
	(cd build-shared && $(MAKE) install DESTDIR="$(CURDIR)/debian/tmp")
	rmdir $(CURDIR)/debian/tmp/usr/lib/ldc/*/include/d/etc/c/zlib/

override_dh_missing:
	dh_missing --fail-missing

override_dh_installman:
	dh_installman debian/ldc2.1 debian/ldmd2.1

override_dh_clean:
	rm -rf build-static build-shared
	rm -f configure-stamp build-stamp
	rm -rf $(BOOTSTRAP_S1_BUILD_DIR) $(BOOTSTRAP_S2_BUILD_DIR)
	dh_clean

override_dh_makeshlibs:
	dh_makeshlibs -V

override_dh_dwz:
	# NOTE: Disabled because this somehow triggers an library-in-debug-or-profile-should-not-be-stripped
	# This needs investigating
	:

override_dh_auto_test:
	# Tests, std.zip, std.zip-debug, std.zip-shared, std.zip-debug-shared, dmd-testsuite-debug. dmd-testsuite fail at the moment, so
	# we disable tests temporarily
	: