diff --git a/Makefile b/Makefile index a737086..f90c4e7 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,12 @@ # Copyright © 2019 Axel Svensson # License: See LICENSE +CC = i686-w64-mingw32-gcc + ifneq ($(shell echo $${OSTYPE}),cygwin) $(error Building only supported under Cygwin.) endif -ifeq (,$(shell which i686-w64-mingw32-gcc)) +ifeq (,$(shell which $(CC))) $(error mingw32 compiler not found. Install cygwin package mingw64-i686-gcc-core) endif @@ -22,10 +24,10 @@ release: listenkey.exe sendkey.exe *LICENSE *.py README.md echo === Finished building keyboa version $(VERSION) listenkey.exe: listenkey.c liblistenkey.h json-str.c common.h version.h - i686-w64-mingw32-gcc -o listenkey.exe listenkey.c + $(CC) -o listenkey.exe listenkey.c -sendkey.exe: sendkey.c libsendkey.h sendkey-json-parser.c json-str.c common.h version.h - i686-w64-mingw32-gcc -o sendkey.exe sendkey.c +sendkey.exe: sendkey.c libsendkey.h sendkey-json-parser.c json-str.c common.h version.h jsonsl.c jsonsl.h + $(CC) -o sendkey.exe sendkey.c version.h: echo '#define KEYBOAVERSION "'$(VERSION)'"' > version.h