summaryrefslogtreecommitdiff
path: root/Makefile
blob: 6a56982a51666265ebc77e2eac29ab1fd35bcda3 (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
prefix = /usr/local
bindir = $(prefix)/bin
sharedir = $(prefix)/share
mandir = $(sharedir)/man
man1dir = $(mandir)/man1

progs = corrupt isascii
scripts = \
    argv0 \
    assert \
    benchmark-cmd \
    build-deb-from-git \
    do-until \
    filecount \
    fix-shebang \
    humanify \
    jwt-decode \
    keepalive \
    lorem \
    make-maildir-seen \
    mbox2maildir \
    minimify \
    musictomp3 \
    os-rchelper \
    prettyml \
    prettyson \
    print-argv \
    progress-du \
    project.meta \
    runql \
    setuppy-debian-versions-match \
    splitmboxdaily \
    ssl-cert-gen \
    test-flacs \
    totp \
    unpack-debian-sources \
    viewprof \
    whatismyip \
    with

manpagesin = $(shell ls *.1.in)

CFLAGS = -Wall -O2 --std=gnu99

all: $(progs) manpages

manpages: $(manpagesin)
	for x in $(manpagesin); do cmd=$$(basename $$x .1.in); \
		./$$cmd --generate-manpage=$$x > $$cmd.1; done

install: all
	install -d $(DESTDIR)$(bindir)
	install $(progs) $(scripts) $(DESTDIR)$(bindir)
	install -d $(DESTDIR)$(man1dir)
	install -m 0644 *.1 $(DESTDIR)$(man1dir)

clean:
	rm -f $(progs) *.o
	for x in $(manpagesin); do rm -f $$(basename $$x .in); done