File: rules

package info (click to toggle)
bc 1.06.95-9
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 2,368 kB
  • sloc: ansic: 7,691; yacc: 1,097; sh: 800; lex: 349; makefile: 102
file content (36 lines) | stat: -rwxr-xr-x 938 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
#!/usr/bin/make -f

CFLAGS += -D_POSIX_SOURCE -DDOT_IS_LAST -DDONTEXIT

# The following files get overwritten by the build process. We back them up
# first.
BACKUP_FILES = doc/bc.info \
	       doc/dc.info
BACKED_UP_FILES = $(BACKUP_FILES:%=%.debian-backup)

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --prefix=/usr --with-readline

override_dh_auto_build: $(BACKED_UP_FILES)
	(cd doc && makeinfo --html --no-split --ifinfo bc.texi)
	(cd doc && makeinfo --html --no-split --ifinfo dc.texi)
	dh_auto_build

override_dh_auto_clean: restore
	dh_auto_clean

%.debian-backup:
	@# Back up automatically generated files so that we can restore them in
	@# the clean target, as required by Policy. We do this by copying the
	@# matching stem, foo, to foo.debian-backup.
	cp -f $* $@

restore:
	for file in $(BACKUP_FILES); do \
	    [ ! -f $${file}.debian-backup ] || mv $${file}.debian-backup $${file}; \
	done

.PHONY: restore