File: rules

package info (click to toggle)
dlm 0.trunk20050206-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 264 kB
  • ctags: 671
  • sloc: ansic: 4,128; makefile: 189; perl: 165
file content (118 lines) | stat: -rwxr-xr-x 2,937 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

include make/release.mk.input

CC = gcc
LIBDIR = /usr/lib
ROOTLIBDIR = /lib

ifneq (,$(findstring $(DEB_HOST_ARCH), s390 sparc))
BUILD_BIARCH = yes
BIARCH_CC = "gcc -m64"
BIARCH_LIBDIR = /usr/lib64
BIARCH_ROOTLIBDIR = /lib64
endif

build/make/defines.mk:
	rm -rf build
	mkdir build
	cp -Rl make lib Makefile build
	cd build && \
	../configure \
		--kernel_src=/usr \
		--libdir=$(LIBDIR)

build-biarch/make/defines.mk:
	rm -rf build-biarch
	mkdir build-biarch
	cp -Rl make lib Makefile build-biarch
	cd build-biarch && \
	../configure \
		--kernel_src=/usr \
		--libdir=$(BIARCH_LIBDIR)

build: build-stamp

ifdef BUILD_BIARCH
build: build-biarch-stamp
endif

build-stamp: build/make/defines.mk
	dh_testdir

	CFLAGS=-I$(CURDIR)/debian/include $(MAKE) -C build CC=$(CC)

	touch $@

build-biarch-stamp: build-biarch/make/defines.mk
	dh_testdir

	CFLAGS=-I$(CURDIR)/debian/include $(MAKE) -C build-biarch CC=$(BIARCH_CC)

	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -rf build*

	dh_clean 

install:
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) -C build install DESTDIR=$(CURDIR)/debian/tmp
ifdef BUILD_BIARCH
	$(MAKE) -C build-biarch install DESTDIR=$(CURDIR)/debian/tmp
endif

	dh_installdirs -p libdlm-dev $(LIBDIR) $(BIARCH_LIBDIR)
	dh_install -p libdlm-dev --sourcedir=debian/tmp /usr/include
	dh_install -p libdlm-dev debian/tmp/$(LIBDIR)/*.a $(LIBDIR)
ifdef BUILD_BIARCH
	dh_install -p libdlm-dev debian/tmp/$(BIARCH_LIBDIR)/*.a $(BIARCH_LIBDIR)
endif
ifneq ($(RELEASE_MAJOR),DEVEL)
	dh_install -p libdlm$(RELEASE_MAJOR) debian/tmp/$(LIBDIR)/libdlm.so.* $(ROOTLIBDIR)
	ln -sf ../..$(ROOTLIBDIR)/libdlm.so.$(RELEASE_MAJOR) debian/libdlm-dev/$(LIBDIR)/libdlm.so
	dh_install -p libdlm$(RELEASE_MAJOR) debian/tmp/$(LIBDIR)/libdlm_lt.so.* $(ROOTLIBDIR)
	ln -sf ../..$(ROOTLIBDIR)/libdlm_lt.so.$(RELEASE_MAJOR) debian/libdlm-dev/$(LIBDIR)/libdlm_lt.so
ifdef BUILD_BIARCH
	dh_install -p libdlm$(RELEASE_MAJOR) debian/tmp/$(BIARCH_LIBDIR)/libdlm.so.* $(BIARCH_ROOTLIBDIR)
	ln -sf ../..$(BIARCH_ROOTLIBDIR)/libdlm.so.$(RELEASE_MAJOR) debian/libdlm-dev/$(BIARCH_LIBDIR)/libdlm.so
	dh_install -p libdlm$(RELEASE_MAJOR) debian/tmp/$(BIARCH_LIBDIR)/libdlm_lt.so.* $(BIARCH_ROOTLIBDIR)
	ln -sf ../..$(BIARCH_ROOTLIBDIR)/libdlm_lt.so.$(RELEASE_MAJOR) debian/libdlm-dev/$(BIARCH_LIBDIR)/libdlm_lt.so
endif
endif

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_link
	dh_strip
	dh_compress 
	dh_fixperms
	dh_makeshlibs -V
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install