File: rules

package info (click to toggle)
freetds 0.82-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 10,716 kB
  • ctags: 8,697
  • sloc: ansic: 74,312; sh: 8,868; makefile: 815; perl: 556; php: 22
file content (121 lines) | stat: -rwxr-xr-x 3,007 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
119
120
121
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

#export DH_VERBOSE=1

CFLAGS = -g -Wall
INSTALL = install

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  CFLAGS += -O0
else
  CFLAGS += -O2
endif

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  INSTALL += -s
endif

# Authoritative build/host types for the Debian archen.
DEB_HOST_GNU_TYPE	:= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE	:= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  confflags += --build $(DEB_HOST_GNU_TYPE)
else
  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

# The autotools target adds a forced build-time dependency on
# autotools-dev (for /usr/share/misc/config.*)
autotools:
	OLDDATESUB=`./config.sub -t | tr -d - `;\
	NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d - `;\
	if [ "$$OLDDATESUB" -lt "$$NEWDATESUB" ]; then \
	   if [ ! -e config.sub.bak ]; then\
	      cp -f config.sub config.sub.bak;\
	   fi;\
	   if [ -e config.sub.bak ]; then\
	      cp -f /usr/share/misc/config.sub config.sub;\
	   fi;\
	fi

configure-stamp:
	dh_testdir
	CPPFLAGS=-D_REENTRANT \
	CFLAGS="${CFLAGS}" \
	./configure $(confflags) \
		--with-gnu-ld --with-tdsver=4.2 --prefix=/usr \
		--with-unixodbc=/usr --sysconfdir=/etc/freetds \
		--enable-sybase-compat
	touch configure-stamp

build: autotools build-stamp
build-stamp: configure-stamp
	dh_testdir
	$(MAKE)
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	-rm -f build-stamp configure-stamp
	[ ! -f Makefile ] || $(MAKE) distclean

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k

	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
	mkdir -p $(CURDIR)/debian/tmp/usr/share/freetds
	mv $(CURDIR)/debian/tmp/etc/freetds/freetds.conf \
	   $(CURDIR)/debian/tmp/usr/share/freetds/
	mkdir -p $(CURDIR)/debian/tmp/usr/lib/odbc
	mv $(CURDIR)/debian/tmp/usr/lib/libtdsodbc.so.0.0.0 \
	   $(CURDIR)/debian/tmp/usr/lib/odbc/libtdsodbc.so
	rm -f $(CURDIR)/debian/tmp/usr/lib/libtdsodbc*
	mkdir -p $(CURDIR)/debian/tmp/usr/share/tdsodbc
	install -m644 debian/odbcinst.ini $(CURDIR)/debian/tmp/usr/share/tdsodbc/
	dh_movefiles

binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdirs -i
	dh_installdocs -i NEWS README TODO
	dh_installexamples -i
	dh_installchangelogs -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdirs -a
	dh_installdocs -a
	dh_installexamples -a
	dh_installchangelogs -a ChangeLog
	dh_installman -a
	dh_installdebconf -a
	dh_strip -a
	dh_link -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a -Xtdsodbc -V
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch

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