From cc9687d66a290563fac7fe537cd1b71508e2dfae Mon Sep 17 00:00:00 2001 From: Christian Starkjohann Date: Thu, 6 Dec 2012 11:07:18 +0100 Subject: Improved main Makefile to build for the host platform when no target specified. --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2155fae..a6eb8a5 100644 --- a/Makefile +++ b/Makefile @@ -19,9 +19,10 @@ all: if [ ! -f examples/hid-mouse/firmware/Makefile ]; then \ $(MAKE) files; \ fi - $(MAKE) unix - if cross-make.sh --help >/dev/null 2>&1; then \ + if [ -n "$(uname -s | grep -i mingw)" ]; then \ $(MAKE) windows; \ + else \ + $(MAKE) unix; \ fi clean: @@ -49,7 +50,9 @@ unix unixclean: windows windowsclean: target=$$(echo $@ | sed -e 's/windows//g'); \ - find . -mindepth 3 -name Makefile.windows -execdir cross-make.sh $$target \; + find . -mindepth 3 -name Makefile.windows -execdir cross-make.sh $$target \; ; \ + if [ -z "$$target" ]; then target=hex; fi; \ + find . -mindepth 2 -name firmware -exec sh -c "cd '{}'; $(MAKE) $$target" \; files filesremove: target=$$(echo $@ | sed -e 's/files//g'); \ -- cgit v1.2.3