xref: /freebsd/lib/libpmc/Makefile (revision f39bffc62c1395bde25d152c7f68fdf7cbaab414)
1# $FreeBSD$
2
3PACKAGE=lib${LIB}
4LIB=	pmc
5
6SRCS=	libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json.cc
7INCS=	pmc.h pmclog.h pmcformat.h
8
9CFLAGS+= -I${.CURDIR}
10CWARNFLAGS.gcc+= -Wno-shadow
11
12.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
13
14.if ${MACHINE_ARCH} == "aarch64"
15EVENT_ARCH="arm64"
16.elif ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
17EVENT_ARCH="x86"
18.elif ${MACHINE_ARCH} == "powerpc"
19EVENT_ARCH="powerpc"
20.endif
21
22JEVENTS= ${BTOOLSPATH:U.}/pmu-events/jevents
23# This file is built in a subdirectory so never try to rebuild it here.
24${JEVENTS}: .PHONY
25.if make(*clean*)
26SUBDIR+= pmu-events
27.endif
28
29libpmc_events.c: ${JEVENTS}
30	${JEVENTS} ${EVENT_ARCH} ${.CURDIR}/pmu-events/arch libpmc_events.c
31SRCS+= libpmc_events.c
32.endif
33
34MAN=	pmc.3
35MAN+=	pmc_allocate.3
36MAN+=	pmc_attach.3
37MAN+=	pmc_capabilities.3
38MAN+=	pmc_configure_logfile.3
39MAN+=	pmc_disable.3
40MAN+=	pmc_event_names_of_class.3
41MAN+=	pmc_get_driver_stats.3
42MAN+=	pmc_get_msr.3
43MAN+=	pmc_init.3
44MAN+=	pmc_name_of_capability.3
45MAN+=	pmc_read.3
46MAN+=	pmc_set.3
47MAN+=	pmc_start.3
48MAN+=	pmclog.3
49MAN+=	pmc.soft.3
50
51# PMC-dependent manual pages
52MAN+=	pmc.atom.3
53MAN+=	pmc.atomsilvermont.3
54MAN+=	pmc.core.3
55MAN+=	pmc.core2.3
56MAN+=	pmc.corei7.3
57MAN+=	pmc.corei7uc.3
58MAN+=	pmc.haswell.3
59MAN+=	pmc.haswelluc.3
60MAN+=	pmc.haswellxeon.3
61MAN+=	pmc.iaf.3
62MAN+=	pmc.ivybridge.3
63MAN+=	pmc.ivybridgexeon.3
64MAN+=	pmc.k7.3
65MAN+=	pmc.k8.3
66MAN+=	pmc.mips24k.3
67MAN+=	pmc.octeon.3
68MAN+=	pmc.p4.3
69MAN+=	pmc.p5.3
70MAN+=	pmc.p6.3
71MAN+=	pmc.sandybridge.3
72MAN+=	pmc.sandybridgeuc.3
73MAN+=	pmc.sandybridgexeon.3
74MAN+=	pmc.tsc.3
75MAN+=	pmc.ucf.3
76MAN+=	pmc.westmere.3
77MAN+=	pmc.westmereuc.3
78MAN+=	pmc.xscale.3
79
80MLINKS+= \
81	pmc_allocate.3 pmc_release.3 \
82	pmc_attach.3 pmc_detach.3 \
83	pmc_capabilities.3 pmc_ncpu.3 \
84	pmc_capabilities.3 pmc_npmc.3 \
85	pmc_capabilities.3 pmc_pmcinfo.3 \
86	pmc_capabilities.3 pmc_cpuinfo.3 \
87	pmc_capabilities.3 pmc_width.3 \
88	pmc_configure_logfile.3 pmc_flush_logfile.3 \
89	pmc_configure_logfile.3 pmc_writelog.3 \
90	pmc_disable.3 pmc_enable.3 \
91	pmc_name_of_capability.3 pmc_name_of_class.3 \
92	pmc_name_of_capability.3 pmc_name_of_cputype.3 \
93	pmc_name_of_capability.3 pmc_name_of_disposition.3 \
94	pmc_name_of_capability.3 pmc_name_of_event.3 \
95	pmc_name_of_capability.3 pmc_name_of_mode.3 \
96	pmc_name_of_capability.3 pmc_name_of_state.3 \
97	pmc_read.3 pmc_rw.3 \
98	pmc_read.3 pmc_write.3 \
99	pmc_start.3 pmc_stop.3
100
101MLINKS+= \
102	pmclog.3 pmclog_open.3 \
103	pmclog.3 pmclog_close.3 \
104	pmclog.3 pmclog_feed.3 \
105	pmclog.3 pmclog_read.3
106
107.include <bsd.lib.mk>
108