1# SPDX-License-Identifier: GPL-2.0
2# Carsten Haitzler <carsten.haitzler@arm.com>, 2021
3
4include ../Makefile.miniconfig
5
6# Binary to produce
7BIN=asm_pure_loop
8# Any linking/libraries needed for the binary - empty if none needed
9LIB=
10
11all: $(BIN)
12
13$(BIN): $(BIN).S
14ifdef CORESIGHT
15ifeq ($(ARCH),arm64)
16# Build line - this is raw asm with no libc to have an always exact binary
17	$(Q)$(CC) $(BIN).S -nostdlib -static -o $(BIN) $(LIB)
18endif
19endif
20
21install-tests: all
22ifdef CORESIGHT
23ifeq ($(ARCH),arm64)
24# Install the test tool in the right place
25	$(call QUIET_INSTALL, tests) \
26		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/$(INSTDIR_SUB)/$(BIN)'; \
27		$(INSTALL) $(BIN) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/$(INSTDIR_SUB)/$(BIN)/$(BIN)'
28endif
29endif
30
31clean:
32	$(Q)$(RM) -f $(BIN)
33
34.PHONY: all clean install-tests
35