xref: /freebsd/lib/libpmc/Makefile (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1
2LIB_CXX= pmc
3
4SRCS=	libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json.cc
5INCS=	pmc.h pmclog.h pmcformat.h
6
7CFLAGS+= -I${SRCTOP}/${RELDIR:H}/libpmcstat
8
9.if ${MACHINE_CPUARCH} == "aarch64"
10EVENT_ARCH="arm64"
11.elif ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
12EVENT_ARCH="x86"
13.elif ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH:Mpowerpc64*} != ""
14EVENT_ARCH="powerpc"
15.else
16# This will generate an empty events table
17EVENT_ARCH="none"
18.endif
19
20.if ${MK_DIRDEPS_BUILD} == "yes"
21# avoid circular dependency
22GENDIRDEPS_FILTER+= N${RELDIR:H}/libpmcstat
23JEVENTS?= ${HOST_OBJTOP}/${RELDIR}/pmu-events/jevents
24.else
25JEVENTS= ${BTOOLSPATH:U.}/pmu-events/jevents
26
27# This file is built in a subdirectory so never try to rebuild it here.
28${JEVENTS}: .PHONY
29.if make(*clean*)
30SUBDIR+= pmu-events
31.endif
32.endif
33
34libpmc_events.c: ${JEVENTS} .META
35	${JEVENTS} ${EVENT_ARCH} ${.CURDIR}/pmu-events/arch ${.TARGET}.tmp
36	if [ ! -e ${.TARGET} ] || ! cmp -s ${.TARGET} ${.TARGET}.tmp; then \
37		mv -f ${.TARGET}.tmp ${.TARGET}; \
38	fi
39CLEANFILES+=	libpmc_events.c libpmc_events.c.tmp
40SRCS+=	libpmc_events.c
41
42WARNS?=	3
43
44CFLAGS+= -I${.CURDIR} -I${SRCTOP}/sys
45CWARNFLAGS.gcc+= -Wno-shadow -Wno-cast-align
46
47MAN=	pmc.3
48MAN+=	pmc_allocate.3
49MAN+=	pmc_attach.3
50MAN+=	pmc_capabilities.3
51MAN+=	pmc_configure_logfile.3
52MAN+=	pmc_disable.3
53MAN+=	pmc_event_names_of_class.3
54MAN+=	pmc_get_driver_stats.3
55MAN+=	pmc_get_msr.3
56MAN+=	pmc_init.3
57MAN+=	pmc_name_of_capability.3
58MAN+=	pmc_read.3
59MAN+=	pmc_set.3
60MAN+=	pmc_start.3
61MAN+=	pmclog.3
62MAN+=	pmc.soft.3
63
64# PMC-dependent manual pages
65MAN+=	pmc.amd.3
66MAN+=	pmc.atom.3
67MAN+=	pmc.atomsilvermont.3
68MAN+=	pmc.cmn-600.3
69MAN+=	pmc.core.3
70MAN+=	pmc.core2.3
71MAN+=	pmc.corei7.3
72MAN+=	pmc.corei7uc.3
73MAN+=	pmc.dmc-620.3
74MAN+=	pmc.haswell.3
75MAN+=	pmc.haswelluc.3
76MAN+=	pmc.haswellxeon.3
77MAN+=	pmc.iaf.3
78MAN+=	pmc.ivybridge.3
79MAN+=	pmc.ivybridgexeon.3
80MAN+=	pmc.sandybridge.3
81MAN+=	pmc.sandybridgeuc.3
82MAN+=	pmc.sandybridgexeon.3
83MAN+=	pmc.tsc.3
84MAN+=	pmc.ucf.3
85MAN+=	pmc.westmere.3
86MAN+=	pmc.westmereuc.3
87
88MLINKS+= \
89	pmc_allocate.3 pmc_release.3 \
90	pmc_attach.3 pmc_detach.3 \
91	pmc_capabilities.3 pmc_ncpu.3 \
92	pmc_capabilities.3 pmc_npmc.3 \
93	pmc_capabilities.3 pmc_pmcinfo.3 \
94	pmc_capabilities.3 pmc_cpuinfo.3 \
95	pmc_capabilities.3 pmc_width.3 \
96	pmc_configure_logfile.3 pmc_flush_logfile.3 \
97	pmc_configure_logfile.3 pmc_writelog.3 \
98	pmc_disable.3 pmc_enable.3 \
99	pmc_name_of_capability.3 pmc_name_of_class.3 \
100	pmc_name_of_capability.3 pmc_name_of_cputype.3 \
101	pmc_name_of_capability.3 pmc_name_of_disposition.3 \
102	pmc_name_of_capability.3 pmc_name_of_event.3 \
103	pmc_name_of_capability.3 pmc_name_of_mode.3 \
104	pmc_name_of_capability.3 pmc_name_of_state.3 \
105	pmc_read.3 pmc_rw.3 \
106	pmc_read.3 pmc_write.3 \
107	pmc_start.3 pmc_stop.3
108
109MLINKS+= \
110	pmclog.3 pmclog_open.3 \
111	pmclog.3 pmclog_close.3 \
112	pmclog.3 pmclog_feed.3 \
113	pmclog.3 pmclog_read.3
114
115# Class aliases
116MLINKS+= \
117	pmc.amd.3 pmc.k8.3
118
119.include <bsd.lib.mk>
120