Feature/makefile add apps library (#218)
* add BACnet stack library at apps/lib * convert apps to use apps/lib for smaller binary * fix -DBACDL_ALL=1 build * fix piface build * datalink MAX_MPDU and MAX_HEADER cleanup * add bip6 to git workflow * fix system library dependency of BACnet library Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
+9
-11
@@ -1,7 +1,8 @@
|
||||
#Makefile to build BACnet Application for the GCC port
|
||||
#Makefile to build BACnet Application using GCC compiler
|
||||
|
||||
# Executable file name
|
||||
TARGET = bacserv
|
||||
# BACnet objects that are used with this app
|
||||
BACNET_OBJECT_DIR = $(BACNET_SRC_DIR)/bacnet/basic/object
|
||||
SRC = main.c \
|
||||
$(BACNET_OBJECT_DIR)/device.c \
|
||||
@@ -37,24 +38,21 @@ SRC = main.c \
|
||||
$(BACNET_OBJECT_DIR)/acc.c \
|
||||
$(BACNET_OBJECT_DIR)/bacfile.c
|
||||
|
||||
BACNET_BASIC_SRC += \
|
||||
$(wildcard $(BACNET_SRC_DIR)/bacnet/basic/service/*.c)
|
||||
|
||||
# TARGET_EXT is defined in apps/Makefile as .exe or nothing
|
||||
TARGET_BIN = ${TARGET}$(TARGET_EXT)
|
||||
|
||||
SRCS = $(SRC) $(BACNET_SRC) $(BACNET_BASIC_SRC) $(BACNET_PORT_SRC)
|
||||
OBJS += ${SRC:.c=.o}
|
||||
|
||||
OBJS = ${SRCS:.c=.o}
|
||||
all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN}
|
||||
|
||||
.PHONY: all
|
||||
all: Makefile ${TARGET_BIN}
|
||||
|
||||
${TARGET_BIN}: ${OBJS}
|
||||
${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET}
|
||||
${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@
|
||||
size $@
|
||||
cp $@ ../../bin
|
||||
|
||||
${BACNET_LIB_TARGET}:
|
||||
( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) -s )
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${CFLAGS} $*.c -o $@
|
||||
|
||||
@@ -65,7 +63,7 @@ depend:
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f core ${TARGET_BIN} ${OBJS} $(TARGET).map
|
||||
rm -f core ${TARGET_BIN} ${OBJS} $(TARGET).map ${BACNET_LIB_TARGET}
|
||||
|
||||
.PHONY: include
|
||||
include: .depend
|
||||
|
||||
Reference in New Issue
Block a user