From 575d865b80c5c760cb266bf0908b12e21cf30185 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Fri, 14 Jun 2024 10:37:13 +0200 Subject: [PATCH] Don't hard-code GCC in Makefile This uses the `CC` variable (which defaults to `cc`) so that compilation works when using Clang. This also allows the compiler to be overridden via `CC=foo make`. --- Makefile | 4 ++-- c_emulator/SoftFloat-3e/build/Linux-RISCV-GCC/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index da4029633..d62c85839 100644 --- a/Makefile +++ b/Makefile @@ -278,7 +278,7 @@ osim: ocaml_emulator/riscv_ocaml_sim_$(ARCH) rvfi: c_emulator/riscv_rvfi_$(ARCH) c_emulator/riscv_sim_$(ARCH): generated_definitions/c/riscv_model_$(ARCH).c $(C_INCS) $(C_SRCS) $(SOFTFLOAT_LIBS) Makefile - gcc -g $(C_WARNINGS) $(C_FLAGS) $< $(C_SRCS) $(SAIL_LIB_DIR)/*.c $(C_LIBS) -o $@ + $(CC) -g $(C_WARNINGS) $(C_FLAGS) $< $(C_SRCS) $(SAIL_LIB_DIR)/*.c $(C_LIBS) -o $@ # Note: We have to add -c_preserve since the functions might be optimized out otherwise rvfi_preserve_fns=-c_preserve rvfi_set_instr_packet \ @@ -304,7 +304,7 @@ generated_definitions/c/riscv_rvfi_model_$(ARCH).c: $(SAIL_RVFI_SRCS) model/main mv $@.new $@ c_emulator/riscv_rvfi_$(ARCH): generated_definitions/c/riscv_rvfi_model_$(ARCH).c $(C_INCS) $(C_SRCS) $(SOFTFLOAT_LIBS) Makefile - gcc -g $(C_WARNINGS) $(C_FLAGS) $< -DRVFI_DII $(C_SRCS) $(SAIL_LIB_DIR)/*.c $(C_LIBS) -o $@ + $(CC) -g $(C_WARNINGS) $(C_FLAGS) $< -DRVFI_DII $(C_SRCS) $(SAIL_LIB_DIR)/*.c $(C_LIBS) -o $@ latex: $(SAIL_SRCS) Makefile mkdir -p generated_definitions/latex diff --git a/c_emulator/SoftFloat-3e/build/Linux-RISCV-GCC/Makefile b/c_emulator/SoftFloat-3e/build/Linux-RISCV-GCC/Makefile index c8965c8b6..8cddff6f6 100644 --- a/c_emulator/SoftFloat-3e/build/Linux-RISCV-GCC/Makefile +++ b/c_emulator/SoftFloat-3e/build/Linux-RISCV-GCC/Makefile @@ -44,7 +44,7 @@ SOFTFLOAT_OPTS ?= \ DELETE = rm -f C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include COMPILE_C = \ - gcc -c -Werror-implicit-function-declaration \ + $(CC) -c -Werror-implicit-function-declaration \ $(SOFTFLOAT_OPTS) $(C_INCLUDES) -O2 -o $@ MAKELIB = ar crs $@