From 77c2794c562cb524c4f34bd9afa635e0bfb584c5 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 1 Sep 2015 15:24:46 +0100 Subject: automake --- Makefile.am | 33 ++++++++++++++++++--------------- configure.ac | 11 +++++++---- dfu.c | 2 +- project.h | 2 ++ 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/Makefile.am b/Makefile.am index c4f168d..c7fe645 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,23 +7,11 @@ # # # -man1_MANS=nrfdfu.man - -INCLUDES= ${BLUEZ_CFLAGS} ${JSON_C_CFLAGS} ${LIBZIP_CFLAGS} - -noinst_HEADERS= prototypes.h ${CHDRS} ${BLUEZ_HDRS} +AUTOMAKE_OPTIONS = subdir-objects +man1_MANS=nrfdfu.man bin_PROGRAMS = nrfdfu -nrfdfu_SOURCES = ${SRCS} -nrfdfu_LDADD = ${BLUEZ_LIBS} ${JSON_C_LIBS} ${LIBZIP_LIBS} - -tidy: ${CSRCS} ${CHDRS} - indent -i2 -ts0 ${CSRCS} ${CHDRS} - /bin/rm -f *~ - -AM_CFLAGS=-g -Wall - CSRCS= \ nrfdfu.c \ @@ -38,7 +26,7 @@ CHDRS= \ ble.h \ dfu.h \ manifest.h \ - project.h \ + project.h BLUEZ_SRCS= \ bluez/att.c \ @@ -67,6 +55,21 @@ BLUEZ_HDRS= \ bluez/util.h \ bluez/uuid.h + +AM_CPPFLAGS = ${BLUEZ_CFLAGS} ${JSON_C_CFLAGS} ${LIBZIP_CFLAGS} + +noinst_HEADERS= prototypes.h ${CHDRS} ${BLUEZ_HDRS} + + +nrfdfu_SOURCES = ${CSRCS} ${BLUEZ_SRCS} +nrfdfu_LDADD = ${BLUEZ_LIBS} ${JSON_C_LIBS} ${LIBZIP_LIBS} + +tidy: ${CSRCS} ${CHDRS} + indent -i2 -ts0 ${CSRCS} ${CHDRS} + /bin/rm -f *~ + +AM_CFLAGS=-g -Wall + protos: echo > prototypes.h ${CPROTO} ${CPPFLAGS} -e -v ${CSRCS} > prototypes.new diff --git a/configure.ac b/configure.ac index 18c4800..9bb8e31 100644 --- a/configure.ac +++ b/configure.ac @@ -7,15 +7,14 @@ dnl All rights reserved. dnl dnl AC_PREREQ(2.13) -AC_INIT(nrfdfu.c) +AC_INIT(nrfdfu,1.00) +AC_CONFIG_SRCDIR(nrfdfu.c) +AM_INIT_AUTOMAKE AC_PROG_CC AC_SYS_LARGEFILE -VERSION=1.00 -PACKAGE=nrfdfu -AM_INIT_AUTOMAKE($PACKAGE,$VERSION) AM_CONFIG_HEADER(config.h) @@ -32,5 +31,9 @@ dnl AC_CHECK_FUNCS() dnl CFLAGS=-g +PKG_CHECK_MODULES(LIBZIP,libzip) +PKG_CHECK_MODULES(JSON_C,json-c) +PKG_CHECK_MODULES(BLUEZ,bluez) + AC_OUTPUT([Makefile]) diff --git a/dfu.c b/dfu.c index ded587b..8bd142e 100644 --- a/dfu.c +++ b/dfu.c @@ -8,7 +8,7 @@ send_data_quickly (BLE * b, uint8_t * d, size_t sz, int pkts) size_t mtu = 16; size_t off = 0; size_t tx, rx; - int sent; + int sent=0; ble_notify_pkts_start (b); diff --git a/project.h b/project.h index be211ee..c868e68 100644 --- a/project.h +++ b/project.h @@ -1,3 +1,5 @@ +#include "config.h" + #include #include #include -- cgit v1.2.3