File: Makefile

package info (click to toggle)
deheader 1.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 480 kB
  • sloc: python: 1,206; ansic: 334; makefile: 75; sh: 15
file content (87 lines) | stat: -rw-r--r-- 2,106 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
#
# makefile for `deheader'
#
# SPDX-FileCopyrightText: (C) Eric S. Raymond <esr@thyrsus.com>
# SPDX-License-Identifier: BSD-2-Clause

PREFIX      ?= /usr/local
BINDIR      ?= $(PREFIX)/bin
DATADIR     ?= $(PREFIX)/share
MANDIR      ?= $(DATADIR)/man

VERSION=$(shell sed <deheader -n -e '/version\s*=\s*"\(.*\)"/s//\1/p')

# Rules

# Note: to suppress the footers with timestamps being generated in HTML,
# we use "-a nofooter".
# To debug asciidoc problems, you may need to run "xmllint --nonet --noout --valid"
# on the intermediate XML that throws an error.
.SUFFIXES: .html .adoc .1

.adoc.1:
	asciidoctor -D. -a nofooter -b manpage $<
.adoc.html:
	asciidoctor -D. -a nofooter -a webfonts! $<

.PHONY: all clean check buildchecks pylint spellcheck
.PHONY: install uninstall version dist release refresh

# Build

all: deheader.1

clean:
	rm -f *~ *.1 *.html tests/*.o tests/*~

# Validate

check:
	cd tests; make --quiet check
buildchecks:
	cd tests; make --quiet checkfile

pylint:
	@pylint --score=n deheader

spellcheck:
	@spellcheck deheader.adoc

# Install/uninstall

install:
	install -d $(DESTDIR)$(BINDIR)
	install -m 755 deheader $(DESTDIR)$(BINDIR)/deheader
	install deheader.1 $(DESTDIR)$(MANDIR)/man1/deheader.1

uninstall:
	rm -f $(DESTDIR)$(BINDIR)/deheader
	rm -f $(DESTDIR)$(MANDIR)/man1/deheader.1

# Export

version:
	@echo $(VERSION)

SOURCES = README.adoc COPYING NEWS.adoc deheader deheader.adoc Makefile control deheader-logo.png tests

deheader-$(VERSION).tar.gz: $(SOURCES)
	mkdir deheader-$(VERSION)
	cp -r $(SOURCES) deheader-$(VERSION)
	tar -czf deheader-$(VERSION).tar.gz deheader-$(VERSION)
	rm -fr deheader-$(VERSION)
	ls -l deheader-$(VERSION).tar.gz

dist: deheader-$(VERSION).tar.gz

NEWSVERSION=$(shell sed -n <NEWS.adoc '/^[0-9]/s/:.*//p' | head -1)

release: deheader-$(VERSION).tar.gz deheader.html
	@[ $(VERSION) = $(NEWSVERSION) ] || { echo "Version mismatch!"; exit 1; }
	shipper version=$(VERSION) | sh -e -x

refresh: deheader.html
	@[ $(VERSION) = $(NEWSVERSION) ] || { echo "Version mismatch!"; exit 1; }
	shipper -N -w version=$(VERSION) | sh -e -x

# end