From 9ee4c23a467a15452d67804139abd68dc7c1d51a Mon Sep 17 00:00:00 2001 From: Garak Date: Sat, 11 Aug 2018 21:11:28 -0400 Subject: [PATCH 1/4] remove -j4 --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 0fa9af8e7..c5425204c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -64,4 +64,4 @@ cd ../pokeemerald ./build_tools.sh ``` -And build the ROM with `make -j4`. +And build the ROM with `make`. From 296a539664975b29f25a24958ec513a2ecd008c8 Mon Sep 17 00:00:00 2001 From: Garak Date: Sat, 11 Aug 2018 21:19:27 -0400 Subject: [PATCH 2/4] add faster builds and NODEP sections from pokeruby --- INSTALL.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index c5425204c..bb5e9849d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -65,3 +65,32 @@ cd ../pokeemerald ``` And build the ROM with `make`. + +# Faster builds + +After the first build, subsequent builds are faster. You can further speed up the build: + +## Parallel build + +This significantly speeds up the build on modern machines. + +By default `make` only runs a single thread. You can tell `make` to run on multiple threads with `make -j`. See the manfile for usage (`man make`). + +The optimal value for `-j` is the number of logical cores on your machine. You can run `nproc` to see the exact number. + +``` +$ nproc +8 +``` + +If you have 8 cores, run: `make -j8` + +`-j` on its own will spawn a new thread for each job. A clean build will have thousands of jobs, which will be slower than not using -j at all. + +## Disable the dependency scanning + +If you've only changed `.c` or `.s` files, you can turn off the dependency scanning temporarily. Changes to any other files will be ignored, and the build will either fail or not reflect those changes. + +`make NODEP=1` + + From 2cfc7bd358561aa88930a07e2a05d3c919c3beb3 Mon Sep 17 00:00:00 2001 From: Garak Date: Sat, 11 Aug 2018 21:21:43 -0400 Subject: [PATCH 3/4] change darwin check --- Makefile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 58a93bb55..38e8fd71e 100644 --- a/Makefile +++ b/Makefile @@ -31,14 +31,7 @@ LDFLAGS = -Map ../../$(MAP) LIB := -L ../../tools/agbcc/lib -lgcc -lc -ifeq ($(OS),Windows_NT) - SHA1 := sha1sum -c -else ifeq ($(shell uname -s),Darwin) - SHA1 := shasum -c -else - SHA1 := sha1sum -c -endif - +SHA1SUM := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c GFX := tools/gbagfx/gbagfx AIF := tools/aif2pcm/aif2pcm MID := $(abspath tools/mid2agb/mid2agb) From e0a9faacb58311b697cf704823f8279a077716f0 Mon Sep 17 00:00:00 2001 From: Garak Date: Sat, 11 Aug 2018 21:29:54 -0400 Subject: [PATCH 4/4] sha1sum -> sha1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 38e8fd71e..9637d98a8 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ LDFLAGS = -Map ../../$(MAP) LIB := -L ../../tools/agbcc/lib -lgcc -lc -SHA1SUM := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c +SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c GFX := tools/gbagfx/gbagfx AIF := tools/aif2pcm/aif2pcm MID := $(abspath tools/mid2agb/mid2agb)