Skip to content

Commit

Permalink
makefile: refactor and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
svenssonaxel committed May 12, 2019
1 parent 9df3c8d commit ba8d71e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Copyright © 2019 Axel Svensson <mail@axelsvensson.com>
# 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

Expand All @@ -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
Expand Down

0 comments on commit ba8d71e

Please sign in to comment.