File: rules

package info (click to toggle)
tclsoldout 0.1.1-4
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 368 kB
  • sloc: ansic: 2,525; makefile: 85; tcl: 70
file content (57 lines) | stat: -rwxr-xr-x 1,423 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
#!/usr/bin/make -f
#export DH_VERBOSE = 1

# query for the architecture triplet we build for
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
# 
# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
export DEB_CFLAGS_MAINT_APPEND  = -Wall -Wextra -pedantic -fPIC
# package maintainers to append LDFLAGS
export DEB_LDFLAGS_MAINT_APPEND = -shared -lsoldout

CC ?= gcc
MAKE ?= make

SRC = tclsoldout.c
OBJ = ${SRC:.c=.o}

%:
	dh $@

override_dh_gencontrol:
	tcltk-depends
	dh_gencontrol

override_dh_auto_clean:
	$(MAKE) clean
	rm -rf run-tests tclsoldout.3tcl

.c.o:
	. /usr/lib/tclConfig.sh; \
	${CC} ${CFLAGS} -I/usr/include/tcl$${TCL_VERSION} -c ${SRC} -o ${OBJ}

libtclsoldout.so: ${OBJ}
	. /usr/lib/tclConfig.sh; \
	${CC} ${LDFLAGS} -ltcl$${TCL_VERSION} ${OBJ} -o libtclsoldout.so -lsoldout

override_dh_auto_build: libtclsoldout.so
	echo "mangling names in tclsoldout.n"; \
	sed -e 's/TCLSOLDOUT n/tclsoldout 3tcl/g' tclsoldout.n > tclsoldout.3tcl

override_dh_auto_install:

override_dh_auto_test:
	@cp -a tests run-tests; \
	cd ./run-tests; \
	for f in *.test ; do \
		echo "mangling the shebang line in $$f" ; \
		sed -i -e 's|/usr/bin/env.*|/usr/bin/tclsh|' $$f; \
	done; \
	pwd; \
	sed -i -e 's|/usr/bin/env.*|/usr/bin/tclsh|' all.tcl ; \
	chmod 755 all.tcl ;\
	${MAKE}