File: rules

package info (click to toggle)
ldraw-parts-free 2502%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 434,740 kB
  • sloc: ansic: 581; python: 177; sh: 32; makefile: 17
file content (31 lines) | stat: -rwxr-xr-x 1,370 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# for cross-build aware CC and CC_FOR_BUILD
include /usr/share/dpkg/buildtools.mk

# only necessary until dpkg provides this
CFLAGS_FOR_BUILD ?= $(shell   dpkg-architecture --host-arch $(DEB_BUILD_ARCH) --force --command dpkg-buildflags --get CFLAGS)
CPPFLAGS_FOR_BUILD ?= $(shell dpkg-architecture --host-arch $(DEB_BUILD_ARCH) --force --command dpkg-buildflags --get CPPFLAGS)
LDFLAGS_FOR_BUILD ?= $(shell  dpkg-architecture --host-arch $(DEB_BUILD_ARCH) --force --command dpkg-buildflags --get LDFLAGS)

%:
	dh $@

execute_after_dh_auto_build:
	# compile host architecture version to be included in ldraw-mklist package
	$(CC) -o mklist $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -I./include mklist.c
	# compile build architecture version to run during the build
	# this is only needed to support cross-compilation
	# in the native case, this is identical to the above
	$(CC_FOR_BUILD) -o mklist-native $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -I./include mklist.c
	./mklist-native -i parts -d

execute_after_dh_auto_install:
	mkdir -p debian/tmp/usr/bin debian/tmp/usr/share/ldraw
	cp mklist debian/tmp/usr/bin/ldraw-mklist
	cp -r LDCfgalt.ldr LDConfig.ldr LDConfig_TLG.ldr parts models p debian/tmp/usr/share/ldraw/

execute_after_dh_auto_clean:
	rm -f mklist mklist-native parts.lst