1if !HTOP_PCP
2bin_PROGRAMS = htop
3myhtopplatprogram = htop.c
4else
5bin_PROGRAMS = pcp-htop
6myhtopplatprogram = pcp-htop.c
7endif
8
9dist_man_MANS = htop.1
10EXTRA_DIST = \
11	$(dist_man_MANS) \
12	autogen.sh \
13	htop.desktop \
14	htop.png \
15	htop.svg \
16	build-aux/compile \
17	build-aux/depcomp \
18	build-aux/install-sh \
19	build-aux/missing
20applicationsdir = $(datadir)/applications
21applications_DATA = htop.desktop
22pixmapdir = $(datadir)/pixmaps
23pixmap_DATA = htop.png
24appicondir = $(datadir)/icons/hicolor/scalable/apps
25appicon_DATA = htop.svg
26
27AM_CFLAGS += -pedantic -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR="\"$(sysconfdir)\"" -I"$(top_srcdir)/$(my_htop_platform)"
28AM_LDFLAGS =
29
30myhtopsources = \
31	Action.c \
32	Affinity.c \
33	AffinityPanel.c \
34	AvailableColumnsPanel.c \
35	AvailableMetersPanel.c \
36	BatteryMeter.c \
37	CategoriesPanel.c \
38	ClockMeter.c \
39	ColorsPanel.c \
40	ColumnsPanel.c \
41	CommandLine.c \
42	CommandScreen.c \
43	Compat.c \
44	CPUMeter.c \
45	CRT.c \
46	DateMeter.c \
47	DateTimeMeter.c \
48	DiskIOMeter.c \
49	DisplayOptionsPanel.c \
50	DynamicColumn.c \
51	DynamicMeter.c \
52	EnvScreen.c \
53	FunctionBar.c \
54	Hashtable.c \
55	Header.c \
56	HeaderOptionsPanel.c \
57	HostnameMeter.c \
58	IncSet.c \
59	InfoScreen.c \
60	ListItem.c \
61	LoadAverageMeter.c \
62	MainPanel.c \
63	MemoryMeter.c \
64	MemorySwapMeter.c \
65	Meter.c \
66	MetersPanel.c \
67	NetworkIOMeter.c \
68	Object.c \
69	OpenFilesScreen.c \
70	OptionItem.c \
71	Panel.c \
72	Process.c \
73	ProcessList.c \
74	ProcessLocksScreen.c \
75	RichString.c \
76	ScreenManager.c \
77	Settings.c \
78	SignalsPanel.c \
79	SwapMeter.c \
80	SysArchMeter.c \
81	TasksMeter.c \
82	TraceScreen.c \
83	UptimeMeter.c \
84	UsersTable.c \
85	Vector.c \
86	XUtils.c
87
88myhtopheaders = \
89	Action.h \
90	Affinity.h \
91	AffinityPanel.h \
92	AvailableColumnsPanel.h \
93	AvailableMetersPanel.h \
94	BatteryMeter.h \
95	CPUMeter.h \
96	CRT.h \
97	CategoriesPanel.h \
98	ClockMeter.h \
99	ColorsPanel.h \
100	ColumnsPanel.h \
101	CommandLine.h \
102	CommandScreen.h \
103	Compat.h \
104	DateMeter.h \
105	DateTimeMeter.h \
106	DiskIOMeter.h \
107	DisplayOptionsPanel.h \
108	DynamicColumn.h \
109	DynamicMeter.h \
110	EnvScreen.h \
111	FunctionBar.h \
112	Hashtable.h \
113	Header.h \
114	HeaderLayout.h \
115	HeaderOptionsPanel.h \
116	HostnameMeter.h \
117	IncSet.h \
118	InfoScreen.h \
119	ListItem.h \
120	LoadAverageMeter.h \
121	Macros.h \
122	MainPanel.h \
123	MemoryMeter.h \
124	MemorySwapMeter.h \
125	Meter.h \
126	MetersPanel.h \
127	NetworkIOMeter.h \
128	Object.h \
129	OpenFilesScreen.h \
130	OptionItem.h \
131	Panel.h \
132	Process.h \
133	ProcessList.h \
134	ProcessLocksScreen.h \
135	ProvideCurses.h \
136	RichString.h \
137	ScreenManager.h \
138	Settings.h \
139	SignalsPanel.h \
140	SwapMeter.h \
141	SysArchMeter.h \
142	TasksMeter.h \
143	TraceScreen.h \
144	UptimeMeter.h \
145	UsersTable.h \
146	Vector.h \
147	XUtils.h
148
149# Linux
150# -----
151
152linux_platform_headers = \
153	generic/gettime.h \
154	generic/hostname.h \
155	generic/uname.h \
156	linux/CGroupUtils.h \
157	linux/HugePageMeter.h \
158	linux/IOPriority.h \
159	linux/IOPriorityPanel.h \
160	linux/LibSensors.h \
161	linux/LinuxProcess.h \
162	linux/LinuxProcessList.h \
163	linux/Platform.h \
164	linux/PressureStallMeter.h \
165	linux/ProcessField.h \
166	linux/SELinuxMeter.h \
167	linux/SystemdMeter.h \
168	linux/ZramMeter.h \
169	linux/ZramStats.h \
170	zfs/ZfsArcMeter.h \
171	zfs/ZfsArcStats.h \
172	zfs/ZfsCompressedArcMeter.h
173
174linux_platform_sources = \
175	generic/gettime.c \
176	generic/hostname.c \
177	generic/uname.c \
178	linux/CGroupUtils.c \
179	linux/HugePageMeter.c \
180	linux/IOPriorityPanel.c \
181	linux/LibSensors.c \
182	linux/LinuxProcess.c \
183	linux/LinuxProcessList.c \
184	linux/Platform.c \
185	linux/PressureStallMeter.c \
186	linux/SELinuxMeter.c \
187	linux/SystemdMeter.c \
188	linux/ZramMeter.c \
189	zfs/ZfsArcMeter.c \
190	zfs/ZfsCompressedArcMeter.c
191
192if HTOP_LINUX
193AM_LDFLAGS += -rdynamic
194myhtopplatheaders = $(linux_platform_headers)
195myhtopplatsources = $(linux_platform_sources)
196endif
197
198# FreeBSD
199# -------
200
201freebsd_platform_headers = \
202	freebsd/FreeBSDProcessList.h \
203	freebsd/FreeBSDProcess.h \
204	freebsd/Platform.h \
205	freebsd/ProcessField.h \
206	generic/gettime.h \
207	generic/hostname.h \
208	generic/openzfs_sysctl.h \
209	generic/uname.h \
210	zfs/ZfsArcMeter.h \
211	zfs/ZfsArcStats.h \
212	zfs/ZfsCompressedArcMeter.h
213
214freebsd_platform_sources = \
215	freebsd/Platform.c \
216	freebsd/FreeBSDProcessList.c \
217	freebsd/FreeBSDProcess.c \
218	generic/gettime.c \
219	generic/hostname.c \
220	generic/openzfs_sysctl.c \
221	generic/uname.c \
222	zfs/ZfsArcMeter.c \
223	zfs/ZfsCompressedArcMeter.c
224
225if HTOP_FREEBSD
226myhtopplatheaders = $(freebsd_platform_headers)
227myhtopplatsources = $(freebsd_platform_sources)
228endif
229
230# DragonFlyBSD
231# ------------
232
233dragonflybsd_platform_headers = \
234	dragonflybsd/DragonFlyBSDProcessList.h \
235	dragonflybsd/DragonFlyBSDProcess.h \
236	dragonflybsd/Platform.h \
237	dragonflybsd/ProcessField.h \
238	generic/gettime.h \
239	generic/hostname.h \
240	generic/uname.h
241
242dragonflybsd_platform_sources = \
243	dragonflybsd/DragonFlyBSDProcessList.c \
244	dragonflybsd/DragonFlyBSDProcess.c \
245	dragonflybsd/Platform.c \
246	generic/gettime.c \
247	generic/hostname.c \
248	generic/uname.c
249
250if HTOP_DRAGONFLYBSD
251myhtopplatheaders = $(dragonflybsd_platform_headers)
252myhtopplatsources = $(dragonflybsd_platform_sources)
253endif
254
255# NetBSD
256# -------
257
258netbsd_platform_headers = \
259	generic/gettime.h \
260	generic/hostname.h \
261	generic/uname.h \
262	netbsd/Platform.h \
263	netbsd/ProcessField.h \
264	netbsd/NetBSDProcess.h \
265	netbsd/NetBSDProcessList.h
266
267netbsd_platform_sources = \
268	generic/gettime.c \
269	generic/hostname.c \
270	generic/uname.c \
271	netbsd/Platform.c \
272	netbsd/NetBSDProcess.c \
273	netbsd/NetBSDProcessList.c
274
275if HTOP_NETBSD
276myhtopplatheaders = $(netbsd_platform_headers)
277myhtopplatsources = $(netbsd_platform_sources)
278endif
279
280# OpenBSD
281# -------
282
283openbsd_platform_headers = \
284	generic/gettime.h \
285	generic/hostname.h \
286	generic/uname.h \
287	openbsd/OpenBSDProcessList.h \
288	openbsd/OpenBSDProcess.h \
289	openbsd/Platform.h \
290	openbsd/ProcessField.h
291
292openbsd_platform_sources = \
293	generic/gettime.c \
294	generic/hostname.c \
295	generic/uname.c \
296	openbsd/OpenBSDProcessList.c \
297	openbsd/OpenBSDProcess.c \
298	openbsd/Platform.c
299
300if HTOP_OPENBSD
301myhtopplatheaders = $(openbsd_platform_headers)
302myhtopplatsources = $(openbsd_platform_sources)
303endif
304
305# Darwin
306# ------
307
308darwin_platform_headers = \
309	darwin/DarwinProcess.h \
310	darwin/DarwinProcessList.h \
311	darwin/Platform.h \
312	darwin/PlatformHelpers.h \
313	darwin/ProcessField.h \
314	generic/gettime.h \
315	generic/hostname.h \
316	generic/openzfs_sysctl.h \
317	generic/uname.h \
318	zfs/ZfsArcMeter.h \
319	zfs/ZfsArcStats.h \
320	zfs/ZfsCompressedArcMeter.h
321
322darwin_platform_sources = \
323	darwin/Platform.c \
324	darwin/PlatformHelpers.c \
325	darwin/DarwinProcess.c \
326	darwin/DarwinProcessList.c \
327	generic/gettime.c \
328	generic/hostname.c \
329	generic/openzfs_sysctl.c \
330	generic/uname.c \
331	zfs/ZfsArcMeter.c \
332	zfs/ZfsCompressedArcMeter.c
333
334if HTOP_DARWIN
335AM_LDFLAGS += -framework IOKit -framework CoreFoundation
336myhtopplatheaders = $(darwin_platform_headers)
337myhtopplatsources = $(darwin_platform_sources)
338endif
339
340# Solaris
341# -------
342
343solaris_platform_headers = \
344	generic/gettime.h \
345	generic/hostname.h \
346	generic/uname.h \
347	solaris/ProcessField.h \
348	solaris/Platform.h \
349	solaris/SolarisProcess.h \
350	solaris/SolarisProcessList.h \
351	zfs/ZfsArcMeter.h \
352	zfs/ZfsArcStats.h \
353	zfs/ZfsCompressedArcMeter.h
354
355solaris_platform_sources = \
356	generic/gettime.c \
357	generic/hostname.c \
358	generic/uname.c \
359	solaris/Platform.c \
360	solaris/SolarisProcess.c \
361	solaris/SolarisProcessList.c \
362	zfs/ZfsArcMeter.c \
363	zfs/ZfsCompressedArcMeter.c
364
365if HTOP_SOLARIS
366myhtopplatheaders = $(solaris_platform_headers)
367myhtopplatsources = $(solaris_platform_sources)
368endif
369
370# Performance Co-Pilot (PCP)
371# --------------------------
372
373pcp_platform_headers = \
374	linux/PressureStallMeter.h \
375	linux/ZramMeter.h \
376	linux/ZramStats.h \
377	pcp/PCPDynamicColumn.h \
378	pcp/PCPDynamicMeter.h \
379	pcp/PCPMetric.h \
380	pcp/PCPProcess.h \
381	pcp/PCPProcessList.h \
382	pcp/Platform.h \
383	pcp/ProcessField.h \
384	zfs/ZfsArcMeter.h \
385	zfs/ZfsArcStats.h \
386	zfs/ZfsCompressedArcMeter.h
387
388pcp_platform_sources = \
389	linux/PressureStallMeter.c \
390	linux/ZramMeter.c \
391	pcp/PCPDynamicColumn.c \
392	pcp/PCPDynamicMeter.c \
393	pcp/PCPMetric.c \
394	pcp/PCPProcess.c \
395	pcp/PCPProcessList.c \
396	pcp/Platform.c \
397	zfs/ZfsArcMeter.c \
398	zfs/ZfsCompressedArcMeter.c
399
400if HTOP_PCP
401myhtopplatheaders = $(pcp_platform_headers)
402myhtopplatsources = $(pcp_platform_sources)
403pcp_htop_SOURCES  = $(myhtopplatprogram) $(myhtopheaders) $(myhtopplatheaders) $(myhtopsources) $(myhtopplatsources)
404endif
405
406# Unsupported
407# -----------
408
409unsupported_platform_headers = \
410	generic/gettime.h \
411	unsupported/Platform.h \
412	unsupported/ProcessField.h \
413	unsupported/UnsupportedProcess.h \
414	unsupported/UnsupportedProcessList.h
415
416unsupported_platform_sources = \
417	generic/gettime.c \
418	unsupported/Platform.c \
419	unsupported/UnsupportedProcess.c \
420	unsupported/UnsupportedProcessList.c
421
422if HTOP_UNSUPPORTED
423myhtopplatsources = $(unsupported_platform_sources)
424myhtopplatheaders = $(unsupported_platform_headers)
425endif
426
427# ----
428
429htop_SOURCES = $(myhtopplatprogram) $(myhtopheaders) $(myhtopplatheaders) $(myhtopsources) $(myhtopplatsources)
430nodist_htop_SOURCES = config.h
431
432target:
433	echo $(htop_SOURCES)
434
435profile:
436	$(MAKE) all AM_CPPFLAGS="-pg -O2 -DNDEBUG"
437
438debug:
439	$(MAKE) all AM_CPPFLAGS="-ggdb3 -Og" CFLAGS="`printf ' %s ' "$(CFLAGS)"|sed -E 's#[[:space:]]-O[^[:space:]]+[[:space:]]# #g'` -ggdb3 -Og"
440
441coverage:
442	$(MAKE) all AM_CPPFLAGS="-fprofile-arcs -ftest-coverage" AM_LDFLAGS="-lgcov"
443
444cppcheck:
445	cppcheck -q -v . --enable=all -DHAVE_OPENVZ
446
447dist-hook: $(top_distdir)/configure
448	@if grep 'pkg_m4_absent' '$(top_distdir)/configure'; then \
449	   echo 'configure is generated without pkg.m4. Please supply pkg.m4 and run ./autogen.sh to rebuild the configure script.'>&2; \
450	   (exit 1); \
451	else :; \
452	fi
453
454.PHONY: lcov
455
456lcov:
457	mkdir -p lcov
458	lcov --capture --directory . --output-file coverage.info
459	genhtml coverage.info --output-directory lcov
460