2023-10-04 21:28:18 +02:00
|
|
|
NAME=vriscv
|
|
|
|
CC=gcc
|
|
|
|
CFLAGS=-O3 -Wall -I src
|
2023-10-08 16:40:03 +02:00
|
|
|
LDFLAGS=-lpthread
|
2023-10-04 21:28:18 +02:00
|
|
|
BUILD_DIR=build
|
|
|
|
|
|
|
|
C_FILES := $(shell find src/ -name '*.c')
|
|
|
|
|
|
|
|
all: $(BUILD_DIR)/$(NAME)
|
|
|
|
|
|
|
|
# Top-level targets
|
|
|
|
$(BUILD_DIR)/$(NAME): $(C_FILES) | $(BUILD_DIR)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
# Build directory
|
|
|
|
$(BUILD_DIR):
|
|
|
|
mkdir -p $(BUILD_DIR)
|
|
|
|
|
|
|
|
# Phony targets
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
|
|
|
|
.PHONY: run
|
|
|
|
.SILENT: run
|
|
|
|
run: all
|
|
|
|
./$(BUILD_DIR)/$(NAME)
|
2023-10-08 21:50:06 +02:00
|
|
|
|
|
|
|
.PHONY: tests
|
|
|
|
.SILENT: tests
|
|
|
|
tests: all
|
|
|
|
make -C tests
|