aboutsummaryrefslogtreecommitdiff
path: root/lib/vusb/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vusb/Makefile')
-rw-r--r--lib/vusb/Makefile60
1 files changed, 60 insertions, 0 deletions
diff --git a/lib/vusb/Makefile b/lib/vusb/Makefile
new file mode 100644
index 000000000..a6eb8a54b
--- /dev/null
+++ b/lib/vusb/Makefile
@@ -0,0 +1,60 @@
1# Name: Makefile
2# Project: v-usb
3# Author: Christian Starkjohann
4# Creation Date: 2012-12-05
5# Tabsize: 4
6# Copyright: (c) 2012 by OBJECTIVE DEVELOPMENT Software GmbH
7# License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
8
9# This is the main Makefile. The two primary targets are "all", to build
10# everything which can be built (except tests), and "clean" to remove all
11# dependent files. In a repository clone, derived source files are generated
12# and deleted as well.
13#
14# We distinguish between repository clones and source packages by the existence
15# of make-files.sh scripts in various subdirectories.
16
17
18all:
19 if [ ! -f examples/hid-mouse/firmware/Makefile ]; then \
20 $(MAKE) files; \
21 fi
22 if [ -n "$(uname -s | grep -i mingw)" ]; then \
23 $(MAKE) windows; \
24 else \
25 $(MAKE) unix; \
26 fi
27
28clean:
29 $(MAKE) unixclean
30 if cross-make.sh --help >/dev/null 2>&1; then \
31 $(MAKE) windowsclean; \
32 fi
33 $(MAKE) filesremove
34
35
36unix unixclean:
37 target=$$(echo $@ | sed -e 's/unix//g'); \
38 find . -mindepth 3 -name Makefile -print | while read i; do \
39 dir=$$(dirname $$i); \
40 dirname=$$(basename $$dir); \
41 pushd $$dir >/dev/null; \
42 if [ "$$dirname" = firmware -a -z "$$target" ]; then \
43 if ! $(MAKE) hex; then break; fi; \
44 else \
45 if ! $(MAKE) $$target; then break; fi;\
46 fi; \
47 popd >/dev/null; \
48 done
49
50
51windows windowsclean:
52 target=$$(echo $@ | sed -e 's/windows//g'); \
53 find . -mindepth 3 -name Makefile.windows -execdir cross-make.sh $$target \; ; \
54 if [ -z "$$target" ]; then target=hex; fi; \
55 find . -mindepth 2 -name firmware -exec sh -c "cd '{}'; $(MAKE) $$target" \;
56
57files filesremove:
58 target=$$(echo $@ | sed -e 's/files//g'); \
59 find . -mindepth 2 -name make-files.sh -execdir ./make-files.sh $$target \;
60