File: rules

package info (click to toggle)
tclsoldout 0.1.1-5
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 396 kB
  • sloc: ansic: 2,525; makefile: 87; tcl: 78
file content (57 lines) | stat: -rwxr-xr-x 1,554 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_auto_clean:
	dh_auto_clean
	rm -f $(OBJ) libtclsoldout.so libtcl9tclsoldout.so
	rm -rf run-tests tclsoldout.3tcl

override_dh_gencontrol:
	tcltk-depends
	dh_gencontrol

override_dh_auto_build:
	echo "building for Tcl 8.6"; \
	$(CC) $(CFLAGS) -I/usr/include/tcl8.6 -c $(SRC) -o $(OBJ); \
	$(CC) -o libtclsoldout.so $(OBJ) -ltcl8.6 $(LDFLAGS) ; \
	rm -v tclsoldout.o; \
	echo "building for Tcl 9.0"; \
	$(CC) $(CFLAGS) -I/usr/include/tcl9.0 -c $(SRC) -o $(OBJ); \
	$(CC) -o libtcl9tclsoldout.so $(OBJ) -ltcl9.0 $(LDFLAGS) ; \
	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}