From: Uwe Hermann Date: Wed, 14 Nov 2012 18:23:25 +0000 (+0100) Subject: Use standard autotools setup. X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-firmware.git;a=commitdiff_plain;h=b6efd7061d22b599a895a69c5b37e7c8623a2619 Use standard autotools setup. 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). --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb5dd8e --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +# 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 + diff --git a/Makefile b/Makefile deleted file mode 100644 index c5f5114..0000000 --- a/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -## -## This file is part of the sigrok project. -## -## Copyright (C) 2012 Uwe Hermann -## -## 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) - diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..3e9dec7 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,32 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2012 Uwe Hermann +## +## 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 + diff --git a/README b/README index d48c0d6..c974153 100644 --- a/README +++ b/README @@ -26,6 +26,8 @@ In order to get the sigrok-firmware source code and build it, run: $ git clone git://sigrok.org/sigrok-firmware $ cd sigrok-firmware + $ ./autogen.sh + $ ./configure $ make For installing sigrok-firmware: @@ -36,7 +38,7 @@ This will install the files into /usr/local/share/sigrok-firmware per default. 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: diff --git a/asix-sigma/Makefile.am b/asix-sigma/Makefile.am new file mode 100644 index 0000000..73f0893 --- /dev/null +++ b/asix-sigma/Makefile.am @@ -0,0 +1,28 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2012 Uwe Hermann +## +## 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 + diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..a910269 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,57 @@ +#!/bin/sh +## +## This file is part of the sigrok project. +## +## Copyright (C) 2012 Uwe Hermann +## +## 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 + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..ae466c9 --- /dev/null +++ b/configure.ac @@ -0,0 +1,45 @@ +## +## This file is part of the sigrok project. +## +## Copyright (C) 2012 Uwe Hermann +## +## 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 +