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