File: rules

package info (click to toggle)
suckless-tools 40-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 700 kB
  • sloc: ansic: 2,512; makefile: 465; sh: 104
file content (58 lines) | stat: -rwxr-xr-x 1,260 bytes parent folder | download | duplicates (3)
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
58
#!/usr/bin/make -f

SHELL := sh -e

D := $(CURDIR)/debian/suckless-tools
TOOLS := $(filter-out debian, $(wildcard *))
ALTERNATIVES := $(wildcard debian/local/*)
RULE_FILE_DIR := $(dir $(firstword $(MAKEFILE_LIST)))

%:
	dh $@

override_dh_auto_configure:
	for ALTERNATIVE in $(ALTERNATIVES); \
	do \
		tool=`basename $${ALTERNATIVE} | perl -pe "s/.*\K\..*//g"`;\
		extn=`basename $${ALTERNATIVE} | perl -pe "s/.*\.//g"`; \
		newfork=$${tool}.$${extn}; \
		cp -r $${tool} $${newfork}; \
		patch -p1 < $${ALTERNATIVE} -d $${newfork}; \
		TOOLS="$(TOOLS) $${newfork}"; \
	done
	dh_auto_configure

override_dh_auto_clean:
	dh_auto_clean
	for TOOL in $(TOOLS); \
	do \
		make -C $${TOOL} clean; \
	done
	@diff -q tabbed/config.h tabbed/config.def.h && rm -f tabbed/config.h || true

override_dh_auto_build:
	for TOOL in $(TOOLS);\
	do \
		make -C $${TOOL}; \
	done

override_dh_auto_install:
	for TOOL in $(TOOLS); \
	do \
		$(MAKE) -C $${TOOL} DESTDIR=$(D) PREFIX=/usr install; \
	done

override_dh_installdocs:
	dh_installdocs
	for TOOL in $(TOOLS); \
	do \
		cp $${TOOL}/README $(D)/usr/share/doc/suckless-tools/README.$${TOOL}; \
	done

override_dh_fixperms:
	dh_fixperms -Xusr/bin/slock

get-orig-source:
	$(RULE_FILE_DIR)create_orig_source $(RULE_FILE_DIR)