Use a standard autotools build system instead of hand-crafted Makefiles.
This makes sigrok-firmware consistent with the other sigrok subprojects,
makes it more portable, and gives us all the usual autotools mechanism
for free (make install, uninstall, dist, --prefix, and so on).
--- /dev/null
+# autotools cruft
+aclocal.m4
+autom4te.cache/
+config.h
+config.h.in
+config.log
+config.status
+configure
+stamp-h1
+autostuff/
+ChangeLog
+
+# recursive autoconf leftovers
+Makefile
+Makefile.in
+
+++ /dev/null
-##
-## This file is part of the sigrok project.
-##
-## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
-##
-## This program is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or
-## (at your option) any later version.
-##
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-##
-
-VERSION = "0.1.0"
-
-DESTDIR ?= /usr/local/share/sigrok-firmware
-
-TARBALLDIR = sigrok-firmware-$(VERSION)
-
-all:
- @echo "Valid Makefile targets: ChangeLog, dist, install."
-
-ChangeLog:
- @git log > ChangeLog || touch ChangeLog
-
-dist: ChangeLog
- @mkdir $(TARBALLDIR)
- @cp -r Makefile README NEWS asix-sigma $(TARBALLDIR)
- @tar -c -z -f $(TARBALLDIR).tar.gz $(TARBALLDIR)
- @rm -rf $(TARBALLDIR)
- @rm -f ChangeLog
-
-install:
- @mkdir -p $(DESTDIR)
- @cp */*.fw $(DESTDIR)
-
--- /dev/null
+##
+## This file is part of the sigrok project.
+##
+## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##
+
+ACLOCAL_AMFLAGS = -I autostuff
+
+SUBDIRS = asix-sigma
+
+MAINTAINERCLEANFILES = ChangeLog
+
+.PHONY: ChangeLog
+ChangeLog:
+ git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog
+
+dist-hook: ChangeLog
+
$ git clone git://sigrok.org/sigrok-firmware
$ cd sigrok-firmware
+ $ ./autogen.sh
+ $ ./configure
$ make
For installing sigrok-firmware:
You can override the install directory like this:
- $ make DESTDIR=/tmp/foo install
+ $ ./configure --prefix=/usr
Please see the following wiki pages for more detailed instructions:
--- /dev/null
+##
+## This file is part of the sigrok project.
+##
+## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##
+
+dist_pkgdata_DATA = \
+ asix-sigma-100.fw \
+ asix-sigma-200.fw \
+ asix-sigma-50.fw \
+ asix-sigma-50sync.fw
+
+EXTRA_DIST = LICENSE.Sigma
+
--- /dev/null
+#!/bin/sh
+##
+## This file is part of the sigrok project.
+##
+## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##
+
+OS=`uname`
+
+ACLOCAL_DIR=
+
+if [ "x$OS" = "xDarwin" ]; then
+ if [ -d /sw/share/aclocal ]; then
+ # fink installs aclocal macros here
+ ACLOCAL_DIR="-I /sw/share/aclocal"
+ elif [ -d /opt/local/share/aclocal ]; then
+ # Macports installs aclocal macros here
+ ACLOCAL_DIR="-I /opt/local/share/aclocal"
+ elif [ -d /usr/local/share/aclocal ]; then
+ # Homebrew installs aclocal macros here
+ ACLOCAL_DIR="-I /usr/local/share/aclocal"
+ elif [ -d /usr/share/aclocal ]; then
+ # Xcode installs aclocal macros here
+ ACLOCAL_DIR="-I /usr/share/aclocal"
+ fi
+elif [ "x$OS" = "xMINGW32_NT-5.1" ]; then
+ # Windows XP
+ ACLOCAL_DIR="-I /usr/local/share/aclocal"
+elif [ "x$OS" = "xMINGW32_NT-6.0" ]; then
+ # Windows Vista
+ ACLOCAL_DIR="-I /usr/local/share/aclocal"
+elif [ "x$OS" = "xMINGW32_NT-6.1" ]; then
+ # Windows 7
+ ACLOCAL_DIR="-I /usr/local/share/aclocal"
+fi
+
+echo "Generating build system..."
+mkdir autostuff
+aclocal ${ACLOCAL_DIR} || exit 1
+autoheader || exit 1
+automake --add-missing --copy --foreign || exit 1
+autoconf || exit 1
+
--- /dev/null
+##
+## This file is part of the sigrok project.
+##
+## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##
+
+# We require at least autoconf 2.63 (AC_INIT format changed there).
+AC_PREREQ([2.63])
+
+AC_INIT([sigrok-firmware], [0.1.0], [sigrok-devel@lists.sourceforge.net],
+ [sigrok-firmware], [http://www.sigrok.org])
+AC_CONFIG_HEADER([config.h])
+AC_CONFIG_MACRO_DIR([autostuff])
+AC_CONFIG_AUX_DIR([autostuff])
+
+# We require at least automake 1.11 (needed for 'silent rules').
+AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign std-options])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+AC_PROG_INSTALL
+AC_PROG_LN_S
+
+AC_SUBST(FIRMWARE_DIR, "$datadir/sigrok-firmware")
+AC_SUBST(MAKEFLAGS, '--no-print-directory')
+
+AC_CONFIG_FILES([Makefile
+ asix-sigma/Makefile
+ ])
+
+AC_OUTPUT
+