From 4d4a76140f9194fd1a6f0a2d40d467094c5f28e8 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Wed, 1 Feb 2023 18:54:04 -0400 Subject: make: Create `CFLAGS_BASE`, and make seperate `FLAGS` for c, and c++ --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1f61024..e004b03 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,10 @@ LDFLAGS := -fp hard -nodefaults ASFLAGS := -mgekko $(ASM_INCLUDES) -CFLAGS := -nodefaults -proc gekko -fp hard -O4 -use_lmw_stmw on -str reuse -RTTI off -rostr -sdata2 4 -g $(INCLUDES) $(TEST_LD) +CFLAGS_BASE := -I- $(INCLUDES) $(TEST_LD) -nodefaults -proc gekko -fp hard -O4 -use_lmw_stmw on -enum int -str reuse -rostr -sdata2 4 + +CFLAGS := $(CFLAGS_BASE) +CXXFLAGS := $(CFLAGS_BASE) -Cpp_exceptions off -RTTI off include obj_files.mk @@ -64,12 +67,12 @@ $(BUILD_DIR)/%.o: %.s $(BUILD_DIR)/%.o: %.c @echo "Compiling " $< - $(QUIET) $(CC) $(CFLAGS) $(FILE_UNIQUE_CFLAGS) -c -o $@ $< + $(QUIET) $(CC) -lang=c $(CFLAGS) $(FILE_UNIQUE_CFLAGS) -c -o $@ $< $(BUILD_DIR)/%.o: %.cp @echo "Compiling " $< - $(QUIET) $(CC) $(CFLAGS) $(FILE_UNIQUE_CFLAGS) -c -o $@ $< + $(QUIET) $(CC) $(CXXFLAGS) $(FILE_UNIQUE_CFLAGS) -c -o $@ $< $(BUILD_DIR)/%.o: %.cpp @echo "Compiling " $< - $(QUIET) $(CC) $(CFLAGS) $(FILE_UNIQUE_CFLAGS) -c -o $@ $< + $(QUIET) $(CC) -lang=c++ $(CXXFLAGS) $(FILE_UNIQUE_CFLAGS) -c -o $@ $< -- cgit v1.2.3-13-gbd6f