From 475922ce345bb0443cf4fdef00efa86676a1bf62 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 1 Sep 2015 00:41:49 +0100 Subject: fish --- Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..08587b8 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +CSRCS=nrfdfu.c util.c zip.c ble.c manifest.c dfu.c + +PROG=nrfdfu + +OPT=-g + + +CPROTO=cproto +ZIP_INCLUDES=$(shell pkg-config --cflags libzip) +ZIP_LIBS=$(shell pkg-config --libs libzip) +JSON_C_INCLUDES=$(shell pkg-config --cflags json-c) +JSON_C_LIBS=$(shell pkg-config --libs json-c) +BLUEZ_INCLUDES=$(shell pkg-config --cflags bluez) +BLUEZ_LIBS=$(shell pkg-config --libs bluez) + + +INCLUDES=${ZIP_INCLUDES} ${JSON_C_INCLUDES} ${BLUEZ_INCLUDES} +LIBS=${ZIP_LIBS} ${JSON_C_LIBS} ${BLUEZ_LIBS} +CPPFLAGS=${DEFINES} ${INCLUDES} +CFLAGS=${OPT} +OBJS=${CSRCS:%.c=%.o} + + +all: ${PROG} + +${PROG}:${OBJS} + ${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS} + +protos: + echo > prototypes.h + ${CPROTO} ${CPPFLAGS} -e -v ${CSRCS} > prototypes.new + mv prototypes.new prototypes.h + +clean: + /bin/rm -f ${OBJS} -- cgit v1.2.3