summaryrefslogtreecommitdiff
path: root/Makefile
blob: 1879fd160533a38aa40d8fab02c94d4e3114282c (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
PREFIX ?= /usr/local

main_dir = ${DESTDIR}${PREFIX}
bin_dir = ${main_dir}/bin
man_dir = ${main_dir}/share/man

all: build/comirror.1 build/comirror-setup.1

build/%.1: bin/%
	@echo POD $<
	@mkdir -p build
	@pod2man $< > $@

install: all
	@echo Installing executables to ${bin_dir}
	@echo Installing manuals to ${man_dir}
	@mkdir -p ${bin_dir} ${man_dir}/man1
	@cp bin/comirror       ${bin_dir}/comirror
	@cp bin/comirror-setup ${bin_dir}/comirror-setup
	@cp build/comirror.1       ${man_dir}/man1/comirror.1
	@cp build/comirror-setup.1 ${man_dir}/man1/comirror-setup.1
	@chmod 755 ${bin_dir}/comirror ${bin_dir}/comirror-setup
	@chmod 644 ${man_dir}/man1/comirror.1 ${man_dir}/man1/comirror-setup.1

test:
	@prove test

uninstall:
	rm -f ${bin_dir}/comirror ${bin_dir}/comirror-setup
	rm -f ${man_dir}/man1/comirror.1 ${man_dir}/man1/comirror-setup.1

clean:
	rm -rf build

.PHONY: all clean install test uninstall