Debian Codegraph @

Makefile

raw
1 #
2 # Copyright (C) 2015-2026 Colin Ian King
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18 # Author: Colin Ian King <[email protected]>
19 #
20
21 VERSION=0.02.06
22
23 CFLAGS += -Wall -Wextra -DVERSION='"$(VERSION)"' -O2
24 LDFLAGS += -lncurses
25
26
27 # Pedantic flags
28 #
29 ifeq ($(PEDANTIC),1)
30 CFLAGS += -Wabi -Wcast-qual -Wfloat-equal -Wmissing-declarations \
31 -Wmissing-format-attribute -Wno-long-long -Wpacked \
32 -Wredundant-decls -Wshadow -Wno-missing-field-initializers \
33 -Wno-missing-braces -Wno-sign-compare -Wno-multichar
34 endif
35
36 BINDIR=/usr/sbin
37 MANDIR=/usr/share/man/man8
38 BASHDIR=/usr/share/bash-completion/completions
39
40 SRC = pagemon.c perf.c
41 OBJS = $(SRC:.c=.o)
42
43 pagemon: $(OBJS) Makefile
44 $(CC) $(CPPFLAGS) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS)
45
46 pagemon.o: pagemon.c perf.h Makefile
47 perf.o: perf.c perf.h Makefile
48
49 pagemon.8.gz: pagemon.8
50 gzip -c $< > $@
51
52 dist:
53 rm -rf pagemon-$(VERSION)
54 mkdir pagemon-$(VERSION)
55 cp -rp README Makefile pagemon.c pagemon.8 perf.c perf.h COPYING \
56 .travis.yml bash-completion README.md pagemon-$(VERSION)
57 tar -Jcf pagemon-$(VERSION).tar.xz pagemon-$(VERSION)
58 rm -rf pagemon-$(VERSION)
59
60 clean:
61 rm -f pagemon pagemon.o perf.o pagemon.8.gz pagemon-$(VERSION).tar.xz
62
63 install: pagemon pagemon.8.gz
64 mkdir -p ${DESTDIR}${BINDIR}
65 cp pagemon ${DESTDIR}${BINDIR}
66 mkdir -p ${DESTDIR}${MANDIR}
67 cp pagemon.8.gz ${DESTDIR}${MANDIR}
68 mkdir -p ${DESTDIR}${BASHDIR}
69 cp bash-completion/pagemon ${DESTDIR}${BASHDIR}