diff --git a/tools/bin2c/Makefile b/tools/bin2c/Makefile index 303f322..2e64db4 100644 --- a/tools/bin2c/Makefile +++ b/tools/bin2c/Makefile @@ -1,5 +1,9 @@ NATIVE_CC ?= gcc +ifeq (, $(shell which $(NATIVE_CC) 2>/dev/null)) +$(error "Native GCC is missing. Please install it first. If it's path is custom, set it with export NATIVE_CC=") +endif + .PHONY: all clean all: bin2c diff --git a/tools/lz/Makefile b/tools/lz/Makefile index 8ffabde..6a70564 100644 --- a/tools/lz/Makefile +++ b/tools/lz/Makefile @@ -1,5 +1,9 @@ NATIVE_CC ?= gcc +ifeq (, $(shell which $(NATIVE_CC) 2>/dev/null)) +$(error "Native GCC is missing. Please install it first. If it's path is custom, set it with export NATIVE_CC=") +endif + .PHONY: all clean all: lz77 diff --git a/tools/lz/lz77.c b/tools/lz/lz77.c index 812ae8d..9ab159d 100644 --- a/tools/lz/lz77.c +++ b/tools/lz/lz77.c @@ -33,7 +33,7 @@ int main(int argc, char *argv[]) if(stat(argv[1], &statbuf)) goto error; - if((in_file=fopen(argv[1], "r")) == NULL) + if((in_file=fopen(argv[1], "rb")) == NULL) goto error; strcpy(filename, argv[1]);