diff options
author | Christian Starkjohann <cs+github@obdev.at> | 2012-12-05 23:40:22 +0100 |
---|---|---|
committer | Christian Starkjohann <cs+github@obdev.at> | 2012-12-05 23:41:13 +0100 |
commit | f6bce71b0c73f626350006094591685bfc76ef6c (patch) | |
tree | 805d5997c86435c42fd4de195bc33fa84b0a2b6d /Makefile | |
parent | 71d680d052796a7b233405e6e84ad66cd5d147d3 (diff) | |
download | v-usb-f6bce71b0c73f626350006094591685bfc76ef6c.tar.gz v-usb-f6bce71b0c73f626350006094591685bfc76ef6c.tar.bz2 v-usb-f6bce71b0c73f626350006094591685bfc76ef6c.zip |
Removed top level make scripts with a Makefile.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2155fae --- /dev/null +++ b/Makefile @@ -0,0 +1,57 @@ +# Name: Makefile +# Project: v-usb +# Author: Christian Starkjohann +# Creation Date: 2012-12-05 +# Tabsize: 4 +# Copyright: (c) 2012 by OBJECTIVE DEVELOPMENT Software GmbH +# License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + +# This is the main Makefile. The two primary targets are "all", to build +# everything which can be built (except tests), and "clean" to remove all +# dependent files. In a repository clone, derived source files are generated +# and deleted as well. +# +# We distinguish between repository clones and source packages by the existence +# of make-files.sh scripts in various subdirectories. + + +all: + if [ ! -f examples/hid-mouse/firmware/Makefile ]; then \ + $(MAKE) files; \ + fi + $(MAKE) unix + if cross-make.sh --help >/dev/null 2>&1; then \ + $(MAKE) windows; \ + fi + +clean: + $(MAKE) unixclean + if cross-make.sh --help >/dev/null 2>&1; then \ + $(MAKE) windowsclean; \ + fi + $(MAKE) filesremove + + +unix unixclean: + target=$$(echo $@ | sed -e 's/unix//g'); \ + find . -mindepth 3 -name Makefile -print | while read i; do \ + dir=$$(dirname $$i); \ + dirname=$$(basename $$dir); \ + pushd $$dir >/dev/null; \ + if [ "$$dirname" = firmware -a -z "$$target" ]; then \ + if ! $(MAKE) hex; then break; fi; \ + else \ + if ! $(MAKE) $$target; then break; fi;\ + fi; \ + popd >/dev/null; \ + done + + +windows windowsclean: + target=$$(echo $@ | sed -e 's/windows//g'); \ + find . -mindepth 3 -name Makefile.windows -execdir cross-make.sh $$target \; + +files filesremove: + target=$$(echo $@ | sed -e 's/files//g'); \ + find . -mindepth 2 -name make-files.sh -execdir ./make-files.sh $$target \; + |