From: Dave Murphy Date: Sat, 28 Apr 2012 01:13:58 +0000 (+0100) Subject: autoconfiscate X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=087a3596c3f22599867411fafb79fdfb3f48097c;p=fw%2Fstlink autoconfiscate --- diff --git a/.gitignore b/.gitignore index bc2ba52..c04ecfc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,23 @@ -nbproject -.project +COPYING +INSTALL +Makefile.in +aclocal.m4 +autom4te.cache +config.guess +config.sub +configure +depcomp +install-sh +ltmain.sh +missing +*.bz2 +*.lo *.o -*.elf -doc/tutorial/*.log -doc/tutorial/*.aux -libstlink.a -test_usb -test_sg -gdbserver/st-util -flash/flash -*.log -example/*/*.bin -example/*/*.elf -example/*/*/*.bin -example/*/*/*/*.bin -example/*/*/*.a -example/*/*/*/*.a +.libs +libtool +*.la +config.log +config.status +compile +st-flash +st-util diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Makefile b/Makefile deleted file mode 100644 index 4bb0608..0000000 --- a/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -# make ... for both stlink v1 and stlink v2 support -## -VPATH=src - -SOURCES_LIB=stlink-common.c stlink-usb.c stlink-sg.c uglylogging.c -OBJS_LIB=$(SOURCES_LIB:.c=.o) -TEST_PROGRAMS=test_usb test_sg -LDFLAGS=-L. -lstlink - -# libusb location -LDFLAGS+=`pkg-config --libs libusb-1.0` -CFLAGS+=`pkg-config --cflags libusb-1.0` - -CFLAGS+=-g -CFLAGS+=-DDEBUG=1 -CFLAGS+=-std=gnu99 -CFLAGS+=-Wall -Wextra - - -LIBRARY=libstlink.a - -all: $(LIBRARY) flash gdbserver $(TEST_PROGRAMS) - -$(LIBRARY): $(OBJS_LIB) - @echo "objs are $(OBJS_LIB)" - $(AR) -cr $@ $^ - @echo "done making library" - - -test_sg: test_sg.o $(LIBRARY) - @echo "building test_sg" - $(CC) test_sg.o $(LDFLAGS) -o $@ - -test_usb: test_usb.o $(LIBRARY) - @echo "building test_usb" - $(CC) test_usb.o $(LDFLAGS) -o $@ - @echo "done linking" - -%.o: %.c - @echo "building $^ into $@" - $(CC) $(CFLAGS) -c $^ -o $@ - @echo "done compiling" - -clean: - rm -rf $(OBJS_LIB) - rm -rf $(LIBRARY) - rm -rf test_usb* - rm -rf test_sg* - $(MAKE) -C flash clean - $(MAKE) -C gdbserver clean - -flash: - $(MAKE) -C flash - -gdbserver: - $(MAKE) -C gdbserver CONFIG_USE_LIBSG="$(CONFIG_USE_LIBSG)" - -.PHONY: clean all flash gdbserver diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..9aeec4a --- /dev/null +++ b/Makefile.am @@ -0,0 +1,20 @@ +# Makefile.am -- Process this file with automake to produce Makefile.in +bin_PROGRAMS = st-flash st-util + +noinst_LTLIBRARIES = libstlink.la + +st_flash_SOURCES = flash/main.c +st_util_SOURCES = gdbserver/gdb-remote.c gdbserver/gdb-remote.h gdbserver/gdb-server.c + +libstlink_la_SOURCES = src/stlink-common.c src/stlink-usb.c src/stlink-sg.c src/uglylogging.c \ + src/stlink-common.h src/stlink-usb.h src/stlink-sg.h src/uglylogging.h + +libstlink_la_CPPFLAGS = -std=gnu99 -Wall -Wextra -O2 + +st_flash_LDADD = libstlink.la +st_flash_CPPFLAGS = -std=gnu99 -Wall -Wextra -O2 -I$(top_srcdir)/src + +st_util_LDADD = libstlink.la +st_util_CPPFLAGS = -std=gnu99 -Wall -Wextra -O2 -I$(top_srcdir)/src + +EXTRA_DIST = autogen.sh diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..3a76a11 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,11 @@ +#!/bin/sh +if test ! "x$(which libtoolize)" = "x"; then + echo "Running libtoolize" + libtoolize --copy --force --automake +else + if test ! "x$(which gintltoolize)" = "x"; then + echo "Running glibtoolize" + glibtoolize --copy --force --automake + fi +fi +autoreconf --install --force --verbose diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..fcfb377 --- /dev/null +++ b/configure.ac @@ -0,0 +1,29 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.61) +AC_INIT([stlink],[0.5.0],[davem@devkitpro.org]) +AC_CONFIG_SRCDIR([src/stlink-common.c]) + +AM_INIT_AUTOMAKE([1.10]) + + +# Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL +AC_CANONICAL_HOST +AC_CANONICAL_BUILD +AC_PROG_LIBTOOL +AM_PROG_CC_C_O + +# Checks for libraries. +PKG_CHECK_MODULES(USB, libusb-1.0 >= 1.0.0,, + AC_MSG_ERROR([*** Required libusb-1.0 >= 1.0.0 not installed ***])) +AC_CHECK_LIB([usbpath],[usb_path2devnum],,,-lusb) + +LIBS="$LIBS $USB_LIBS" +CFLAGS="$CFLAGS $USB_CFLAGS" + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT +