Fix bug in calcrom

This commit is contained in:
PikalaxALT 2021-08-31 08:48:49 -04:00
parent 2406b19f9a
commit 4627e63760
3 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,8 @@
CXX := g++
CXXFLAGS := -g -O3 -std=c++11
ifeq ($(DEBUG),)
CXXFLAGS += -DNDEBUG
endif
ifeq ($(OS),Windows_NT)
EXE := .exe

View File

@ -122,11 +122,11 @@ void analyze(string& basedir, string& subdir, string& version = default_version)
// src asm
// data _____|_____
// text |
unsigned sizes[2][2] = {{0, 0}, {0, 0}};
unsigned sizes[2][2] = {{0, 0}, {0, 0x800 /* libsyscall.a */}};
string srcbase = basedir + (subdir.empty() ? "" : "/" + subdir);
string builddir = srcbase + "/build/" + version;
string pattern = srcbase + "/{src,asm,lib/{src,asm},lib/*/{src,asm},}/*.{c,s,cpp}";
string pattern = srcbase + "/{src,asm,lib/{src,asm},lib/{!syscall}/{src,asm}}/*.{c,s,cpp}";
for (char const * & fname : Glob(pattern))
{
string fname_s(fname);
@ -134,6 +134,9 @@ void analyze(string& basedir, string& subdir, string& version = default_version)
bool is_asm = ext == ".s";
fname_s = fname_s.replace(0, srcbase.size(), builddir);
fname_s = fname_s.replace(fname_s.rfind('.'), string::npos, ".o");
#ifndef NDEBUG
cerr << fname << " --> " << fname_s << endl;
#endif
Elf32File elf(fname_s);

View File

@ -32,7 +32,7 @@ tidy:
$(RM) -r $(BUILD_DIR)
$(RM) $(ROM)
clean: tidy clean-tools
clean: tidy clean-filesystem clean-tools
@$(MAKE) -C lib/syscall clean
@$(MAKE) -C sub clean