Makefile.am 4.43 KB
Newer Older
Hisham Muhammad's avatar
Hisham Muhammad committed
1

2
ACLOCAL_AMFLAGS = -I m4
3
AUTOMAKE_OPTIONS = subdir-objects
4

Hisham Muhammad's avatar
Hisham Muhammad committed
5
bin_PROGRAMS = htop
6

Hisham Muhammad's avatar
Hisham Muhammad committed
7
dist_man_MANS = htop.1
8
9
EXTRA_DIST = $(dist_man_MANS) htop.desktop htop.png scripts/MakeHeader.py \
install-sh autogen.sh missing
Hisham Muhammad's avatar
Hisham Muhammad committed
10
11
12
13
14
applicationsdir = $(datadir)/applications
applications_DATA = htop.desktop
pixmapdir = $(datadir)/pixmaps
pixmap_DATA = htop.png

David Hunt's avatar
David Hunt committed
15
htop_CFLAGS = -pedantic -Wall $(wextra_flag) -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)"
16
htop_LDFLAGS = 
17
AM_CPPFLAGS = -DNDEBUG
Hisham Muhammad's avatar
Hisham Muhammad committed
18

Hisham Muhammad's avatar
Hisham Muhammad committed
19
myhtopsources = AvailableMetersPanel.c CategoriesPanel.c CheckItem.c \
Hisham Muhammad's avatar
Hisham Muhammad committed
20
ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c CRT.c MainPanel.c \
Hisham Muhammad's avatar
Hisham Muhammad committed
21
22
DisplayOptionsPanel.c FunctionBar.c Hashtable.c Header.c htop.c ListItem.c \
LoadAverageMeter.c MemoryMeter.c Meter.c MetersPanel.c Object.c Panel.c \
Hisham Muhammad's avatar
Hisham Muhammad committed
23
BatteryMeter.c Process.c ProcessList.c RichString.c ScreenManager.c Settings.c \
David Hunt's avatar
David Hunt committed
24
25
SignalsPanel.c StringUtils.c SwapMeter.c TasksMeter.c UptimeMeter.c \
TraceScreen.c UsersTable.c Vector.c AvailableColumnsPanel.c AffinityPanel.c \
26
HostnameMeter.c OpenFilesScreen.c Affinity.c IncSet.c Action.c EnvScreen.c \
Hisham's avatar
Hisham committed
27
InfoScreen.c XAlloc.c
Hisham Muhammad's avatar
Hisham Muhammad committed
28
29
30

myhtopheaders = AvailableColumnsPanel.h AvailableMetersPanel.h \
CategoriesPanel.h CheckItem.h ClockMeter.h ColorsPanel.h ColumnsPanel.h \
Hisham Muhammad's avatar
Hisham Muhammad committed
31
CPUMeter.h CRT.h MainPanel.h DisplayOptionsPanel.h FunctionBar.h \
Hisham Muhammad's avatar
Hisham Muhammad committed
32
Hashtable.h Header.h htop.h ListItem.h LoadAverageMeter.h MemoryMeter.h \
Hisham Muhammad's avatar
Hisham Muhammad committed
33
BatteryMeter.h Meter.h MetersPanel.h Object.h Panel.h ProcessList.h RichString.h \
David Hunt's avatar
David Hunt committed
34
35
ScreenManager.h Settings.h SignalsPanel.h StringUtils.h SwapMeter.h \
TasksMeter.h UptimeMeter.h TraceScreen.h UsersTable.h Vector.h Process.h \
36
AffinityPanel.h HostnameMeter.h OpenFilesScreen.h Affinity.h IncSet.h Action.h \
Hisham's avatar
Hisham committed
37
EnvScreen.h InfoScreen.h XAlloc.h
38
39

if HTOP_LINUX
40
htop_CFLAGS += -rdynamic 
41
myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c linux/IOPriority.c \
42
linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c
43
44

myhtopplatheaders = linux/Platform.h linux/IOPriorityPanel.h linux/IOPriority.h \
45
linux/LinuxProcess.h linux/LinuxProcessList.h linux/LinuxCRT.h linux/Battery.h
46
47
endif

Hisham Muhammad's avatar
Hisham Muhammad committed
48
49
if HTOP_FREEBSD
myhtopplatsources = freebsd/Platform.c freebsd/FreeBSDProcessList.c \
50
freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c freebsd/Battery.c
Hisham Muhammad's avatar
Hisham Muhammad committed
51
52

