From f463d544793ff83efd8b95d0bce5ec80fd8170f3 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 4 Dec 2024 21:42:37 +0100 Subject: Remove old test code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is some code that I had there after messing with some of the topics on Uros' blog (https://popovicu.com/), but that became irrelevant after working on some other projects (e.g. fbos) or on other examples. This commit also brings about a major overhaul on the structure of the project. Hopefully it's now at a more ready state. Signed-off-by: Miquel Sabaté Solà --- arch/riscv/user/hwprobe/Makefile | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 arch/riscv/user/hwprobe/Makefile (limited to 'arch/riscv/user/hwprobe/Makefile') diff --git a/arch/riscv/user/hwprobe/Makefile b/arch/riscv/user/hwprobe/Makefile new file mode 100644 index 0000000..9b813ff --- /dev/null +++ b/arch/riscv/user/hwprobe/Makefile @@ -0,0 +1,60 @@ +## +# By default everything is silent. If you want to change this behavior, simply +# assign V=1 when calling make. + +V = +ifeq ($(strip $(V)),) + E = @echo + Q = @ +else + E = @\# + Q = +endif + +## +# Compile options. You can use CROSS_COMPILE just like on the Linux Kernel. You +# can also determine the ISA to be used, which defaults to my VisionFive2 board. +# I did not go too much into the rabbit hole of platform-specific flags because +# everything is in assembly anyways and everything is statically linked. Hence +# no `-mcpu`, no `-mtune`, no funny business. + +CC = $(CROSS_COMPILE)gcc +LD = $(CROSS_COMPILE)ld +ISA ?= rv64imafdc_zicntr_zicsr_zifencei_zihpm_zca_zcd_zba_zbb +WARNINGS = -Werror -Wpedantic -Wall -Wextra -Wcast-align -Wcast-qual -Winit-self \ + -Wmissing-include-dirs -Wredundant-decls -Wshadow -Wsign-conversion \ + -Wswitch-default -Wundef -Wunreachable-code -Wmissing-noreturn +CCFLAGS = $(WARNINGS) -march=$(ISA) +LDFLAGS = + + +# You can pass an optional `DEBUG` variable to manipulate the build type. +DEBUG = +ifeq ($(strip $(DEBUG)),) + CCFLAGS += -O3 +else + CCFLAGS += -g +endif + +## +# Paths. + +SRC = $(wildcard *.c) +EXES = $(SRC:.c=) + +## +# Targets + +.PHONY: all +all: clean $(EXES) + +.PHONY: build +build: $(EXES) + +.c: + $(E) " CC " $(*F) + $(Q) $(CC) $(CCFLAGS) $< -o $@ + +.PHONY: clean +clean: + $(Q) rm -f $(EXES) -- cgit v1.2.3