]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libpmcstat/Makefile
libpmcstat: compile in events based on json description
[FreeBSD/FreeBSD.git] / lib / libpmcstat / Makefile
1 # $FreeBSD$
2 PACKAGE=lib${LIB}
3 LIB=    pmcstat
4 INTERNALLIB=
5
6 SRCS=   \
7         libpmcstat_event.c      \
8         libpmcstat_image.c      \
9         libpmcstat_logging.c    \
10         libpmcstat_process.c    \
11         libpmcstat_string.c     \
12         libpmcstat_symbol.c     \
13         libpmcstat_pmu_util.c
14 INCS=   libpmcstat.h
15
16 CFLAGS+= -I${.CURDIR}
17
18 .if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
19         ${MACHINE_CPUARCH} == "powerpc")
20 .if ${MACHINE_CPUARCH} == "aarch64"
21 EVENT_ARCH="arm64"
22 .elif ${MACHINE_CPUARCH} == "amd64"
23 EVENT_ARCH="x86"
24 .elif ${MACHINE_CPUARCH} == "powerpc"
25 EVENT_ARCH="powerpc"
26 .endif
27
28 .if defined(HOST_OBJTOP)
29 JEVENTS= ${HOST_OBJTOP}/${RELDIR}/pmu-events/jevents
30 .else
31 JEVENTS= pmu-events/jevents
32 .endif
33
34 libpmcstat_events.c: ${JEVENTS}
35         ${JEVENTS} ${EVENT_ARCH} ${.CURDIR}/pmu-events/arch libpmcstat_events.c
36 SRCS+= libpmcstat_events.c
37 .endif
38
39 .include <bsd.lib.mk>