diff --git a/Makefile b/Makefile index 9082680c8c..5eaf4cf0bc 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ GAME_CODE := BPEE MAKER_CODE := 01 REVISION := 0 MODERN ?= 0 +KEEP_TEMPS ?= 0 # `File name`.gba ('_modern' will be appended to the modern builds) FILE_NAME := pokeemerald @@ -256,18 +257,18 @@ include audio_rules.mk generated: $(AUTO_GEN_TARGETS) -%.s: ; +%.s: ; %.png: ; %.pal: ; %.aif: ; -%.1bpp: %.png ; $(GFX) $< $@ -%.4bpp: %.png ; $(GFX) $< $@ -%.8bpp: %.png ; $(GFX) $< $@ -%.gbapal: %.pal ; $(GFX) $< $@ -%.gbapal: %.png ; $(GFX) $< $@ -%.lz: % ; $(GFX) $< $@ -%.rl: % ; $(GFX) $< $@ +%.1bpp: %.png ; $(GFX) $< $@ +%.4bpp: %.png ; $(GFX) $< $@ +%.8bpp: %.png ; $(GFX) $< $@ +%.gbapal: %.pal ; $(GFX) $< $@ +%.gbapal: %.png ; $(GFX) $< $@ +%.lz: % ; $(GFX) $< $@ +%.rl: % ; $(GFX) $< $@ # NOTE: Tools must have been built prior (FIXME) generated: tools $(AUTO_GEN_TARGETS) @@ -305,7 +306,7 @@ endef # $1: Output file without extension, $2 input file, $3 temp path (if keeping) define C_DEP_IMPL $1.o: $2 -ifeq (,$(KEEP_TEMPS)) +ifneq ($(KEEP_TEMPS),1) @echo "$$(CC1) -o $$@ $$<" @$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) -i $$< charmap.txt | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - else @@ -314,15 +315,11 @@ else @echo -e ".text\n\t.align\t2, 0\n" >> $3.s $$(AS) $$(ASFLAGS) -o $$@ $3.s endif -$(call C_SCANINC,$1,$2) -endef -# Calls SCANINC to find dependencies -define C_SCANINC -ifneq ($(NODEP),1) -$1.o: $1.d $1.d: $2 $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include $2 -include $1.d +ifneq ($(NODEP),1) +$1.o: $1.d +-include $1.d endif endef @@ -352,7 +349,7 @@ ifneq ($(NODEP),1) $1.o: $1.d $1.d: $2 $(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I "" $2 -include $1.d +-include $1.d endif endef diff --git a/tools/mapjson/json11.cpp b/tools/mapjson/json11.cpp index 1da530206b..3ac5f392a0 100644 --- a/tools/mapjson/json11.cpp +++ b/tools/mapjson/json11.cpp @@ -33,7 +33,6 @@ using std::vector; using std::map; using std::make_shared; using std::initializer_list; -using std::move; /* Helper for representing null - just a do-nothing struct, plus comparison * operators so the helpers in JsonValue work. We can't use nullptr_t because @@ -149,7 +148,7 @@ protected: // Constructors explicit Value(const T &value) : m_value(value) {} - explicit Value(T &&value) : m_value(move(value)) {} + explicit Value(T &&value) : m_value(std::move(value)) {} // Get type tag Json::Type type() const override { @@ -196,7 +195,7 @@ class JsonString final : public Value { const string &string_value() const override { return m_value; } public: explicit JsonString(const string &value) : Value(value) {} - explicit JsonString(string &&value) : Value(move(value)) {} + explicit JsonString(string &&value) : Value(std::move(value)) {} }; class JsonArray final : public Value { @@ -204,7 +203,7 @@ class JsonArray final : public Value { const Json & operator[](size_t i) const override; public: explicit JsonArray(const Json::array &value) : Value(value) {} - explicit JsonArray(Json::array &&value) : Value(move(value)) {} + explicit JsonArray(Json::array &&value) : Value(std::move(value)) {} }; class JsonObject final : public Value { @@ -212,7 +211,7 @@ class JsonObject final : public Value { const Json & operator[](const string &key) const override; public: explicit JsonObject(const Json::object &value) : Value(value) {} - explicit JsonObject(Json::object &&value) : Value(move(value)) {} + explicit JsonObject(Json::object &&value) : Value(std::move(value)) {} }; class JsonNull final : public Value { @@ -254,12 +253,12 @@ Json::Json(double value) : m_ptr(make_shared(value)) { Json::Json(int value) : m_ptr(make_shared(value)) {} Json::Json(bool value) : m_ptr(value ? statics().t : statics().f) {} Json::Json(const string &value) : m_ptr(make_shared(value)) {} -Json::Json(string &&value) : m_ptr(make_shared(move(value))) {} +Json::Json(string &&value) : m_ptr(make_shared(std::move(value))) {} Json::Json(const char * value) : m_ptr(make_shared(value)) {} Json::Json(const Json::array &values) : m_ptr(make_shared(values)) {} -Json::Json(Json::array &&values) : m_ptr(make_shared(move(values))) {} +Json::Json(Json::array &&values) : m_ptr(make_shared(std::move(values))) {} Json::Json(const Json::object &values) : m_ptr(make_shared(values)) {} -Json::Json(Json::object &&values) : m_ptr(make_shared(move(values))) {} +Json::Json(Json::object &&values) : m_ptr(make_shared(std::move(values))) {} /* * * * * * * * * * * * * * * * * * * * * Accessors @@ -357,7 +356,7 @@ struct JsonParser final { * Mark this parse as failed. */ Json fail(string &&msg) { - return fail(move(msg), Json()); + return fail(std::move(msg), Json()); } template diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index f5ee7ad6de..c1b7987a5a 100644 --- a/tools/scaninc/scaninc.cpp +++ b/tools/scaninc/scaninc.cpp @@ -125,7 +125,12 @@ int main(int argc, char **argv) if (!exists && (file.FileType() == SourceFileType::Asm || file.FileType() == SourceFileType::Inc)) { path = include; + if (CanOpenFile(path)) + exists = true; } + if (!exists) + continue; + dependencies_includes.insert(path); bool inserted = dependencies.insert(path).second; if (inserted && exists)