Fixed makefile for building the Linux router application. (#585)
* Fixed Makefile for building the Linux router application.
This commit is contained in:
+1
-1
@@ -403,7 +403,7 @@ writefile: $(BACNET_LIB_TARGET)
|
|||||||
$(MAKE) -B -C $@
|
$(MAKE) -B -C $@
|
||||||
|
|
||||||
.PHONY: router
|
.PHONY: router
|
||||||
router: $(BACNET_LIB_TARGET)
|
router:
|
||||||
$(MAKE) -B -C $@
|
$(MAKE) -B -C $@
|
||||||
|
|
||||||
.PHONY: router-ipv6
|
.PHONY: router-ipv6
|
||||||
|
|||||||
+11
-6
@@ -1,4 +1,6 @@
|
|||||||
#Makefile to build BACnet Application for the Linux Port
|
#Makefile to build BACnet Application for the Linux Port
|
||||||
|
# Note: requires libconfig-dev to be installed
|
||||||
|
# sudo apt-get install -qq libconfig-dev
|
||||||
|
|
||||||
# tools - only if you need them.
|
# tools - only if you need them.
|
||||||
# Most platforms have this already defined
|
# Most platforms have this already defined
|
||||||
@@ -10,14 +12,11 @@ TARGET = router
|
|||||||
TARGET_BIN = ${TARGET}$(TARGET_EXT)
|
TARGET_BIN = ${TARGET}$(TARGET_EXT)
|
||||||
|
|
||||||
ifeq (${BACNET_PORT},linux)
|
ifeq (${BACNET_PORT},linux)
|
||||||
#PFLAGS =
|
|
||||||
# -pthread
|
|
||||||
TARGET_EXT =
|
TARGET_EXT =
|
||||||
LIBS = -lpthread -lconfig -lm
|
LIBS = -lpthread -lconfig -lm
|
||||||
LFLAGS += $(LIBS)
|
LFLAGS = $(LIBS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#DEFINES = $(BACNET_DEFINES) -DBACDL_MSTP -DBACDL_BIP
|
|
||||||
SOURCE_DIR = ../../src
|
SOURCE_DIR = ../../src
|
||||||
BACNET_SOURCE_DIR = ${SOURCE_DIR}/bacnet
|
BACNET_SOURCE_DIR = ${SOURCE_DIR}/bacnet
|
||||||
|
|
||||||
@@ -42,20 +41,26 @@ SRCS = main.c \
|
|||||||
${BACNET_SOURCE_DIR}/bacstr.c \
|
${BACNET_SOURCE_DIR}/bacstr.c \
|
||||||
${BACNET_SOURCE_DIR}/npdu.c \
|
${BACNET_SOURCE_DIR}/npdu.c \
|
||||||
${BACNET_SOURCE_DIR}/bacaddr.c \
|
${BACNET_SOURCE_DIR}/bacaddr.c \
|
||||||
|
${BACNET_SOURCE_DIR}/hostnport.c \
|
||||||
mstpmodule.c \
|
mstpmodule.c \
|
||||||
ipmodule.c \
|
ipmodule.c \
|
||||||
portthread.c \
|
portthread.c \
|
||||||
msgqueue.c \
|
msgqueue.c \
|
||||||
network_layer.c
|
network_layer.c
|
||||||
|
|
||||||
CFLAGS += -I${SOURCE_DIR} -I${BACNET_PORT_DIR}
|
# note: router does not use common libbacnet.a library,
|
||||||
|
# so use CFLAGS without common app defines or includes
|
||||||
|
CFLAGS = -I${SOURCE_DIR} -I${BACNET_PORT_DIR}
|
||||||
|
CFLAGS += -DBACNET_STACK_DEPRECATED_DISABLE
|
||||||
|
CFLAGS += -std=gnu99
|
||||||
|
CFLAGS += $(WARNINGS) $(DEBUGGING) $(OPTIMIZATION)
|
||||||
|
|
||||||
OBJS = ${SRCS:.c=.o}
|
OBJS = ${SRCS:.c=.o}
|
||||||
|
|
||||||
all: Makefile ${TARGET_BIN}
|
all: Makefile ${TARGET_BIN}
|
||||||
|
|
||||||
${TARGET_BIN}: ${OBJS} Makefile
|
${TARGET_BIN}: ${OBJS} Makefile
|
||||||
${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@
|
${CC} ${OBJS} ${LFLAGS} -o $@
|
||||||
size $@
|
size $@
|
||||||
cp $@ ../../bin
|
cp $@ ../../bin
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -517,6 +517,8 @@ bool parse_cmd(int argc, char *argv[])
|
|||||||
current->route_info.net = port_count;
|
current->route_info.net = port_count;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
dev_opt =
|
dev_opt =
|
||||||
getopt_long(argc, argv, bipString, Options, &index);
|
getopt_long(argc, argv, bipString, Options, &index);
|
||||||
@@ -620,6 +622,8 @@ bool parse_cmd(int argc, char *argv[])
|
|||||||
current->route_info.net = (uint16_t)result;
|
current->route_info.net = (uint16_t)result;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
dev_opt = getopt_long(
|
dev_opt = getopt_long(
|
||||||
argc, argv, mstpString, Options, &index);
|
argc, argv, mstpString, Options, &index);
|
||||||
@@ -630,6 +634,8 @@ bool parse_cmd(int argc, char *argv[])
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -648,8 +654,9 @@ void init_port_threads(ROUTER_PORT *port_list)
|
|||||||
case MSTP:
|
case MSTP:
|
||||||
port->func = &dl_mstp_thread;
|
port->func = &dl_mstp_thread;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
port->state = INIT;
|
port->state = INIT;
|
||||||
thread = (pthread_t *)malloc(sizeof(pthread_t));
|
thread = (pthread_t *)malloc(sizeof(pthread_t));
|
||||||
pthread_create(thread, NULL, port->func, port);
|
pthread_create(thread, NULL, port->func, port);
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ uint16_t process_network_message(BACMSG *msg, MSG_DATA *data, uint8_t **buff)
|
|||||||
case 4:
|
case 4:
|
||||||
PRINT(ERROR, "Error: Message too long\n");
|
PRINT(ERROR, "Error: Message too long\n");
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -563,10 +563,10 @@ uint16_t MSTP_Get_Reply(
|
|||||||
struct mstp_pdu_packet *pkt;
|
struct mstp_pdu_packet *pkt;
|
||||||
SHARED_MSTP_DATA *poSharedData = (SHARED_MSTP_DATA *)mstp_port->UserData;
|
SHARED_MSTP_DATA *poSharedData = (SHARED_MSTP_DATA *)mstp_port->UserData;
|
||||||
|
|
||||||
|
(void)timeout;
|
||||||
if (!poSharedData) {
|
if (!poSharedData) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Ringbuf_Empty(&poSharedData->PDU_Queue)) {
|
if (Ringbuf_Empty(&poSharedData->PDU_Queue)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,6 +124,9 @@ static void debug_print_bip(const char *str, const BACNET_IP_ADDRESS *addr)
|
|||||||
(unsigned)addr->address[1], (unsigned)addr->address[2],
|
(unsigned)addr->address[1], (unsigned)addr->address[2],
|
||||||
(unsigned)addr->address[3], (unsigned)addr->port);
|
(unsigned)addr->address[3], (unsigned)addr->port);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)str;
|
||||||
|
(void)addr;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +141,9 @@ static void debug_print_unsigned(const char *str, const unsigned int value)
|
|||||||
if (BVLC_Debug) {
|
if (BVLC_Debug) {
|
||||||
printf("BVLC: %s %u\n", str, value);
|
printf("BVLC: %s %u\n", str, value);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)str;
|
||||||
|
(void)value;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,6 +159,10 @@ static void debug_print_npdu(
|
|||||||
if (BVLC_Debug) {
|
if (BVLC_Debug) {
|
||||||
printf("BVLC: %s NPDU=MTU[%u] len=%u\n", str, offset, length);
|
printf("BVLC: %s NPDU=MTU[%u] len=%u\n", str, offset, length);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)str;
|
||||||
|
(void)offset;
|
||||||
|
(void)length;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,6 +176,8 @@ static void debug_print_string(const char *str)
|
|||||||
if (BVLC_Debug) {
|
if (BVLC_Debug) {
|
||||||
printf("BVLC: %s\n", str);
|
printf("BVLC: %s\n", str);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)str;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,6 +527,10 @@ static void bbmd_read_bdt_ack_handler(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)addr;
|
||||||
|
(void)npdu;
|
||||||
|
(void)npdu_length;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -557,6 +573,10 @@ static void bbmd_read_fdt_ack_handler(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)addr;
|
||||||
|
(void)npdu;
|
||||||
|
(void)npdu_length;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user