File: rules

package info (click to toggle)
libsdl-sge 030809dfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,224 kB
  • sloc: cpp: 8,973; makefile: 119; ansic: 44; sh: 19
file content (47 lines) | stat: -rwxr-xr-x 1,583 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

DEB_CFLAGS_MAINT_APPEND  := $(shell dpkg-buildflags --get CPPFLAGS)
DEB_CFLAGS_MAINT_APPEND  += $(shell dpkg-buildflags --get CFLAGS)
DEB_CFLAGS_MAINT_APPEND  += -pipe -Wall
export DEB_CFLAGS_MAINT_APPEND
export DEB_LDFLAGS_MAINT_APPEND := -Wl,--no-undefined -Wl,--as-needed $(shell dpkg-buildflags --get LDFLAGS)

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIB_MULTIARCH_DIR = /usr/lib/$(DEB_HOST_MULTIARCH)

ALL_CUSTOM_CFLAGS  := $(DEB_CFLAGS_MAINT) $(DEB_CFLAGS_MAINT_APPEND)
ALL_CUSTOM_LDFLAGS := $(DEB_LDFLAGS_MAINT) $(DEB_LDFLAGS_MAINT_APPEND)


%:
	dh $@

override_dh_auto_build:
        # Build the static library and make a backup
	rm -f libSGE.a
	dh_auto_build -- all CUSTOM_CFLAGS="$(ALL_CUSTOM_CFLAGS)" CUSTOM_LDFLAGS="$(ALL_CUSTOM_LDFLAGS)"
	rm -f libSGE.bak
	mv libSGE.a libSGE.bak

        # Build the shared library and restore the static backup
	$(MAKE) clean
	dh_auto_build -- shared CUSTOM_CFLAGS="$(ALL_CUSTOM_CFLAGS)" CUSTOM_LDFLAGS="$(ALL_CUSTOM_LDFLAGS)"
	rm -f libSGE.a
	mv libSGE.bak libSGE.a

override_dh_auto_install:
	echo $(CURDIR)
	$(MAKE) install PREFIX=$(CURDIR)/debian/tmp/usr PREFIX_H=$(CURDIR)/debian/tmp/usr/include/SDL

        # multi-arch support
	mkdir -p $(CURDIR)/debian/tmp/$(LIB_MULTIARCH_DIR)
	mv ./debian/tmp/usr/lib/libSGE*.a   $(CURDIR)/debian/tmp/$(LIB_MULTIARCH_DIR)
	mv ./debian/tmp/usr/lib/libSGE*.so* $(CURDIR)/debian/tmp/$(LIB_MULTIARCH_DIR)

override_dh_compress:
	dh_compress -Xexamples/

override_dh_makeshlibs:
	dh_makeshlibs -V 'libsdl-sge (>= 030809-1)'