Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 #export DH_VERBOSE=1
4
5 DEB_CFLAGS_MAINT_APPEND := $(shell dpkg-buildflags --get CPPFLAGS)
6 DEB_CFLAGS_MAINT_APPEND += $(shell dpkg-buildflags --get CFLAGS)
7 DEB_CFLAGS_MAINT_APPEND += -pipe -Wall
8 export DEB_CFLAGS_MAINT_APPEND
9 export DEB_LDFLAGS_MAINT_APPEND := -Wl,--no-undefined -Wl,--as-needed $(shell dpkg-buildflags --get LDFLAGS)
10
11 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
12 LIB_MULTIARCH_DIR = /usr/lib/$(DEB_HOST_MULTIARCH)
13
14 ALL_CUSTOM_CFLAGS := $(DEB_CFLAGS_MAINT) $(DEB_CFLAGS_MAINT_APPEND)
15 ALL_CUSTOM_LDFLAGS := $(DEB_LDFLAGS_MAINT) $(DEB_LDFLAGS_MAINT_APPEND)
16
17
18 %:
19 dh $@
20
21 override_dh_auto_build:
22 # Build the static library and make a backup
23 rm -f libSGE.a
24 dh_auto_build -- all CUSTOM_CFLAGS="$(ALL_CUSTOM_CFLAGS)" CUSTOM_LDFLAGS="$(ALL_CUSTOM_LDFLAGS)"
25 rm -f libSGE.bak
26 mv libSGE.a libSGE.bak
27
28 # Build the shared library and restore the static backup
29 $(MAKE) clean
30 dh_auto_build -- shared CUSTOM_CFLAGS="$(ALL_CUSTOM_CFLAGS)" CUSTOM_LDFLAGS="$(ALL_CUSTOM_LDFLAGS)"
31 rm -f libSGE.a
32 mv libSGE.bak libSGE.a
33
34 override_dh_auto_install:
35 echo $(CURDIR)
36 $(MAKE) install PREFIX=$(CURDIR)/debian/tmp/usr PREFIX_H=$(CURDIR)/debian/tmp/usr/include/SDL
37
38 # multi-arch support
39 mkdir -p $(CURDIR)/debian/tmp/$(LIB_MULTIARCH_DIR)
40 mv ./debian/tmp/usr/lib/libSGE*.a $(CURDIR)/debian/tmp/$(LIB_MULTIARCH_DIR)
41 mv ./debian/tmp/usr/lib/libSGE*.so* $(CURDIR)/debian/tmp/$(LIB_MULTIARCH_DIR)
42
43 override_dh_compress:
44 dh_compress -Xexamples/
45
46 override_dh_makeshlibs:
47 dh_makeshlibs -V 'libsdl-sge (>= 030809-1)'