aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Starkjohann <cs+github@obdev.at>2012-12-05 23:40:22 +0100
committerChristian Starkjohann <cs+github@obdev.at>2012-12-05 23:41:13 +0100
commitf6bce71b0c73f626350006094591685bfc76ef6c (patch)
tree805d5997c86435c42fd4de195bc33fa84b0a2b6d
parent71d680d052796a7b233405e6e84ad66cd5d147d3 (diff)
downloadv-usb-f6bce71b0c73f626350006094591685bfc76ef6c.tar.gz
v-usb-f6bce71b0c73f626350006094591685bfc76ef6c.tar.bz2
v-usb-f6bce71b0c73f626350006094591685bfc76ef6c.zip
Removed top level make scripts with a Makefile.
-rw-r--r--Makefile57
-rwxr-xr-xmake-all.sh24
-rwxr-xr-xmake-files.sh10
-rwxr-xr-xmkdist.sh4
-rw-r--r--v-usb.xcodeproj/project.pbxproj8
5 files changed, 61 insertions, 42 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 \;
+
diff --git a/make-all.sh b/make-all.sh
deleted file mode 100755
index f797060..0000000
--- a/make-all.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# Author: Christian Starkjohann
-# Creation Date: 2008-04-17
-# Tabsize: 4
-# Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
-# License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
-# This Revision: $Id$
-
-if [ "$2" = windows ]; then
- find . -mindepth 2 -name Makefile.windows -exec sh -c "cd \`dirname {}\`; cross-make.sh $1" \;
-else
- find . -mindepth 2 -name Makefile -print | while read i; do
- dir=`dirname $i`
- dirname=`basename $dir`
- (
- cd $dir
- if [ "$dirname" = "firmware" -a -z "$1" ]; then
- make hex
- else
- make $1
- fi
- )
- done
-fi
diff --git a/make-files.sh b/make-files.sh
deleted file mode 100755
index 4c75af1..0000000
--- a/make-files.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# Author: Christian Starkjohann
-# Creation Date: 2008-04-17
-# Tabsize: 4
-# Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
-# License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
-# This Revision: $Id$
-
-
-find . -mindepth 2 -name 'make-files.sh' -exec sh -c "cd \`dirname {}\`; ./make-files.sh \"$1\"" \;
diff --git a/mkdist.sh b/mkdist.sh
index adffd74..1a9eaad 100755
--- a/mkdist.sh
+++ b/mkdist.sh
@@ -125,7 +125,7 @@ rm /tmp/$tname.scr /tmp/$tname.sch
# Generate all derived files
#-------------------------------------------------------------------
-find . -mindepth 2 -name 'make-files.sh' -execdir ./make-files.sh \;
+make files
#-------------------------------------------------------------------
# Remove unnecessary files from distribution and create archive
@@ -133,7 +133,7 @@ find . -mindepth 2 -name 'make-files.sh' -execdir ./make-files.sh \;
rm -rf examples/drivertest v-usb.xcodeproj
find . -name 'make-files.sh' -exec rm '{}' \; # remove helper scripts
-rm -f mkdist.sh make-files.sh make-all.sh .gitignore
+rm -f mkdist.sh .gitignore
(
cd usbdrv
cp Changelog.txt License.txt CommercialLicense.txt USB-IDs-for-free.txt USB-ID-FAQ.txt ..
diff --git a/v-usb.xcodeproj/project.pbxproj b/v-usb.xcodeproj/project.pbxproj
index fa7ae65..e4fc3d9 100644
--- a/v-usb.xcodeproj/project.pbxproj
+++ b/v-usb.xcodeproj/project.pbxproj
@@ -41,7 +41,6 @@
40D2D15A0DAF6E2A00DC4278 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
40D2D15C0DAF6E2A00DC4278 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
40D2D1850DAF717600DC4278 /* requests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = requests.h; sourceTree = "<group>"; };
- 40D2D18C0DB0B3ED00DC4278 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
40D2D18D0DB0B3ED00DC4278 /* Makefile.windows */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Makefile.windows; sourceTree = "<group>"; };
40D2D1930DB0BE3900DC4278 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
40D2D1950DB0BE3900DC4278 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
@@ -62,11 +61,9 @@
40D2E2D30DB7B7F100DC4278 /* make-files.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "make-files.sh"; sourceTree = "<group>"; };
40D2E2D40DB7B80900DC4278 /* make-files.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "make-files.sh"; sourceTree = "<group>"; };
40D2E2D50DB7B83400DC4278 /* make-files.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "make-files.sh"; sourceTree = "<group>"; };
- 40D2E2E40DB7BA3600DC4278 /* make-files.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "make-files.sh"; sourceTree = "<group>"; };
40D2E32D0DB7C0E900DC4278 /* make-files.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "make-files.sh"; sourceTree = "<group>"; };
40D2E33A0DB7C2A700DC4278 /* opendevice.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = opendevice.c; sourceTree = "<group>"; };
40D2E33B0DB7C2A700DC4278 /* opendevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opendevice.h; sourceTree = "<group>"; };
- 40D2E3710DB7CCCF00DC4278 /* make-all.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "make-all.sh"; sourceTree = "<group>"; };
40D64A260EAA318F00FF5D92 /* osctune.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = osctune.h; sourceTree = "<group>"; };
40D64A2B0EAA41FB00FF5D92 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
40D64A2C0EAA41FB00FF5D92 /* requests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = requests.h; sourceTree = "<group>"; };
@@ -81,6 +78,7 @@
40D64A830EAA502A00FF5D92 /* osccal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = osccal.c; sourceTree = "<group>"; };
40D64A840EAA502A00FF5D92 /* osccal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = osccal.h; sourceTree = "<group>"; };
40D64B590EAA740400FF5D92 /* usbdrv */ = {isa = PBXFileReference; lastKnownFileType = folder; path = usbdrv; sourceTree = "<group>"; };
+ 40EB7F8E166F73E60099159E /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; usesTabs = 1; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
@@ -100,10 +98,9 @@
40D2CC570DA921F000DC4278 = {
isa = PBXGroup;
children = (
- 40D2E3710DB7CCCF00DC4278 /* make-all.sh */,
+ 40EB7F8E166F73E60099159E /* Makefile */,
40D2CC6D0DA9221D00DC4278 /* Readme.txt */,
40D2CC6C0DA9221D00DC4278 /* mkdist.sh */,
- 40D2E2E40DB7BA3600DC4278 /* make-files.sh */,
40D2E2320DB63ADA00DC4278 /* circuits */,
40D2D12F0DAE9F1E00DC4278 /* libs-device */,
40D2D1320DAE9F1E00DC4278 /* libs-host */,
@@ -225,7 +222,6 @@
isa = PBXGroup;
children = (
40D2E28D0DB782FE00DC4278 /* set-led.c */,
- 40D2D18C0DB0B3ED00DC4278 /* Makefile */,
40D2D18D0DB0B3ED00DC4278 /* Makefile.windows */,
);
path = commandline;