summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 755fc58a65fd6b5ff68a4fe918ad245e427ed237 (plain)
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
#!/usr/bin/make -f

export CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
export CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) -Wl,--version-script=$(CURDIR)/debian/version-script

export ACLOCAL := aclocal -I m4

%:
	dh $@

override_dh_auto_configure:
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	cp -f /usr/share/misc/config.guess config.guess
endif
	dh_auto_configure -- SHELL=/bin/sh

override_dh_auto_build:
	# gosh src/libguess/guess.scm src/libguess/guess_tab.c
	dh_auto_build
	ln -s $(CURDIR)/src/libguess/libguess.so src/libguess/libguess.so.1

override_dh_compress:
	dh_compress -Xguessconv.c

override_dh_auto_clean:
	[ ! -f buildsys.mk ] || dh_auto_clean

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(CURDIR)/src/libguess make -C src/tests/testbench --no-print-directory generate
	LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(CURDIR)/src/libguess make -C src/tests/testbench --no-print-directory run
endif

get-orig-source:
	@d=$$(readlink -e $(MAKEFILE_LIST)); \
	cd $${d%/*}/..; \
	debian/get-orig-source.sh $(CURDIR)

.PHONY: override_dh_auto_clean override_dh_auto_configure override_dh_auto_build override_dh_compress override_dh_auto_test get-orig-source