Debian Codegraph @

Makefile

raw
1 #
2 # Copyright (C) 2011-2021 Canonical
3 # Copyright (C) 2021-2025 Colin Ian King
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 #
19 # Author: Colin Ian King <[email protected]>
20 #
21
22 VERSION=0.03.00
23
24 CFLAGS += -Wall -Wextra -DVERSION='"$(VERSION)"' -O2 -g
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 # Some useful optimisation settings for GCC
37 #
38 # -Winline \
39 # -fwhole-program -freciprocal-math -ffast-math \
40 # --param max-reload-search-insns=32768 \
41 # --param max-cselib-memory-locations=32768
42 #
43 BINDIR=/usr/sbin
44 MANDIR=/usr/share/man/man8
45 BASHDIR=/usr/share/bash-completion/completions
46
47 cpustat: cpustat.o Makefile
48 $(CC) $(CPPFLAGS) $(CFLAGS) $< -lm -lncurses -o $@ $(LDFLAGS)
49
50 cpustat.o: cpustat.c Makefile
51
52 cpustat.8.gz: cpustat.8
53 gzip -c $< > $@
54
55 dist:
56 rm -rf cpustat-$(VERSION)
57 mkdir cpustat-$(VERSION)
58 cp -rp README.md Makefile cpustat.c cpustat.8 COPYING mascot \
59 .travis.yml snap bash-completion cpustat-$(VERSION)
60 tar -Jcf cpustat-$(VERSION).tar.xz cpustat-$(VERSION)
61 rm -rf cpustat-$(VERSION)
62
63 clean:
64 rm -f cpustat cpustat.o cpustat.8.gz
65 rm -f cpustat-$(VERSION).tar.xz
66
67
68 install: cpustat cpustat.8.gz
69 mkdir -p ${DESTDIR}${BINDIR}
70 cp cpustat ${DESTDIR}${BINDIR}
71 mkdir -p ${DESTDIR}${MANDIR}
72 cp cpustat.8.gz ${DESTDIR}${MANDIR}
73 mkdir -p ${DESTDIR}${BASHDIR}
74 cp bash-completion/cpustat ${DESTDIR}${BASHDIR}