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