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