Makefile.am 6.17 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

15
16
AM_CFLAGS = -pedantic -Wall $(wextra_flag) -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)"
AM_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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
all_platform_headers =

# Linux
# -----

linux_platform_headers = \
	linux/Platform.h \
	linux/IOPriorityPanel.h \
	linux/IOPriority.h \
	linux/LinuxProcess.h \
	linux/LinuxProcessList.h \
	linux/LinuxCRT.h \
	linux/Battery.h

all_platform_headers += $(linux_platform_headers)

55
if HTOP_LINUX
56
AM_CFLAGS += -rdynamic
57
myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c linux/IOPriority.c \
58
linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c
59

60
myhtopplatheaders = $(linux_platform_headers)
61
62
endif

63
64
65
66
67
68
69
70
71
72
73
74
# FreeBSD
# -------

freebsd_platform_headers = \
	freebsd/Platform.h \
	freebsd/FreeBSDProcessList.h \
	freebsd/FreeBSDProcess.h \
	freebsd/FreeBSDCRT.h \
	freebsd/Battery.h

all_platform_headers += $(freebsd_platform_headers)

Hisham Muhammad's avatar
Hisham Muhammad committed
75
76
if HTOP_FREEBSD
myhtopplatsources = freebsd/Platform.c freebsd/FreeBSDProcessList.c \
77
freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c freebsd/Battery.c
Hisham Muhammad's avatar
Hisham Muhammad committed
78

79
myhtopplatheaders = $(freebsd_platform_headers)
Hisham Muhammad's avatar
Hisham Muhammad committed
80
81
endif

82
83
84
85
86
87
88
89
90
91
92
93
# DragonFlyBSD
# ------------

dragonflybsd_platform_headers = \
	dragonflybsd/Platform.h \
	dragonflybsd/DragonFlyBSDProcessList.h \
	dragonflybsd/DragonFlyBSDProcess.h \
	dragonflybsd/DragonFlyBSDCRT.h \
	dragonflybsd/Battery.h

all_platform_headers += $(dragonflybsd_platform_headers)

94
if HTOP_DRAGONFLYBSD
95
AM_LDFLAGS += -lkvm -lkinfo -lexecinfo
96
97
98
myhtopplatsources = dragonflybsd/Platform.c dragonflybsd/DragonFlyBSDProcessList.c \
dragonflybsd/DragonFlyBSDProcess.c dragonflybsd/DragonFlyBSDCRT.c dragonflybsd/Battery.c

99
myhtopplatheaders = $(dragonflybsd_platform_headers)
100
101
endif

102
103
104
105
106
107
108
109
110
111
112
113
# OpenBSD
# -------

openbsd_platform_headers = \
	openbsd/Platform.h \
	openbsd/OpenBSDProcessList.h \
	openbsd/OpenBSDProcess.h \
	openbsd/OpenBSDCRT.h \
	openbsd/Battery.h

all_platform_headers += $(openbsd_platform_headers)

114
115
116
117
if HTOP_OPENBSD
myhtopplatsources = openbsd/Platform.c openbsd/OpenBSDProcessList.c \
openbsd/OpenBSDProcess.c openbsd/OpenBSDCRT.c openbsd/Battery.c

118
myhtopplatheaders = $(openbsd_platform_headers)
119
120
endif

121
122
123
124
125
126
127
128
129
130
131
132
# Darwin
# ------

darwin_platform_headers = \
	darwin/Platform.h \
	darwin/DarwinProcess.h \
	darwin/DarwinProcessList.h \
	darwin/DarwinCRT.h \
	darwin/Battery.h

all_platform_headers += $(darwin_platform_headers)

133
if HTOP_DARWIN
134
AM_LDFLAGS += -framework IOKit -framework CoreFoundation
135
136
137
myhtopplatsources = darwin/Platform.c darwin/DarwinProcess.c \
darwin/DarwinProcessList.c darwin/DarwinCRT.c darwin/Battery.c

138
myhtopplatheaders = $(darwin_platform_headers)
139
140
endif

141
142
143
144
145
146
147
148
149
150
151
152
# Solaris
# -------

solaris_platform_headers = \
	solaris/Platform.h \
	solaris/SolarisProcess.h \
	solaris/SolarisProcessList.h \
	solaris/SolarisCRT.h \
	solaris/Battery.h

all_platform_headers += $(solaris_platform_headers)

gmbroome's avatar
gmbroome committed
153
154
155
156
157
if HTOP_SOLARIS
myhtopplatsources = solaris/Platform.c \
solaris/SolarisProcess.c solaris/SolarisProcessList.c \
solaris/SolarisCRT.c solaris/Battery.c

158
myhtopplatheaders = $(solaris_platform_headers)
gmbroome's avatar
gmbroome committed
159
160
endif

161
162
163
164
165
166
167
168
169
170
171
172
# Unsupported
# -----------

unsupported_platform_headers = \
	unsupported/Platform.h \
	unsupported/UnsupportedProcess.h \
	unsupported/UnsupportedProcessList.h \
	unsupported/UnsupportedCRT.h \
	unsupported/Battery.h

all_platform_headers += $(unsupported_platform_headers)

173
if HTOP_UNSUPPORTED
174
175
176
myhtopplatsources = unsupported/Platform.c \
unsupported/UnsupportedProcess.c unsupported/UnsupportedProcessList.c \
unsupported/UnsupportedCRT.c unsupported/Battery.c
177

178
myhtopplatheaders = $(unsupported_platform_headers)
179
endif
Hisham Muhammad's avatar
Hisham Muhammad committed
180

181
182
# ----

Hisham Muhammad's avatar
Hisham Muhammad committed
183
184
SUFFIXES = .h

185
186
187
BUILT_SOURCES = $(myhtopheaders) $(myhtopplatheaders)
htop_SOURCES  = $(myhtopheaders) $(myhtopplatheaders) $(myhtopsources) $(myhtopplatsources) config.h

188
189
190
191
192
193
194
.PHONY: htop-headers clean-htop-headers

htop-headers: $(myhtopheaders) $(all_platform_headers)

clean-htop-headers:
	-rm -f $(myhtopheaders) $(all_platform_headers)

195
196
target:
	echo $(htop_SOURCES)
197

198
profile:
199
	$(MAKE) all CFLAGS="-pg" AM_CPPFLAGS="-pg -O2 -DNDEBUG"
200

Hisham Muhammad's avatar
Hisham Muhammad committed
201
debug:
202
	$(MAKE) all CFLAGS="" AM_CPPFLAGS="-ggdb -DDEBUG"
203

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

Hisham Muhammad's avatar
Hisham Muhammad committed
207
.c.h:
208
	@srcdir@/scripts/MakeHeader.py $<
Hisham Muhammad's avatar
Hisham Muhammad committed
209

210
cppcheck:
211
	cppcheck -q -v . --enable=all -DHAVE_CGROUP -DHAVE_OPENVZ -DHAVE_TASKSTATS
212

213
214
215
216
217
218
219
dist-hook: $(top_distdir)/configure
	@if grep 'pkg_m4_absent' '$(top_distdir)/configure'; then \
	   echo 'configure is generated without pkg.m4. Please supply pkg.m4 and run ./autogen.sh to rebuild the configure script.'>&2; \
	   (exit 1); \
	else :; \
	fi

Hisham Muhammad's avatar
Hisham Muhammad committed
220
221
222
223
224
225
.PHONY: lcov

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