From: falcovorbis <fal...@us...> - 2024-10-08 07:26:47
|
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 dab8d5dbaed1e6820e6eb037fed87c6263351ed6 (commit) via 651612b9681a91ac823b64ae022fab115e804c0e (commit) via 0fa45d13b934fad0392e9841ec7850e813b863d2 (commit) from feec65c7081b946d143399aa71d4f1ce61a3fd94 (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 dab8d5dbaed1e6820e6eb037fed87c6263351ed6 Author: Paul Cercueil <pa...@cr...> Date: Tue Oct 8 09:26:10 2024 +0200 Speed up building KOS and examples (#573) * examples: Allow building all examples in parallel Instead of building all the examples sequentially in a single thread, build all of them in parallel. The Makefile will first generate a list of all the sub-folders that contain a Makefile, and all of them will be added to the list of phony rules. The default target will then depend on that sub-directory list, running Make recursively on each of those subdirectories, also using the special $(MAKE) variable so that the same jobserver is used. Because of that, all the Makefiles used only for recursion are useless now and can be dropped. On my PC (i7-10850H 12-core), when building with LTO running 'time make -j12 -C examples/dreamcast/' used to take about 8min 15s, and now takes about 1min 24s, while compiling more examples, as previously the gldc/ examples were not compiled. Signed-off-by: Paul Cercueil <pa...@cr...> * utils: Use top-level Makefile rules for subdirs Instead of rolling our own rules for handling the sub-directories, include the top-level Makefile.rules and add a dependency on the "subdirs" rule. This actually speeds up the build quite a bit, as the default rule uses $(MAKE) instead of $(KOS_MAKE), which means that the "make" program will be able to use its jobserver. Signed-off-by: Paul Cercueil <pa...@cr...> * addons: Allow building all addons in parallel Just like for the examples, generate the list of sub-directories using a Makefile rule; and build the sub-directories using the general "subdirs" rule, which will be much faster as the "make" program will be able to use its jobserver. Signed-off-by: Paul Cercueil <pa...@cr...> * Makefile: Allow building in parallel Build the sub-directories using the general "subdirs" rule, which will be much faster as the "make" program will be able to use its jobserver. Signed-off-by: Paul Cercueil <pa...@cr...> * examples: Allow examples to override the compatible KOS subarchs The examples can override KOS_BUILD_SUBARCHS in their Makefile, to override the list of compatible subarchs. Signed-off-by: Paul Cercueil <pa...@cr...> * examples: Override build subarchs for examples not Naomi-compatible Some examples are not compatible with the Naomi, because they try to use hardware that the Naomi does not have (e.g. the modem). For those examples, set KOS_BUILD_SUBARCHS to "pristine", so that they will only build for the "pristine" (aka. "dreamcast") sub-architecture. Signed-off-by: Paul Cercueil <pa...@cr...> --------- Signed-off-by: Paul Cercueil <pa...@cr...> commit 651612b9681a91ac823b64ae022fab115e804c0e Author: voxel-public <797...@us...> Date: Tue Oct 8 17:03:58 2024 +1000 Update mat_transform parameter description (#770) Correct description of mat_transform parameter from vecskip to stride, to ensure generated documentation is no longer misleading commit 0fa45d13b934fad0392e9841ec7850e813b863d2 Author: Donald Haase <qu...@ya...> Date: Tue Oct 8 01:04:10 2024 -0400 Adjust example for lack of 'valid' member of dev (#796) Co-authored-by: QuzarDC <qu...@co...> ----------------------------------------------------------------------- Summary of changes: Makefile | 17 +++-- Makefile.rules | 9 +++ addons/Makefile | 12 ++-- examples/Makefile | 41 ++++++++++-- examples/dreamcast/Makefile | 82 ------------------------ examples/dreamcast/basic/Makefile | 41 ------------ examples/dreamcast/basic/fpu/Makefile | 16 ----- examples/dreamcast/basic/mmu/Makefile | 19 ------ examples/dreamcast/basic/threading/Makefile | 38 ----------- examples/dreamcast/conio/Makefile | 25 -------- examples/dreamcast/cpp/Makefile | 31 --------- examples/dreamcast/dev/Makefile | 25 -------- examples/dreamcast/dreameye/Makefile | 18 ------ examples/dreamcast/filesystem/Makefile | 22 ------- examples/dreamcast/filesystem/sd/Makefile | 20 ------ examples/dreamcast/g1ata/Makefile | 14 ---- examples/dreamcast/g1ata/atatest/Makefile | 1 + examples/dreamcast/gldc/Makefile | 22 ------- examples/dreamcast/gldc/basic/Makefile | 27 -------- examples/dreamcast/gldc/benchmarks/Makefile | 21 ------ examples/dreamcast/gldc/nehe/Makefile | 25 -------- examples/dreamcast/keyboard/Makefile | 14 ---- examples/dreamcast/kgl/Makefile | 25 -------- examples/dreamcast/kgl/basic/Makefile | 27 -------- examples/dreamcast/kgl/benchmarks/Makefile | 21 ------ examples/dreamcast/kgl/demos/Makefile | 29 --------- examples/dreamcast/kgl/nehe/Makefile | 25 -------- examples/dreamcast/libdream/Makefile | 28 -------- examples/dreamcast/lightgun/Makefile | 13 ---- examples/dreamcast/lua/Makefile | 16 ----- examples/dreamcast/modem/Makefile | 15 ----- examples/dreamcast/modem/basic/Makefile | 2 + examples/dreamcast/modem/ppp/Makefile | 2 + examples/dreamcast/mruby/Makefile | 17 ----- examples/dreamcast/network/Makefile | 38 ----------- examples/dreamcast/network/basic/Makefile | 3 + examples/dreamcast/network/dns-client/Makefile | 3 + examples/dreamcast/network/httpd/Makefile | 3 + examples/dreamcast/network/isp-settings/Makefile | 1 + examples/dreamcast/network/ntp/Makefile | 3 + examples/dreamcast/network/ping/Makefile | 3 + examples/dreamcast/network/ping6/Makefile | 3 + examples/dreamcast/network/speedtest/Makefile | 1 + examples/dreamcast/network/udpecho6/Makefile | 3 + examples/dreamcast/objc/Makefile | 14 ---- examples/dreamcast/parallax/Makefile | 18 ------ examples/dreamcast/pvr/Makefile | 44 ------------- examples/dreamcast/pvr/yuv_converter/Makefile | 17 ----- examples/dreamcast/rumble/rumble.c | 6 +- examples/dreamcast/sdl/Makefile | 22 ------- examples/dreamcast/sound/Makefile | 31 --------- examples/dreamcast/sound/cdda/Makefile | 16 ----- examples/dreamcast/tsunami/Makefile | 22 ------- examples/dreamcast/video/Makefile | 26 -------- examples/dreamcast/vmu/Makefile | 23 ------- kernel/arch/dreamcast/include/dc/matrix.h | 4 +- utils/Makefile | 12 ++-- 57 files changed, 97 insertions(+), 979 deletions(-) delete mode 100644 examples/dreamcast/Makefile delete mode 100644 examples/dreamcast/basic/Makefile delete mode 100644 examples/dreamcast/basic/fpu/Makefile delete mode 100644 examples/dreamcast/basic/mmu/Makefile delete mode 100644 examples/dreamcast/basic/threading/Makefile delete mode 100644 examples/dreamcast/conio/Makefile delete mode 100644 examples/dreamcast/cpp/Makefile delete mode 100644 examples/dreamcast/dev/Makefile delete mode 100644 examples/dreamcast/dreameye/Makefile delete mode 100644 examples/dreamcast/filesystem/Makefile delete mode 100644 examples/dreamcast/filesystem/sd/Makefile delete mode 100644 examples/dreamcast/g1ata/Makefile delete mode 100644 examples/dreamcast/gldc/Makefile delete mode 100644 examples/dreamcast/gldc/basic/Makefile delete mode 100644 examples/dreamcast/gldc/benchmarks/Makefile delete mode 100644 examples/dreamcast/gldc/nehe/Makefile delete mode 100644 examples/dreamcast/keyboard/Makefile delete mode 100644 examples/dreamcast/kgl/Makefile delete mode 100644 examples/dreamcast/kgl/basic/Makefile delete mode 100644 examples/dreamcast/kgl/benchmarks/Makefile delete mode 100644 examples/dreamcast/kgl/demos/Makefile delete mode 100644 examples/dreamcast/kgl/nehe/Makefile delete mode 100644 examples/dreamcast/libdream/Makefile delete mode 100644 examples/dreamcast/lightgun/Makefile delete mode 100644 examples/dreamcast/lua/Makefile delete mode 100644 examples/dreamcast/modem/Makefile delete mode 100644 examples/dreamcast/mruby/Makefile delete mode 100644 examples/dreamcast/network/Makefile delete mode 100644 examples/dreamcast/objc/Makefile delete mode 100644 examples/dreamcast/parallax/Makefile delete mode 100644 examples/dreamcast/pvr/Makefile delete mode 100644 examples/dreamcast/pvr/yuv_converter/Makefile delete mode 100644 examples/dreamcast/sdl/Makefile delete mode 100644 examples/dreamcast/sound/Makefile delete mode 100644 examples/dreamcast/sound/cdda/Makefile delete mode 100644 examples/dreamcast/tsunami/Makefile delete mode 100644 examples/dreamcast/video/Makefile delete mode 100644 examples/dreamcast/vmu/Makefile diff --git a/Makefile b/Makefile index 584de843..adb02749 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,8 @@ # here too. ;-) KOS_CFLAGS += -Wextra -Wno-deprecated -# Add stuff to DIRS to auto-compile it with the big tree. -DIRS = utils -DIRS += kernel addons # examples +# Add stuff to SUBDIRS to auto-compile it with the big tree. +SUBDIRS = utils kernel addons # examples # Detect a non-working or missing environ.sh file. ifndef KOS_BASE @@ -24,11 +23,9 @@ error: @exit 0 endif -all: - for i in $(DIRS); do $(KOS_MAKE) -C $$i || exit -1; done +all: subdirs -clean: - for i in $(DIRS); do $(KOS_MAKE) -C $$i clean || exit -1; done +clean: clean_subdirs distclean: clean -rm -f lib/$(KOS_ARCH)/* @@ -53,7 +50,9 @@ kos-ports_distclean: kos-ports_clean $(KOS_PORTS)/utils/uninstall-all.sh all_auto_kos_base: - $(KOS_MAKE) all KOS_BASE=$(CURDIR) + $(MAKE) all KOS_BASE=$(CURDIR) clean_auto_kos_base: - $(KOS_MAKE) clean KOS_BASE=$(CURDIR) + $(MAKE) clean KOS_BASE=$(CURDIR) + +include $(KOS_BASE)/Makefile.rules diff --git a/Makefile.rules b/Makefile.rules index bcd35e88..678c882a 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -7,6 +7,9 @@ # Global KallistiOS Makefile include +# Default build archs +KOS_BUILD_SUBARCHS ?= naomi pristine + # Build rules ifndef KOS_DEPDIR @@ -46,6 +49,12 @@ else endif +.PHONY: all_naomi all_pristine + +all_naomi: $(if $(filter $(KOS_BUILD_SUBARCHS),naomi),all) + +all_pristine: $(if $(filter $(KOS_BUILD_SUBARCHS),pristine),all) + %.o: %.s kos-as $< -o $@ diff --git a/addons/Makefile b/addons/Makefile index ff1ac628..5534cc54 100644 --- a/addons/Makefile +++ b/addons/Makefile @@ -23,10 +23,12 @@ # Get our list of dirs to build/clean. You must have sed installed for this # to work (GNU textutils). -BUILD_LIST := `ls */kos/$(KOS_ARCH).cnf | sed -e "s%/kos/$(KOS_ARCH).cnf%%g"` +get_subdirs=$(foreach each,$(wildcard $(1)/*),$(if $(wildcard $(each)/kos/$(KOS_ARCH).cnf),$(each),) $(call get_subdirs,$(each))) -all: - for i in $(BUILD_LIST); do $(KOS_MAKE) -C $$i || exit -1; done +SUBDIRS := $(call get_subdirs, $(shell pwd)) -clean: - for i in $(BUILD_LIST); do $(KOS_MAKE) -C $$i clean || exit -1; done +all: subdirs + +clean: clean_subdirs + +include $(KOS_BASE)/Makefile.rules diff --git a/examples/Makefile b/examples/Makefile index 4dbfc468..b64be788 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,13 +1,42 @@ # KallistiOS ##version## # -# examples/Makefile -# (c)2001 Megan Potter +# examples/dreamcast/Makefile +# Copyright (C) 2003 Megan Potter +# Copyright (C) 2024 Andy Barajas +# Copyright (C) 2024 Paul Cercueil # -all: - $(KOS_MAKE) -C $(KOS_ARCH) +# Get a list of the sub-directories that contain a Makefile +get_subdirs=$(foreach each,$(wildcard $(1)/*),$(if $(wildcard $(each)/Makefile),$(each),) $(call get_subdirs,$(each))) + +DIRS := $(call get_subdirs, $(shell pwd)) + +.PHONY: all $(DIRS) + +all: $(DIRS) + @error_count=$$(cat error_count.txt 2>/dev/null || echo 0); \ + if [ -f errors.txt ]; then \ + echo "\n-------------------------------------------------"; \ + echo "$$error_count error(s) occurred during the build process:"; \ + cat errors.txt; \ + fi; \ + rm -f errors.txt error_count.txt; \ + exit $$error_count + +$(DIRS): + @$(MAKE) -C $@ all_$(KOS_SUBARCH) ; \ + rv=$$? ; \ + if [ "$$rv" -ne 0 ]; then \ + echo "$(subst $(shell pwd)/,,$@): Build failed with return code $$rv" >> errors.txt; \ + echo $$(($$(cat error_count.txt 2>/dev/null || echo 0) + 1)) > error_count.txt; \ + fi clean: - $(KOS_MAKE) -C $(KOS_ARCH) clean - + @for dir in $(DIRS); do \ + $(MAKE) -C $$dir clean; \ + done +dist: + @for dir in $(DIRS); do \ + $(MAKE) -C $$dir dist; \ + done diff --git a/examples/dreamcast/Makefile b/examples/dreamcast/Makefile deleted file mode 100644 index fb58d7e8..00000000 --- a/examples/dreamcast/Makefile +++ /dev/null @@ -1,82 +0,0 @@ -# KallistiOS ##version## -# -# examples/dreamcast/Makefile -# Copyright (C) 2003 Megan Potter -# Copyright (C) 2024 Andy Barajas -# - -DIRS = 2ndmix basic libdream kgl hello sound png vmu conio pvr video \ - lua parallax dreameye filesystem lightgun keyboard sdl dev rumble \ - micropython - -ifneq ($(KOS_SUBARCH), naomi) - DIRS += network modem g1ata -endif - -ifdef KOS_CCPLUS - DIRS += cpp tsunami -endif - -.PHONY: all - -all: - @for dir in $(DIRS); do \ - $(KOS_MAKE) check-dir DIR=$$dir; \ - done; - - @error_count=$$(cat error_count.txt 2>/dev/null || echo 0); \ - if [ -f errors.txt ]; then \ - echo "\n-------------------------------------------------"; \ - echo "$$error_count error(s) occurred during the build process:"; \ - cat errors.txt; \ - fi; \ - rm -f errors.txt error_count.txt; \ - exit $$error_count - -# ALGORITHM EXPLANATION: -# This script recursively checks each directory to determine if it should -# execute its Makefile based on the presence of Makefiles in its subdirectories. -# -# Steps: -# 1. For each directory, identify all direct subdirectories. -# 2. Check each subdirectory for the existence of a Makefile. -# 3. If any subdirectory contains a Makefile, recursively perform this check on -# that subdirectory and do not execute the Makefile in the current directory. -# 4. If no subdirectories contain a Makefile, execute the Makefile in the -# current directory. -# -# Purpose: -# - This approach ensures that Makefiles are only executed in the most specific -# (deepest) directories that do not contain further subdirectories with -# Makefiles. -# - This prevents redundant builds in parent directories and ensures errors are -# logged with specific directory paths, providing clear visibility into which -# particular build process failed without aggregating errors at a higher -# directory level. -check-dir: - @should_make="yes"; \ - for subdir in $(DIR)/*; do \ - if [ -e "$$subdir/Makefile" ]; then \ - should_make="no"; \ - $(KOS_MAKE) check-dir DIR=$$subdir; \ - fi; \ - done; \ - if [ "$$should_make" = "yes" ]; then \ - $(KOS_MAKE) -C $(DIR); \ - rv=$$?; \ - if [ "$$rv" -ne 0 ]; then \ - echo "$(DIR): Build failed with return code $$rv" >> errors.txt; \ - echo $$(($$(cat error_count.txt 2>/dev/null || echo 0) + 1)) > error_count.txt; \ - fi; \ - fi; - -clean: - @for dir in $(DIRS); do \ - $(KOS_MAKE) -C $$dir clean; \ - done - -dist: - @for dir in $(DIRS); do \ - $(KOS_MAKE) -C $$dir dist; \ - done - diff --git a/examples/dreamcast/basic/Makefile b/examples/dreamcast/basic/Makefile deleted file mode 100644 index 8c9132b7..00000000 --- a/examples/dreamcast/basic/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# KallistiOS ##version## -# -# examples/dreamcast/basic/Makefile -# Copyright (C) 2002 Megan Potter -# - -all: - $(KOS_MAKE) -C exec - $(KOS_MAKE) -C threading - $(KOS_MAKE) -C fpu - $(KOS_MAKE) -C asserthnd - $(KOS_MAKE) -C stacktrace - $(KOS_MAKE) -C mmu - $(KOS_MAKE) -C stackprotector - $(KOS_MAKE) -C memtest32 - $(KOS_MAKE) -C watchdog - $(KOS_MAKE) -C breaking - -clean: - $(KOS_MAKE) -C exec clean - $(KOS_MAKE) -C threading clean - $(KOS_MAKE) -C fpu clean - $(KOS_MAKE) -C asserthnd clean - $(KOS_MAKE) -C stacktrace clean - $(KOS_MAKE) -C mmu clean - $(KOS_MAKE) -C stackprotector clean - $(KOS_MAKE) -C memtest32 clean - $(KOS_MAKE) -C watchdog clean - $(KOS_MAKE) -C breaking clean - -dist: - $(KOS_MAKE) -C exec dist - $(KOS_MAKE) -C threading dist - $(KOS_MAKE) -C fpu dist - $(KOS_MAKE) -C asserthnd dist - $(KOS_MAKE) -C stacktrace dist - $(KOS_MAKE) -C mmu dist - $(KOS_MAKE) -C stackprotector dist - $(KOS_MAKE) -C memtest32 dist - $(KOS_MAKE) -C watchdog dist - $(KOS_MAKE) -C breaking dist diff --git a/examples/dreamcast/basic/fpu/Makefile b/examples/dreamcast/basic/fpu/Makefile deleted file mode 100644 index 4d0c7ee5..00000000 --- a/examples/dreamcast/basic/fpu/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# KallistiOS ##version## -# -# examples/dreamcast/basic/fpu/Makefile -# (c)2002 Megan Potter -# - -all: - $(KOS_MAKE) -C exc - -clean: - $(KOS_MAKE) -C exc clean - -dist: - $(KOS_MAKE) -C exc dist - - diff --git a/examples/dreamcast/basic/mmu/Makefile b/examples/dreamcast/basic/mmu/Makefile deleted file mode 100644 index 6479f3ae..00000000 --- a/examples/dreamcast/basic/mmu/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# KallistiOS ##version## -# -# examples/dreamcast/basic/mmu/Makefile -# (c)2002 Megan Potter -# - -all: - $(KOS_MAKE) -C pvrmap - $(KOS_MAKE) -C nullptr - -clean: - $(KOS_MAKE) -C pvrmap clean - $(KOS_MAKE) -C nullptr clean - -dist: - $(KOS_MAKE) -C pvrmap dist - $(KOS_MAKE) -C nullptr dist - - diff --git a/examples/dreamcast/basic/threading/Makefile b/examples/dreamcast/basic/threading/Makefile deleted file mode 100644 index ba062f4b..00000000 --- a/examples/dreamcast/basic/threading/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# KallistiOS ##version## -# -# examples/dreamcast/basic/threading/Makefile -# Copyright (C) 2002 Megan Potter -# - -all: - $(KOS_MAKE) -C compiler_tls - $(KOS_MAKE) -C general - $(KOS_MAKE) -C rwsem - $(KOS_MAKE) -C recursive_lock - $(KOS_MAKE) -C once - $(KOS_MAKE) -C tls - $(KOS_MAKE) -C spinlock_test - $(KOS_MAKE) -C atomics - $(KOS_MAKE) -C reentrant_mutex - -clean: - $(KOS_MAKE) -C compiler_tls clean - $(KOS_MAKE) -C general clean - $(KOS_MAKE) -C rwsem clean - $(KOS_MAKE) -C recursive_lock clean - $(KOS_MAKE) -C once clean - $(KOS_MAKE) -C tls clean - $(KOS_MAKE) -C spinlock_test clean - $(KOS_MAKE) -C atomics clean - $(KOS_MAKE) -C reentrant_mutex clean - -dist: - $(KOS_MAKE) -C compiler_tls dist - $(KOS_MAKE) -C general dist - $(KOS_MAKE) -C rwsem dist - $(KOS_MAKE) -C recursive_lock dist - $(KOS_MAKE) -C once dist - $(KOS_MAKE) -C tls dist - $(KOS_MAKE) -C spinlock_test dist - $(KOS_MAKE) -C atomics dist - $(KOS_MAKE) -C reentrant_mutex dist diff --git a/examples/dreamcast/conio/Makefile b/examples/dreamcast/conio/Makefile deleted file mode 100644 index f650a903..00000000 --- a/examples/dreamcast/conio/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# KallistiOS ##version## -# -# examples/dreamcast/conio/Makefile -# (c)2002 Megan Potter -# - -all: - $(KOS_MAKE) -C basic - $(KOS_MAKE) -C wump - $(KOS_MAKE) -C adventure - $(KOS_MAKE) -C kosh - -clean: - $(KOS_MAKE) -C basic clean - $(KOS_MAKE) -C wump clean - $(KOS_MAKE) -C adventure clean - $(KOS_MAKE) -C kosh clean - -dist: - $(KOS_MAKE) -C basic dist - $(KOS_MAKE) -C wump dist - $(KOS_MAKE) -C adventure dist - $(KOS_MAKE) -C kosh dist - - diff --git a/examples/dreamcast/cpp/Makefile b/examples/dreamcast/cpp/Makefile deleted file mode 100644 index 135a4275..00000000 --- a/examples/dreamcast/cpp/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -# KallistiOS ##version## -# -# examples/dreamcast/cpp/Makefile -# Copyright (C) 2001-2002 Megan Potter -# - -all: - $(KOS_MAKE) -C gltest ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |