From 202cea9705e20f7aba242fa7863f2a79bd88925c Mon Sep 17 00:00:00 2001 From: Ben10do Date: Fri, 9 Jun 2017 21:55:09 +0100 Subject: - Make the tools implicitly when making the ROM - Add a clean target to the tools Makefile - Run said clean target when cleaning the pokecrystal directory --- Makefile | 5 +++-- tools/Makefile | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 27df84035..eb2e60148 100644 --- a/Makefile +++ b/Makefile @@ -29,11 +29,12 @@ crystal11_obj := $(crystal_obj:.o=11.o) roms := pokecrystal.gbc pokecrystal11.gbc all: crystal -crystal: pokecrystal.gbc -crystal11: pokecrystal11.gbc +crystal: tools pokecrystal.gbc +crystal11: tools pokecrystal11.gbc clean: rm -f $(roms) $(crystal_obj) $(crystal11_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym) + make clean -C tools/ compare: $(roms) @$(MD5) roms.md5 diff --git a/tools/Makefile b/tools/Makefile index 4a04027fc..66e9be8a5 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,13 +1,18 @@ -.PHONY: all +.PHONY: all clean -all: \ +tools := \ lzcomp \ png_dimensions \ scan_includes \ palette \ pokemon_animation \ pokemon_animation_graphics + +all: $(tools) @: +clean: + rm -f $(tools) + %: %.c $(CC) -o $@ $< -- cgit v1.2.3 From b34b1a5b0c5d5fb62029a596ef0446e68812fc67 Mon Sep 17 00:00:00 2001 From: Ben10do Date: Fri, 9 Jun 2017 22:06:07 +0100 Subject: Add .gitignore for compiled tools --- tools/.gitignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tools/.gitignore diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 000000000..e5db845cc --- /dev/null +++ b/tools/.gitignore @@ -0,0 +1,6 @@ +lzcomp +palette +png_dimensions +pokemon_animation +pokemon_animation_graphics +scan_includes -- cgit v1.2.3 From cf390243b24724311bb0c4ebedb3c0d493e54c9c Mon Sep 17 00:00:00 2001 From: Ben10do Date: Fri, 9 Jun 2017 22:09:38 +0100 Subject: =?UTF-8?q?Remove=20=E2=80=98make=20tools=E2=80=99=20step=20in=20i?= =?UTF-8?q?nstallation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This step is no longer required, as it will be run automatically when making the ROM. --- INSTALL.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 0d48f6daf..0eb37743d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -17,7 +17,6 @@ cd .. git clone https://github.com/pret/pokecrystal cd pokecrystal -make tools ``` To build **pokecrystal.gbc**: @@ -42,7 +41,6 @@ cd .. git clone https://github.com/pret/pokecrystal cd pokecrystal -make tools ``` To build **pokecrystal.gbc**: @@ -67,7 +65,6 @@ In the **Cygwin terminal**: git clone https://github.com/pret/pokecrystal cd pokecrystal -make tools ``` To build **pokecrystal.gbc**: -- cgit v1.2.3 From 848b3ba3ecbf110c168b4f37292bccdc6e3f2531 Mon Sep 17 00:00:00 2001 From: Ben10do Date: Fri, 9 Jun 2017 22:42:05 +0100 Subject: =?UTF-8?q?Fix=20warnings=20about=20assignments=20in=20=E2=80=98if?= =?UTF-8?q?=E2=80=99=20statements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assignments in ‘if’ statements cause a warning in Clang, asking you to enclose the assignment in brackets (to show that it was intentional). --- tools/lzcomp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lzcomp.c b/tools/lzcomp.c index 1b7b32a5d..c3fae1001 100644 --- a/tools/lzcomp.c +++ b/tools/lzcomp.c @@ -177,11 +177,11 @@ struct command find_best_copy (const unsigned char * data, unsigned short positi struct command simple = {.command = 7}; struct command flipped = simple, backwards = simple; short count, offset; - if (count = scan_forwards(data + position, length - position, data, position, &offset)) + if ((count = scan_forwards(data + position, length - position, data, position, &offset))) simple = (struct command) {.command = 4, .count = count, .value = offset}; - if (count = scan_forwards(data + position, length - position, bitflipped, position, &offset)) + if ((count = scan_forwards(data + position, length - position, bitflipped, position, &offset))) flipped = (struct command) {.command = 5, .count = count, .value = offset}; - if (count = scan_backwards(data, length - position, position, &offset)) + if ((count = scan_backwards(data, length - position, position, &offset))) backwards = (struct command) {.command = 6, .count = count, .value = offset}; struct command command; switch (flags / 24) { -- cgit v1.2.3 From fc300ab0ee63a1ecbcead67c3a7019a0bfe8deb5 Mon Sep 17 00:00:00 2001 From: Ben10do Date: Sat, 10 Jun 2017 18:21:38 +0100 Subject: Fix parallelisation issues in Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduces a minor hack, in order to ensure that the tools are built before the Makefile attempts to use any of the tools, even when using ‘make -j’. --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index eb2e60148..19ca8e15a 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,15 @@ crystal11_obj := $(crystal_obj:.o=11.o) roms := pokecrystal.gbc pokecrystal11.gbc all: crystal -crystal: tools pokecrystal.gbc -crystal11: tools pokecrystal11.gbc +crystal: pokecrystal.gbc +crystal11: pokecrystal11.gbc + +# Ensure that the tools are built when making the ROM +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(MAKECMDGOALS),tools) +Makefile: tools +endif +endif clean: rm -f $(roms) $(crystal_obj) $(crystal11_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym) -- cgit v1.2.3 From 121e9317507abb5ae08c144c0cd2b968d9882449 Mon Sep 17 00:00:00 2001 From: yenatch Date: Sat, 24 Jun 2017 20:46:11 -0400 Subject: Add tools/gfx and tools/md5 to gitignore --- tools/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/.gitignore b/tools/.gitignore index e5db845cc..6fc2134d5 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -1,4 +1,6 @@ +gfx lzcomp +md5 palette png_dimensions pokemon_animation -- cgit v1.2.3