Modified the linux makefiles to work with MinGW by passing in BACNET_PORT=win32 from the make command. Corrected the AdapterInfo patch, and tested it.

This commit is contained in:
skarg
2008-03-10 20:44:18 +00:00
parent f86a5847ac
commit e2f7234e7d
16 changed files with 245 additions and 94 deletions
+18 -6
View File
@@ -24,19 +24,31 @@ BACNET_LIB_NAME = bacnet
BACNET_LIB_TARGET = $(BACNET_LIB_DIR)/lib$(BACNET_LIB_NAME).a
# Compiler Setup
INCLUDES = -I$(BACNET_INCLUDE) -I$(BACNET_PORT_DIR)
ifeq (${BACNET_PORT},linux)
PFLAGS = -pthread
TARGET_BIN = ${TARGET}
LIBRARIES=-lc,-lgcc,-lm,-L=$(BACNET_LIB_DIR),-l$(BACNET_LIB_NAME)
CFLAGS = -Wall -g $(INCLUDES) $(DEFINES)
endif
ifeq (${BACNET_PORT},win32)
TARGET_BIN = ${TARGET}.exe
LIBRARY1=-L=$(BACNET_LIB_DIR),-l$(BACNET_LIB_NAME)
LIBRARY2=-lws2_32,-lgcc,-lm,-liphlpapi
LIBRARIES=$(LIBRARY1),$(LIBRARY2)
endif
DEBUGGING = -g
OPTIMIZATION = -O0
CFLAGS = -Wall $(DEBUGGING) $(OPTIMIZATION) $(INCLUDES) $(DEFINES)
LFLAGS = -Wl,-Map=$(TARGET).map,$(LIBRARIES)
SRCS = main.c
OBJS = ${SRCS:.c=.o}
all: ${BACNET_LIB_TARGET} Makefile ${TARGET}
size ${TARGET}
all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN}
size ${TARGET_BIN}
${TARGET}: ${OBJS} Makefile
${CC} -pthread ${OBJS} ${LFLAGS} -o $@
${TARGET_BIN}: ${OBJS} Makefile
${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@
lib: ${BACNET_LIB_TARGET}
@@ -51,6 +63,6 @@ depend:
${CC} -MM ${CFLAGS} *.c >> .depend
clean:
rm -f core ${TARGET} ${OBJS} ${BACNET_LIB_TARGET}
rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET}
include: .depend