File: rules

package info (click to toggle)
libcgic 1.07-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 272 kB
  • ctags: 206
  • sloc: ansic: 1,230; makefile: 74
file content (90 lines) | stat: -rwxr-xr-x 2,170 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
#!/usr/bin/make -f
# Copyright (c) 2001 Colin Watson, from an earlier version by Brian Bassett.

export DH_COMPAT=3

libtmp = debian/libcgicg1
devtmp = debian/libcgicg1-dev

version := $(shell dpkg-parsechangelog | grep '^Version:' | \
		   sed -e 's/^Version: //' -e 's/-.*//')
version_major := $(shell echo $(version) | sed 's/\..*//')

CFLAGS := -g -Wall

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS := $(CFLAGS) -DCGICDEBUG
endif

ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS := -O2 $(CFLAGS)
endif

build: build-stamp
build-stamp:
	dh_testdir

	mkdir shared static
	#
	# First build the shared library
	#
	gcc $(CFLAGS) -D_REENTRANT -fPIC -pipe -c cgic.c -o shared/cgic.o
	cd shared; \
	    gcc -shared -Wl,-soname,libcgic.so.$(version_major) \
	    	-o libcgic.so.$(version) *.o -lc
	#
	# Build the static library
	#
	gcc $(CFLAGS) -D_REENTRANT -pipe -c cgic.c -o static/cgic.o
	cd static; ar rv libcgic.a *.o
	#
	# Build capture
	#
	#ln -s libcgic.so.$(version) shared/libcgic.so
	#gcc $(CFLAGS) -pipe -Lshared -lcgic capture.c -o capture
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	-rm -rf static shared
	-rm -f build-stamp
	-$(MAKE) clean
	dh_clean

binary-indep: build
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs 

	install -m644 static/libcgic.a	$(devtmp)/usr/lib/
	install -m644 cgic.h		$(devtmp)/usr/include/
	install -m644 shared/libcgic.so.$(version)	$(libtmp)/usr/lib/
	ln -s libcgic.so.$(version)	$(devtmp)/usr/lib/libcgic.so
	ln -s libcgic.so.$(version) \
	      $(libtmp)/usr/lib/libcgic.so.$(version_major)

	dh_installdocs
	dh_installexamples
	install -m644 debian/Makefile.examples \
		$(devtmp)/usr/share/doc/libcgicg1-dev/examples/Makefile
	dh_installchangelogs debian/changelog-upstream.html
	dh_link
	dh_strip
	dh_compress -X examples
	dh_fixperms
	dh_installdeb
	dh_shlibdeps -ldebian/libcgicg1/usr/lib
	dh_gencontrol
	dh_makeshlibs
	dh_md5sums
	dh_builddeb

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