|
From: falcovorbis <fal...@us...> - 2024-07-15 22:29:39
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 15115fbf34867109f2e73fb066d8eeee5d70320c (commit)
from dc3fa1718003934c9281b33355e124376e9de423 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 15115fbf34867109f2e73fb066d8eeee5d70320c
Author: Colton Pawielski <cep...@us...>
Date: Mon Jul 15 17:29:09 2024 -0500
Avoid returning error code when examples are too old for toolchain version (#631)
* Avoid returning error when examples are too old for toolchain version
* Add shared warning for GCC Version Check
-----------------------------------------------------------------------
Summary of changes:
Makefile.rules | 35 ++++++++++++------------
examples/dreamcast/basic/breaking/Makefile | 12 +++++++-
examples/dreamcast/basic/fpu/exc/Makefile | 10 ++++++-
examples/dreamcast/basic/stackprotector/Makefile | 10 +++++--
examples/dreamcast/cpp/concurrency/Makefile | 10 +++++--
5 files changed, 54 insertions(+), 23 deletions(-)
diff --git a/Makefile.rules b/Makefile.rules
index 487b9028..a62b1a5a 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -77,20 +77,21 @@ romdisk.o: romdisk.img
rm romdisk_tmp.c romdisk_tmp.o
endif
-# Define KOS_GCCVER_MIN in your Makefile if you want to enforce a minimum GCC version.
-ifdef KOS_GCCVER_MIN
- ifeq ($(shell \
- awk 'BEGIN { \
- split("$(KOS_GCCVER_MIN)", min, "."); \
- split("$(KOS_GCCVER)", cur, "."); \
- if (cur[1] > min[1] || \
- (cur[1] == min[1] && cur[2] > min[2]) || \
- (cur[1] == min[1] && cur[2] == min[2] && cur[3] >= min[3])) { \
- print 1; \
- } else { \
- print 0; \
- } \
- }'), 0)
- $(error A minimum GCC version of $(KOS_GCCVER_MIN) is required, but $(KOS_GCCVER) is currently in use.)
- endif
-endif
+define KOS_GCCVER_MIN_CHECK
+$(shell \
+ awk 'BEGIN { \
+ split("$(1)", min, "."); \
+ split("$(KOS_GCCVER)", cur, "."); \
+ if (cur[1] > min[1] || \
+ (cur[1] == min[1] && cur[2] > min[2]) || \
+ (cur[1] == min[1] && cur[2] == min[2] && cur[3] >= min[3])) { \
+ print 1; \
+ } else { \
+ print 0; \
+ } \
+ }')
+endef
+
+define KOS_GCCVER_MIN_WARNING
+@echo "Skipping $(TARGET) build as current GCC version ($(KOS_GCCVER)) is less than $(KOS_GCCVER_MIN)."
+endef
diff --git a/examples/dreamcast/basic/breaking/Makefile b/examples/dreamcast/basic/breaking/Makefile
index 362230d6..5d3f9a1c 100644
--- a/examples/dreamcast/basic/breaking/Makefile
+++ b/examples/dreamcast/basic/breaking/Makefile
@@ -9,10 +9,14 @@ OBJS = breaking.o
KOS_CFLAGS += -std=gnu2x -Wno-strict-aliasing
KOS_GCCVER_MIN = 13.0.0
-all: rm-elf $(TARGET)
+
include $(KOS_BASE)/Makefile.rules
+ifeq ($(call KOS_GCCVER_MIN_CHECK,$(KOS_GCCVER_MIN)),1)
+
+all: rm-elf $(TARGET)
+
clean: rm-elf
-rm -f $(OBJS)
@@ -28,3 +32,9 @@ run: $(TARGET)
dist: $(TARGET)
-rm -f $(OBJS)
$(KOS_STRIP) $(TARGET)
+
+else
+ all $(TARGET) clean rm-elf run dist:
+ $(KOS_GCCVER_MIN_WARNING)
+endif
+
diff --git a/examples/dreamcast/basic/fpu/exc/Makefile b/examples/dreamcast/basic/fpu/exc/Makefile
index f6bbb8e7..adc90725 100644
--- a/examples/dreamcast/basic/fpu/exc/Makefile
+++ b/examples/dreamcast/basic/fpu/exc/Makefile
@@ -8,10 +8,14 @@ TARGET = fpu_exc.elf
OBJS = fpu_exc.o
KOS_GCCVER_MIN = 5.0.0
-all: rm-elf $(TARGET)
+
include $(KOS_BASE)/Makefile.rules
+ifeq ($(call KOS_GCCVER_MIN_CHECK,$(KOS_GCCVER_MIN)),1)
+
+all: rm-elf $(TARGET)
+
clean: rm-elf
-rm -f $(OBJS)
@@ -28,3 +32,7 @@ dist: $(TARGET)
-rm -f $(OBJS)
$(KOS_STRIP) $(TARGET)
+else
+ all $(TARGET) clean rm-elf run dist:
+ $(KOS_GCCVER_MIN_WARNING)
+endif
diff --git a/examples/dreamcast/basic/stackprotector/Makefile b/examples/dreamcast/basic/stackprotector/Makefile
index a898d5d2..01f62b54 100644
--- a/examples/dreamcast/basic/stackprotector/Makefile
+++ b/examples/dreamcast/basic/stackprotector/Makefile
@@ -9,10 +9,12 @@ OBJS = stackprotector.o
KOS_CFLAGS += -fstack-protector-all
KOS_GCCVER_MIN = 4.0.0
-all: rm-elf $(TARGET)
-
include $(KOS_BASE)/Makefile.rules
+ifeq ($(call KOS_GCCVER_MIN_CHECK,$(KOS_GCCVER_MIN)),1)
+
+all: rm-elf $(TARGET)
+
clean: rm-elf
-rm -f $(OBJS)
@@ -29,6 +31,10 @@ dist: $(TARGET)
-rm -f $(OBJS)
$(KOS_STRIP) $(TARGET)
+else
+ all $(TARGET) clean rm-elf run dist:
+ $(KOS_GCCVER_MIN_WARNING)
+endif
.PHONY: run dist clean rm-elf
diff --git a/examples/dreamcast/cpp/concurrency/Makefile b/examples/dreamcast/cpp/concurrency/Makefile
index 16eac365..3ace6f9d 100644
--- a/examples/dreamcast/cpp/concurrency/Makefile
+++ b/examples/dreamcast/cpp/concurrency/Makefile
@@ -8,10 +8,12 @@ OBJS = concurrency.o
KOS_CPPFLAGS += -std=c++20
KOS_GCCVER_MIN = 12.0.0
-all: rm-elf $(TARGET)
-
include $(KOS_BASE)/Makefile.rules
+ifeq ($(call KOS_GCCVER_MIN_CHECK,$(KOS_GCCVER_MIN)),1)
+
+all: rm-elf $(TARGET)
+
clean:
-rm -f $(TARGET) $(OBJS)
@@ -28,3 +30,7 @@ dist:
rm -f $(OBJS)
$(KOS_STRIP) $(TARGET)
+else
+ all $(TARGET) clean rm-elf run dist:
+ $(KOS_GCCVER_MIN_WARNING)
+endif
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|