File: Makefile

package info (click to toggle)
clawsker 1.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 948 kB
  • sloc: perl: 2,715; makefile: 131; sh: 9
file content (107 lines) | stat: -rw-r--r-- 3,011 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#
# Clawsker Makefile
# Copyright 2007-2021 Ricardo Mones <ricardo@mones.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# See COPYING file for license details.
#

NAME = clawsker
VERSION ?= 1.3.4
PREFIX ?= /usr/local
BINDIR = ${PREFIX}/bin
DATADIR = ${PREFIX}/share
LIBDIR = ${PREFIX}/lib/${NAME}
MANDIR = ${DATADIR}/man
MAN1DIR = ${MANDIR}/man1
APPSDIR = ${DATADIR}/applications
THEMEDIR = ${DATADIR}/icons/hicolor
ICONRES = 48 64 128

all: build

build: ${NAME}.1
	-mkdir build
	perl -MConfig -p -e'1..1 and s/.*/$$Config{startperl}/;' \
		-e's,\@PREFIX\@,${PREFIX},;' \
		-e's,\@LIBDIR\@,${LIBDIR},;' \
		-e's,\@VERSION\@,${VERSION},;' \
		-e's,\@DATADIR\@,${DATADIR},' ${NAME} > build/${NAME}
	cp -p $< build/$<
	${MAKE} -C po build

${NAME}.1: ${NAME}.pod
	pod2man --release ${VERSION} -c '' $< > $@

install: all install-dirs install-icons
	install -m 0755 build/${NAME} ${DESTDIR}${BINDIR}
	install -m 0644 build/${NAME}.1 ${DESTDIR}${MAN1DIR}
	install -m 0644 ${NAME}.desktop ${DESTDIR}${APPSDIR}
	${MAKE} -C po install

install-dirs: install-icons-dirs
	install -d ${DESTDIR}${BINDIR}
	install -d ${DESTDIR}${MAN1DIR}
	install -d ${DESTDIR}${APPSDIR}
	${MAKE} -C po install-dirs

install-icons-dirs:
	install -d ${DESTDIR}${THEMEDIR}
	for res in ${ICONRES}; do \
		install -d ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps; \
	done

install-icons: install-icons-dirs
	for res in ${ICONRES}; do \
		install -m 0644 icons/${NAME}-$${res}.png ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps/${NAME}.png; \
	done

uninstall-icons:
	for res in ${ICONRES}; do \
		rm -f ${DESTDIR}${THEMEDIR}/$${res}x$${res}/apps/${NAME}.png; \
	done

uninstall: uninstall-icons
	rm -f ${DESTDIR}${BINDIR}/${NAME}
	rm -f ${DESTDIR}${MAN1DIR}/${NAME}.1
	rm -f ${DESTDIR}${APPSDIR}/${NAME}.desktop
	${MAKE} -C po uninstall

dist:
	rm -rf ${NAME}-${VERSION}
	mkdir ${NAME}-${VERSION}
	cp -p AUTHORS ChangeLog.old ${NAME} ${NAME}.pod ${NAME}.desktop \
		COPYING Makefile NEWS README ${NAME}-${VERSION}
	mkdir ${NAME}-${VERSION}/po
	cp -p po/*.po po/*.pot po/Makefile po/POTFILES po/README po/STATUS \
		${NAME}-${VERSION}/po
	mkdir ${NAME}-${VERSION}/po/unmaint
	cp -p po/unmaint/*.po ${NAME}-${VERSION}/po/unmaint
	mkdir ${NAME}-${VERSION}/icons
	cp -p icons/*.xcf icons/*.png ${NAME}-${VERSION}/icons
	mkdir ${NAME}-${VERSION}/t
	cp -p t/*.t ${NAME}-${VERSION}/t
	tar cJf ${NAME}-${VERSION}.tar.xz ${NAME}-${VERSION} \
		&& rm -rf ${NAME}-${VERSION}

clean-build:
	rm -f ${NAME}.1
	rm -rf build

clean: clean-build
	rm -f *~
	${MAKE} -C po clean

test-setup:
	@test -h t/Clawsker.pm || ( cd t/ && ln -s ../clawsker Clawsker.pm )

test: test-setup
	@env DISPLAY= prove -It

.PHONY: all build install install-dirs install-icons-dirs install-icons
.PHONY: uninstall uninstall-icons clean clean-build dist
.PHONY: test-setup test