Files
bacnet_stack/apps/router/Makefile
T
Stephen Dawson-Haggerty adf66f412d Fixes Issue #157 (Router segfaults) (#159)
Found a number of problems with the router when compiling on linux

* Expected malloc()'ed memory to be zeroed resulting in segfault
* IPC_NOWAIT in iplayer loop means incoming traffic will be delayed until outgoing traffic is received.
* When configured with two BIP interfaces, broadcast loops ensue because the broacast traffic is not correctly filtered.  I think the safest thing to do here is to use the SO_BINDTODEVICE setsockopt.
2021-03-11 14:54:11 -06:00

69 lines
1.5 KiB
Makefile

#Makefile to build BACnet Application for the Linux Port
# tools - only if you need them.
# Most platforms have this already defined
# CC = gcc
# Executable file name
TARGET = router
TARGET_BIN = ${TARGET}$(TARGET_EXT)
ifeq (${BACNET_PORT},linux)
#PFLAGS =
# -pthread
TARGET_EXT =
LIBS = -lpthread -lconfig -lm
LFLAGS += $(LIBS)
endif
#DEFINES = $(BACNET_DEFINES) -DBACDL_MSTP -DBACDL_BIP
SOURCE_DIR = ../../src
BACNET_SOURCE_DIR = ${SOURCE_DIR}/bacnet
SRCS = main.c \
${BACNET_PORT_DIR}/rs485.c \
${BACNET_PORT_DIR}/mstimer-init.c \
${BACNET_PORT_DIR}/bip-init.c \
${BACNET_PORT_DIR}/dlmstp_linux.c \
${BACNET_SOURCE_DIR}/basic/bbmd/h_bbmd.c \
${BACNET_SOURCE_DIR}/datalink/bvlc.c \
${BACNET_SOURCE_DIR}/basic/sys/fifo.c \
${BACNET_SOURCE_DIR}/datalink/mstp.c \
${BACNET_SOURCE_DIR}/datalink/mstptext.c \
${BACNET_SOURCE_DIR}/basic/sys/debug.c \
${BACNET_SOURCE_DIR}/indtext.c \
${BACNET_SOURCE_DIR}/basic/sys/ringbuf.c \
${BACNET_SOURCE_DIR}/datalink/crc.c \
${BACNET_SOURCE_DIR}/bacint.c \
${BACNET_SOURCE_DIR}/npdu.c \
${BACNET_SOURCE_DIR}/bacaddr.c \
mstpmodule.c \
ipmodule.c \
portthread.c \
msgqueue.c \
network_layer.c
CFLAGS = -I${SOURCE_DIR} -I${BACNET_PORT_DIR}
OBJS = ${SRCS:.c=.o}
all: Makefile ${TARGET_BIN}
${TARGET_BIN}: ${OBJS} Makefile
${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@
size $@
cp $@ ../../bin
.c.o:
${CC} -c ${CFLAGS} $*.c -o $@
depend:
rm -f .depend
${CC} -MM ${CFLAGS} *.c >> .depend
clean:
rm -f core ${TARGET_BIN} ${OBJS} $(TARGET).map
include: .depend