summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2023-02-01 18:54:04 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2023-02-01 18:54:04 -0400
commit4d4a76140f9194fd1a6f0a2d40d467094c5f28e8 (patch)
tree9c1c79aaebe84f7caa457f58f862338a8189cfd4
parentb76cd375d2536bb3e0d4ea807c1137f9c6ccda37 (diff)
make: Create `CFLAGS_BASE`, and make seperate `FLAGS` for c, and c++
-rw-r--r--Makefile11
1 files changed, 7 insertions, 4 deletions
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 $@ $<