mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-01 07:25:47 +03:00
[LWIP] Makefile: Fix include path for lwippools.h
Create path for pre-processor includes from LIBCOAP_API_VERSION in configure.ac. This avoids breaking the example after API version change.
This commit is contained in:
1 parent
4426fa2a69
commit
60dd7aa32a
1 file changed
+10
-7
+10
-7
@@ -1,4 +1,9 @@
|
||||
top_srcdir = ../..
|
||||
include_dir = $(top_srcdir)/include
|
||||
|
||||
LIBCOAP_API_VERSION = $(shell sed -ne 's/^LIBCOAP_API_VERSION=\([0-9]\+\).*$$/\1/p' $(top_srcdir)/configure.ac)
|
||||
|
||||
coap_include_dir = $(include_dir)/coap$(LIBCOAP_API_VERSION)
|
||||
|
||||
WITH_LWIP_BRANCH=STABLE-2_0_3_RELEASE
|
||||
WITH_LWIP_CONTRIB_BRANCH=STABLE-2_0_1_RELEASE
|
||||
@@ -35,7 +40,8 @@ LWIPOBJS += mld6.o ip6.o icmp6.o ethip6.o nd6.o ip6_addr.o ip6_frag.o
|
||||
|
||||
CFLAGS += -std=gnu99
|
||||
|
||||
CFLAGS += -I$(top_srcdir)/include -I$(top_srcdir)/include/coap2
|
||||
# set path to coap_include_dir for lwippools.h
|
||||
CFLAGS += -I$(top_srcdir)/include -I$(coap_include_dir)
|
||||
|
||||
vpath %.c $(top_srcdir)/src
|
||||
|
||||
@@ -47,18 +53,15 @@ CFLAGS += -Wno-unused-parameter
|
||||
|
||||
CFLAGS += -Ilwip/src/include/ -Ilwip/src/include/ipv4/ -Ilwip-contrib/ports/unix/port/include/ -Ilwip-contrib/ports/unix/proj/minimal/
|
||||
|
||||
# making an executable out of all of it
|
||||
|
||||
OBJS = server.o server-coap.o ${LWIPOBJS} ${COAPOBJS}
|
||||
|
||||
../../include/coap2/coap.h:
|
||||
@echo "Error: coap.h not present. Run the autotools chain (\`./autogen.sh && ./configure\`) in the project root directory to build the required coap.h file."
|
||||
$(coap_include_dir)/coap.h:
|
||||
@echo "Error: $@ not present. Run the autotools chain (\`./autogen.sh && ./configure\`) in the project root directory to build the required coap.h file."
|
||||
@exit 1
|
||||
|
||||
${OBJS}: lwip lwip-contrib ../../include/coap2/coap.h
|
||||
${OBJS}: lwip lwip-contrib $(coap_include_dir)/coap.h
|
||||
|
||||
server: ${OBJS}
|
||||
# $(CC) ${OBJS} -o server -lrt
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS}
|
||||
|
||||
Reference in new issue
Block a user