Review parser Makefile (#2765)
* parser: Fail gracefully if a nonexistent file is passed on the command line
Before, if a nonexistent file was passed to LoadFileText(), it would
return NULL, and the parser would happily dereference it.
* parser: Refactor Makefile and update the path to easings.h (now reasings.h)
Before, the `make all` target would simply segfault, see 0a679d79
Now, if a file in the `make all` target doesn't exist, make will write
an error.
Individual API files can be generated likeso, provided the header file
the target depends on exists:
FORMAT=JSON EXTENSION=json make raygui_api.json
In order for the `make all` target to succeed, raygui.h, physac.h and
rmem.h need to be added to the correct directory.
This commit is contained in:
parent
7e7939e1ad
commit
b8e14a4f99
2 changed files with 44 additions and 16 deletions
|
@ -207,6 +207,12 @@ int main(int argc, char* argv[])
|
|||
int length = 0;
|
||||
char *buffer = LoadFileText(inFileName, &length);
|
||||
|
||||
if (buffer == NULL)
|
||||
{
|
||||
printf("Could not read input file: %s\n", inFileName);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Preprocess buffer to get separate lines
|
||||
// NOTE: GetTextLines() also removes leading spaces/tabs
|
||||
int linesCount = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue