File: rules

package info (click to toggle)
uthash 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,788 kB
  • sloc: ansic: 9,838; makefile: 178; perl: 88; sh: 37; cpp: 30
file content (55 lines) | stat: -rwxr-xr-x 1,506 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
#!/usr/bin/make -f
# -*- makefile -*-

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

# Use a temporary build directory.
# We cannot build the documentation in its source directory
# because upstream already includes a compiled version of the
# documentation. Running 'make' will overwrite the files, leaving
# the source directory dirty.
BUILD_DIR=debian/build-dir


%:
	dh $@

.PHONY: override_dh_auto_build
override_dh_auto_build:
	# Create symlink from libut to uthash
	ln -s ../ libut/uthash
	cp libut/Makefile.standalone libut/Makefile
	# Build 'libut.a' static library
	dh_auto_build --sourcedirectory libut
	# Build documentation (use a temp build directory)
	mkdir -p $(BUILD_DIR)/html
	cp --archive doc/* $(BUILD_DIR)/html/
	$(MAKE) -C $(BUILD_DIR)/html clean
	$(MAKE) -C $(BUILD_DIR)/html

.PHONY: override_dh_installdocs
override_dh_installdocs:
	# Don't install Changelog twice, keep lintian happy
	dh_installdocs --exclude=html/ChangeLog.txt

.PHONY: override_dh_auto_test
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# Run both testsuites
	$(MAKE) -C tests
	$(MAKE) -C libut tests
endif

.PHONY: override_dh_auto_clean
override_dh_auto_clean:
	# Clean 'libut' directory
	cp libut/Makefile.standalone libut/Makefile
	$(MAKE) -C libut clean
	# Clean uthash testsuite
	$(MAKE) -C tests clean
	# Remove temp build directory
	$(RM) -r $(BUILD_DIR)
	$(RM) -r libut/uthash libut/Makefile
	# Clean the rest of the files defined in 'd/clean'
	dh_auto_clean