myhtopplatheaders = freebsd/Platform.h freebsd/FreeBSDProcessList.h \
53
freebsd/FreeBSDProcess.h freebsd/FreeBSDCRT.h freebsd/Battery.h
Hisham Muhammad's avatar
Hisham Muhammad committed
54
55
endif

56
57
58
59
60
61
62
63
64
if HTOP_DRAGONFLYBSD
htop_LDFLAGS += -lkvm -lkinfo
myhtopplatsources = dragonflybsd/Platform.c dragonflybsd/DragonFlyBSDProcessList.c \
dragonflybsd/DragonFlyBSDProcess.c dragonflybsd/DragonFlyBSDCRT.c dragonflybsd/Battery.c

myhtopplatheaders = dragonflybsd/Platform.h dragonflybsd/DragonFlyBSDProcessList.h \
dragonflybsd/DragonFlyBSDProcess.h dragonflybsd/DragonFlyBSDCRT.h dragonflybsd/Battery.h
endif

65
66
67
68
69
70
71
72
if HTOP_OPENBSD
myhtopplatsources = openbsd/Platform.c openbsd/OpenBSDProcessList.c \
openbsd/OpenBSDProcess.c openbsd/OpenBSDCRT.c openbsd/Battery.c

myhtopplatheaders = openbsd/Platform.h openbsd/OpenBSDProcessList.h \
openbsd/OpenBSDProcess.h openbsd/OpenBSDCRT.h openbsd/Battery.h
endif

73
74
75
76
77
78
79
80
81
if HTOP_DARWIN
htop_LDFLAGS += -framework IOKit -framework CoreFoundation
myhtopplatsources = darwin/Platform.c darwin/DarwinProcess.c \
darwin/DarwinProcessList.c darwin/DarwinCRT.c darwin/Battery.c

myhtopplatheaders = darwin/Platform.h darwin/DarwinProcess.h \
darwin/DarwinProcessList.h darwin/DarwinCRT.h darwin/Battery.h
endif

82
if HTOP_UNSUPPORTED
83
84
85
myhtopplatsources = unsupported/Platform.c \
unsupported/UnsupportedProcess.c unsupported/UnsupportedProcessList.c \
unsupported/UnsupportedCRT.c unsupported/Battery.c
86

87
88
89
myhtopplatheaders = unsupported/Platform.h \
unsupported/UnsupportedProcess.h unsupported/UnsupportedProcessList.h \
unsupported/UnsupportedCRT.h unsupported/Battery.h
90
endif
Hisham Muhammad's avatar
Hisham Muhammad committed
91
92
93

SUFFIXES = .h

94
95
96
97
98
BUILT_SOURCES = $(myhtopheaders) $(myhtopplatheaders)
htop_SOURCES  = $(myhtopheaders) $(myhtopplatheaders) $(myhtopsources) $(myhtopplatsources) config.h

target:
	echo $(htop_SOURCES)
99

100
profile:
101
	$(MAKE) all CFLAGS="-pg" AM_CPPFLAGS="-pg -O2 -DNDEBUG"
102

Hisham Muhammad's avatar
Hisham Muhammad committed
103
debug:
104
	$(MAKE) all CFLAGS="" AM_CPPFLAGS="-ggdb -DDEBUG"
105

Hisham Muhammad's avatar
Hisham Muhammad committed
106
coverage:
107
	$(MAKE) all CFLAGS="" AM_CPPFLAGS="-fprofile-arcs -ftest-coverage -DDEBUG" LDFLAGS="-lgcov"
Hisham Muhammad's avatar
Hisham Muhammad committed
108

Hisham Muhammad's avatar
Hisham Muhammad committed
109
.c.h:
110
	@srcdir@/scripts/MakeHeader.py $<
Hisham Muhammad's avatar
Hisham Muhammad committed
111

112
cppcheck:
113
	cppcheck -q -v . --enable=all -DHAVE_CGROUP -DHAVE_OPENVZ -DHAVE_TASKSTATS
114

Hisham Muhammad's avatar
Hisham Muhammad committed
115
116
117
118
119
120
.PHONY: lcov

lcov:
	mkdir -p lcov
	lcov --capture --directory . --output-file coverage.info
	genhtml coverage.info --output-directory lcov