| @@ -1,4 +1,4 @@ | |||||
| Copyright (C) 2014-2015 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
| Copyright (C) 2014-2016 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
| Permission is hereby granted, free of charge, to any person obtaining a copy | Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
| of this software and associated documentation files (the "Software"), to deal | of this software and associated documentation files (the "Software"), to deal | ||||
| @@ -1,4 +1,4 @@ | |||||
| # Copyright (C) 2014-2015 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
| # Copyright (C) 2014-2016 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
| # Released under the terms of the MIT License. See LICENSE for details. | # Released under the terms of the MIT License. See LICENSE for details. | ||||
| PROGRAM = crater | PROGRAM = crater | ||||
| @@ -36,7 +36,7 @@ export CC | |||||
| export FLAGS | export FLAGS | ||||
| export RM | export RM | ||||
| .PHONY: all clean test-prereqs test tests $(TCPS) | |||||
| .PHONY: all clean test tests test-prereqs test-make-prereqs $(TCPS) | |||||
| all: $(BNRY) | all: $(BNRY) | ||||
| @@ -61,13 +61,16 @@ ASM_INST = $(SOURCES)/assembler/instructions | |||||
| $(ASM_INST).inc.c: $(ASM_INST).yml $(ASM_UP) | $(ASM_INST).inc.c: $(ASM_INST).yml $(ASM_UP) | ||||
| python $(ASM_UP) | python $(ASM_UP) | ||||
| test-prereqs: | |||||
| $(MAKE) $(PROGRAM) DEBUG= | |||||
| test-prereqs: $(PROGRAM) | |||||
| @: # No-op; prevents make from cluttering output with "X is up to date" | |||||
| test: test-prereqs | |||||
| $(MAKE) -C tests all | |||||
| test-make-prereqs: | |||||
| @$(MAKE) test-prereqs DEBUG= | |||||
| test: test-make-prereqs | |||||
| @$(MAKE) -C tests -s all | |||||
| tests: test | tests: test | ||||
| $(TCPS): test-prereqs | |||||
| $(MAKE) -C tests $(subst test-,,$@) | |||||
| $(TCPS): test-make-prereqs | |||||
| @$(MAKE) -C tests -s $(subst test-,,$@) | |||||
| @@ -98,8 +98,6 @@ static ASMErrorDesc parse_inst_##mnemonic( \ | |||||
| #define INST_INDEX_PREFIX(n) INST_PREFIX_(INST_INDEX(n).reg) | #define INST_INDEX_PREFIX(n) INST_PREFIX_(INST_INDEX(n).reg) | ||||
| /* ----------------------------- END WORK BLOCK ---------------------------- */ | |||||
| /* | /* | ||||
| Fill an instruction's byte array with the given data. | Fill an instruction's byte array with the given data. | ||||
| @@ -90,7 +90,7 @@ static int get_rom_paths(char ***path_ptr) | |||||
| } | } | ||||
| closedir(dirp); | closedir(dirp); | ||||
| } else { | } else { | ||||
| WARN_ERRNO("couldn't open 'roms/'") | |||||
| WARN_ERRNO("couldn't open '" ROMS_DIR "/'") | |||||
| } | } | ||||
| *path_ptr = paths; | *path_ptr = paths; | ||||
| return npaths; | return npaths; | ||||
| @@ -10,12 +10,13 @@ | |||||
| /* Internal usage only */ | /* Internal usage only */ | ||||
| #define LOG_MSG_(dest, level, extra, after, ...) { \ | |||||
| #define LOG_MSG_(dest, level, extra, after, ...) \ | |||||
| do { \ | |||||
| fprintf(dest, level ": " __VA_ARGS__); \ | fprintf(dest, level ": " __VA_ARGS__); \ | ||||
| extra; \ | extra; \ | ||||
| fprintf(dest, "\n"); \ | fprintf(dest, "\n"); \ | ||||
| after; \ | after; \ | ||||
| } | |||||
| } while (0); | |||||
| #define LOG_ERR_(...) LOG_MSG_(stderr, __VA_ARGS__) | #define LOG_ERR_(...) LOG_MSG_(stderr, __VA_ARGS__) | ||||
| #define LOG_OUT_(...) LOG_MSG_(stdout, __VA_ARGS__) | #define LOG_OUT_(...) LOG_MSG_(stdout, __VA_ARGS__) | ||||
| @@ -32,7 +32,7 @@ static void print_header(const uint8_t *header) | |||||
| snprintf(&header_chr[3 * i], 3, "%2c", header[i]); | snprintf(&header_chr[3 * i], 3, "%2c", header[i]); | ||||
| else { | else { | ||||
| header_chr[3 * i] = ' '; | header_chr[3 * i] = ' '; | ||||
| header_chr[3 * i + 1] = '?'; | |||||
| header_chr[3 * i + 1] = '.'; | |||||
| } | } | ||||
| header_hex[3 * i + 2] = header_chr[3 * i + 2] = ' '; | header_hex[3 * i + 2] = header_chr[3 * i + 2] = ' '; | ||||
| } | } | ||||
| @@ -1,4 +1,4 @@ | |||||
| /* Copyright (C) 2014-2015 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
| /* Copyright (C) 2014-2016 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
| Released under the terms of the MIT License. See LICENSE for details. */ | Released under the terms of the MIT License. See LICENSE for details. */ | ||||
| /* | /* | ||||