diff --git a/.gitignore b/.gitignore index 15c8fcb..f4da1f3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ .DS_Store +/mingus +/mingusa + /bin /build /win32/vs2008ex/*/* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..99ac038 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +all: mingus mingusa + +clean: + rm -f mingus mingusa + +mingus: src/mingus/mingus.c + gcc -lviriatum -lviriatum_http src/mingus/mingus.c -o mingus + +mingusa: src/mingus_assembler/mingus_assembler.c + gcc -lviriatum -lviriatum_http src/mingus_assembler/mingus_assembler.c -o mingusa diff --git a/src/mingus/stdafx.h b/src/mingus/stdafx.h index c142a77..3e5c6fe 100644 --- a/src/mingus/stdafx.h +++ b/src/mingus/stdafx.h @@ -30,6 +30,5 @@ #include "targetver.h" #include -#include #include diff --git a/src/mingus_assembler/mingus_assembler.c b/src/mingus_assembler/mingus_assembler.c index a3ecfbe..6dfd1cd 100644 --- a/src/mingus_assembler/mingus_assembler.c +++ b/src/mingus_assembler/mingus_assembler.c @@ -359,6 +359,15 @@ ERROR_CODE run(char *file_path, char *output_path) { to be used as the output of the bytecode */ FILE *out; + /* in case the provided file path is not valid raises + and error indicating the problem */ + if(file_path == NULL) { + RAISE_ERROR_M( + RUNTIME_EXCEPTION_ERROR_CODE, + (unsigned char *) "No input file" + ); + } + /* counts the number of bytes in the asm file and then opens the asm file to be assembled in binary mode (required for parsing) */ @@ -366,7 +375,7 @@ ERROR_CODE run(char *file_path, char *output_path) { if(IS_ERROR_CODE(return_value)) { RAISE_ERROR_F( RUNTIME_EXCEPTION_ERROR_CODE, - (unsigned char *) "Problem couting file %s", + (unsigned char *) "Problem counting file %s", file_path ); } diff --git a/src/mingus_assembler/stdafx.h b/src/mingus_assembler/stdafx.h index ab91b7b..da69d2e 100644 --- a/src/mingus_assembler/stdafx.h +++ b/src/mingus_assembler/stdafx.h @@ -30,7 +30,6 @@ #include "targetver.h" #include -#include #include