summaryrefslogtreecommitdiff
path: root/Makefile
blob: 05a3d8333694fe8520ab396cf3270d38e80e9ae4 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
include config.mk

all: build-src build-man

build-src:
	@${MAKE} -C src

build-man:
	@${MAKE} -C man

test: all
	@PACKAGE=${PACKAGE} VERSION=${VERSION} prove test

test-x11: all
	@test/run-interactive

install: install-man install-doc install-bin install-font install-img

install-man:
	@echo installing manuals to ${man_dir}
	@mkdir -p ${man_dir}/man1
	@cp man/*.1 ${man_dir}/man1
	@chmod 644 ${man_dir}/man1/feh.1 ${man_dir}/man1/feh-cam.1 \
		${man_dir}/man1/gen-cam-menu.1

install-doc:
	@echo installing docs to ${doc_dir}
	@mkdir -p ${doc_dir}
	@cp AUTHORS ChangeLog README TODO ${doc_dir}
	@chmod 644 ${doc_dir}/*

install-bin:
	@echo installing executables to ${bin_dir}
	@mkdir -p ${bin_dir}
	@cp src/feh cam/feh-cam cam/gen-cam-menu ${bin_dir}
	@chmod 755 ${bin_dir}/feh ${bin_dir}/feh-cam \
		${bin_dir}/gen-cam-menu

install-font:
	@echo installing fonts to ${font_dir}
	@mkdir -p ${font_dir}
	@cp data/fonts/* ${font_dir}
	@chmod 644 ${font_dir}/*

install-img:
	@echo installing images to ${image_dir}
	@mkdir -p ${image_dir}
	@cp data/images/* ${image_dir}
	@chmod 644 ${image_dir}/*


uninstall:
	rm -f ${man_dir}/man1/feh.1 ${man_dir}/man1/feh-cam.1
	rm -f ${man_dir}/man1/gen-cam-menu.1
	rm -rf ${doc_dir}
	rm -f ${bin_dir}/feh ${bin_dir}/feh-cam ${bin_dir}/gen-cam-menu
	rm -rf ${font_dir}
	rm -rf ${image_dir}

clean:
	@${MAKE} -C src clean
	@${MAKE} -C man clean

.PHONY: all test test-x11 install uninstall clean install-man install-doc \
	install-bin install-font install-img