File: rules

package info (click to toggle)
unixodbc 2.2.11-16
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 17,332 kB
  • ctags: 12,399
  • sloc: ansic: 116,624; cpp: 29,333; sh: 25,024; makefile: 3,002; lex: 241; yacc: 182; perl: 142; sed: 16; sql: 1
file content (122 lines) | stat: -rwxr-xr-x 3,630 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
122
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

# This is the debhelper compatability version to use.
export DH_COMPAT=3

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

configure: autotools configure-stamp
configure-stamp:
	dh_testdir
	-chmod 755 configure
	# Add here commands to configure the package.
	CXXFLAGS="-g -O2 -pipe" \
	./configure $(confflags) --prefix=/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		--with-qt-includes=/usr/include/qt3 --sysconfdir=/etc \
		--enable-static --disable-rpath --disable-dependency-tracking \
		--enable-ltdllib
	touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
	dh_testdir
	# Add here commands to compile the package.
	$(MAKE)
	touch build-stamp

clean:
	dh_testdir
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	-$(MAKE) distclean
	# this symlink seems not to be cleaned properly.
	rm -f config.status
	rm -f ODBCConfig/mclass*.cpp
	rm -f DataManager/mclass*.cpp
	-if [ -e config.sub.bak ]; then \
	   cp -pf config.sub.bak config.sub && rm -f config.sub.bak; \
	fi

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) install DESTDIR=`pwd`/debian/tmp
	mkdir `pwd`/debian/tmp/usr/lib/odbc
	cp -L `pwd`/debian/tmp/usr/lib/lib*S.so `pwd`/debian/tmp/usr/lib/odbc
	cp -L `pwd`/debian/tmp/usr/lib/libnn.so `pwd`/debian/tmp/usr/lib/odbc
	-cp -L `pwd`/debian/tmp/usr/lib/libodbctxt.so `pwd`/debian/tmp/usr/lib/odbc
	rm `pwd`/debian/tmp/usr/lib/lib*S.so*
	rm `pwd`/debian/tmp/usr/lib/lib*S.la*
	rm `pwd`/debian/tmp/usr/lib/lib*S.a*
	rm `pwd`/debian/tmp/usr/lib/libodbcpsql.*
	rm `pwd`/debian/tmp/usr/lib/libnn.*
	rm `pwd`/debian/tmp/usr/lib/libtemplate.*
	-rm `pwd`/debian/tmp/usr/lib/libodbctxt.*

# 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	

# 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_movefiles -a
	-mv `pwd`/debian/tmp/usr/lib/odbc/libodbctxt.so `pwd`/debian/unixodbc/usr/lib/odbc/
	dh_installdocs
	cp Drivers/MySQL/README debian/unixodbc/usr/share/doc/unixodbc/README.MySql
	for pkg in odbcinst1debian1 unixodbc; do \
		install -m 0644 -D debian/$$pkg.lintian debian/$$pkg/usr/share/lintian/overrides/$$pkg; \
	done
	dh_installexamples
	dh_installmenu
	dh_installman
	dh_installinfo
	dh_installchangelogs ChangeLog
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	perl ./debian/dh_makeshlibs -X lib/odbc/lib -a
	dh_installdeb
	dh_perl
	dh_shlibdeps -a -l`pwd`/debian/unixodbc/usr/lib -l`pwd`/debian/odbcinst1debian1/usr/lib
	dh_gencontrol -a
	dh_md5sums
	dh_builddeb -a

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