Skip to content

Commit ba8d71e

Browse files
committed
makefile: refactor and fix
1 parent 9df3c8d commit ba8d71e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Copyright © 2019 Axel Svensson <mail@axelsvensson.com>
22
# License: See LICENSE
33

4+
CC = i686-w64-mingw32-gcc
5+
46
ifneq ($(shell echo $${OSTYPE}),cygwin)
57
$(error Building only supported under Cygwin.)
68
endif
7-
ifeq (,$(shell which i686-w64-mingw32-gcc))
9+
ifeq (,$(shell which $(CC)))
810
$(error mingw32 compiler not found. Install cygwin package mingw64-i686-gcc-core)
911
endif
1012

@@ -22,10 +24,10 @@ release: listenkey.exe sendkey.exe *LICENSE *.py README.md
2224
echo === Finished building keyboa version $(VERSION)
2325

2426
listenkey.exe: listenkey.c liblistenkey.h json-str.c common.h version.h
25-
i686-w64-mingw32-gcc -o listenkey.exe listenkey.c
27+
$(CC) -o listenkey.exe listenkey.c
2628

27-
sendkey.exe: sendkey.c libsendkey.h sendkey-json-parser.c json-str.c common.h version.h
28-
i686-w64-mingw32-gcc -o sendkey.exe sendkey.c
29+
sendkey.exe: sendkey.c libsendkey.h sendkey-json-parser.c json-str.c common.h version.h jsonsl.c jsonsl.h
30+
$(CC) -o sendkey.exe sendkey.c
2931

3032
version.h:
3133
echo '#define KEYBOAVERSION "'$(VERSION)'"' > version.h

0 commit comments

Comments
 (0)