File: rules

package info (click to toggle)
slang 1.4.4-7.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,560 kB
  • ctags: 4,909
  • sloc: ansic: 47,657; sh: 4,772; makefile: 629; pascal: 114
file content (160 lines) | stat: -rwxr-xr-x 5,137 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/usr/bin/make -f
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independant
# package.

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

CC = gcc
CFLAGS = -g -O2 -fno-strength-reduce -D_REENTRANT
ELF_CFLAGS = $(CFLAGS) -fPIC

# The original info is from src/slang.h
SOMAJOR=1
SOMINOR=4.4

LIBSLANG=slang1
LIBSLANG_UTF8=slang1a-utf8

build: 
	true;

build-nonutf8: Makefile
	dh_testdir

	$(MAKE) clean
	$(MAKE) CFLAGS="$(CFLAGS)" all demos
	# We specify ELF_DEP_LIBS to get a libc dependency; upstream only has -lm.
	$(MAKE) ELF_CFLAGS="$(ELF_CFLAGS)" UTF8MODIFIER="" ELF_DEP_LIBS='-lm -lc -ldl' prefix=/ elf
	touch build-nonutf8

build-utf8: Makefile
	dh_testdir

	$(MAKE) clean
	$(MAKE) CFLAGS="$(CFLAGS) -DUTF8" all demos
	# We specify ELF_DEP_LIBS to get a libc dependency; upstream only has -lm.
	$(MAKE) UTF8MODIFIER="-UTF8" ELF_CFLAGS="$(ELF_CFLAGS) -DUTF8" ELF_DEP_LIBS='-lm -lc -ldl' prefix=/ elf
	touch build-utf8

Makefile:
	dh_testdir
	env CC="$(CC)" INSTALL="/usr/bin/install -p" \
		./configure --prefix=/usr --enable-warnings

clean:
	dh_testdir
	dh_testroot
	rm -f build-nonutf8 build-utf8

	# Add here commands to clean up after the build process.
	-$(MAKE) distclean
	rm -f demo/config.log demo/config.status demo/config.h
	rm -f modules/Makefile slsc/Makefile slsh/Makefile
	-test -r /usr/share/misc/config.sub && \
	cp -f /usr/share/misc/config.sub autoconf/config.sub
	-test -r /usr/share/misc/config.guess && \
	cp -f /usr/share/misc/config.guess autoconf/config.guess

	dh_clean -a

# Build architecture-independent files here.
binary-indep:
	true

# Build the non-utf8 version
binary-nonutf8: build-nonutf8
	dh_testdir -a
	dh_testroot -a
	dh_clean -p${LIBSLANG} -k
	dh_clean -pslang1-dev -k
	dh_clean -pslang1-pic -k
	dh_installdirs -a

	make prefix=`pwd`/debian/slang1-dev/usr \
	     UTF8MODIFIER="" ELF_DEP_LIBS='-lm -lc -ldl' install install-elf
	(sed 's/@DEBIANUTF8ERRORCHECK@/#ifdef/' < debian/slang.h.extra.in; cat src/slang.h ) > `pwd`/debian/slang1-dev/usr/include/slang.h
	chmod 644 `pwd`/debian/slang1-dev/usr/include/slang.h

	mv debian/slang1-dev/usr/lib/libslang.so.* debian/${LIBSLANG}/lib

	# The ldconfig symlink to make the library work ASAP.
	cd debian/${LIBSLANG}/lib ; ln -sf libslang.so.$(SOMAJOR).$(SOMINOR) libslang.so.$(SOMAJOR)

	# Correct the .so link for slang1-dev library -- required?
	cd debian/slang1-dev/usr/lib ; ln -sf /lib/libslang.so.$(SOMAJOR).$(SOMINOR) libslang.so

	# Produce the -pic archive for use by the bootfloppies package.
	ar cqv debian/slang1-pic/usr/lib/libslang$(SOMAJOR).$(SOMINOR)_pic.a src/elfobjs/*.o 

# Build the utf8 version
binary-utf8: build-utf8
	dh_testdir -a
	dh_testroot -a
	dh_clean -p${LIBSLANG_UTF8} -k
	dh_clean -pslang1-utf8-dev -k
	dh_clean -pslang1-utf8-pic -k
	dh_installdirs -a

	make prefix=`pwd`/debian/slang1-utf8-dev/usr \
	     UTF8MODIFIER="-UTF8"  ELF_DEP_LIBS='-lm -lc -ldl -DUTF8' install install-elf
	(sed 's/@DEBIANUTF8ERRORCHECK@/#ifndef/' < debian/slang.h.extra.in; cat src/slang.h ) > `pwd`/debian/slang1-utf8-dev/usr/include/slang.h
	chmod 644 `pwd`/debian/slang1-utf8-dev/usr/include/slang.h

	mv debian/slang1-utf8-dev/usr/lib/libslang.so.* debian/slang1a-utf8/lib/libslang.so.$(SOMAJOR)-UTF8.$(SOMINOR)

	# The ldconfig symlink to make the library work ASAP.  This is not really required.
	cd debian/slang1a-utf8/lib ; ln -sf libslang.so.$(SOMAJOR)-UTF8.$(SOMINOR) libslang.so.$(SOMAJOR)-UTF8

	# Correct the .so link for slang1-utf8-dev library
	cd debian/slang1-utf8-dev/usr/lib ; ln -sf /lib/libslang.so.$(SOMAJOR)-UTF8.$(SOMINOR) libslang.so

	# Produce the -pic archive for use by the bootfloppies package.
	ar cqv debian/slang1-utf8-pic/usr/lib/libslang$(SOMAJOR).$(SOMINOR)_pic.a src/elfobjs/*.o 


binary-arch: binary-nonutf8 binary-utf8
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a
	dh_installexamples -a

	cd debian/slang1-dev/usr/share/doc/slang1-dev/examples/ ; \
		mv demo/* . ; \
		rm -f objs/* ; \
		rmdir objs demo ; \
		rm -f *.o* Makefile Makefile.in ; \
		mv Makefile.simple Makefile ; \
		rm -f config.status config.log configure configure.in

	dh_installmenu -a
	dh_installcron -a
	dh_installmanpages -a
	dh_installchangelogs -a changes.txt
	dh_strip -a
	dh_compress -a

	gunzip debian/slang1-dev/usr/share/doc/slang1-dev/examples/*.gz
	cp -r debian/slang1-dev/usr/share/doc/slang1-dev/examples \
		debian/slang1-utf8-dev/usr/share/doc/slang1-dev

	dh_fixperms -a
	dh_suidregister -a
	dh_makeshlibs -p$(LIBSLANG) -V "${LIBSLANG} (>> 1.4.4-7.1)"
	dh_makeshlibs -p$(LIBSLANG_UTF8) -V "${LIBSLANG_UTF8} (>> 1.4.4-7.1)"
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol 

	dh_md5sums -a
	dh_builddeb -a

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: clean binary binary-nonutf8 binary-utf8 binary-indep binary-arch binary