Fixed Makefile for MinGW build. Testing with MinGW 20101030 and MSYS. gcc (GCC) 4.5.0 (MinGW), GNU Make 3.81 (MSYS).

This commit is contained in:
skarg
2010-11-30 17:50:24 +00:00
parent 4ef8209fed
commit a39bf392bd
4 changed files with 30 additions and 21 deletions
+4 -2
View File
@@ -4,6 +4,10 @@
# Most platforms have this already defined
# CC = gcc
# AR = ar
# MAKE = make
# SIZE = size
#
# Assumes rm and cp are available
# configuration
# If BACNET_DEFINES has not already been set, configure to your needs here
@@ -71,5 +75,3 @@ bdk-atxx4-mstp: ports/bdk-atxx4-mstp/Makefile
clean:
$(MAKE) -C lib clean
$(MAKE) -C demo clean
+4 -2
View File
@@ -1,8 +1,10 @@
@echo off
echo Build with MinGW: mingw.sourceforge.net
echo and Yagarto Tools: www.yagarto.de
echo Build with MinGW and MSYS: mingw.sourceforge.net
rem set PATH=C:\MinGW\msys\1.0\bin;C:\MinGW\bin
set CC=gcc
set AR=ar
set MAKE=make
set SIZE=size
make BACNET_PORT=win32 BUILD=release clean all
rem Build for MinGW debug
+15 -14
View File
@@ -1,3 +1,11 @@
# tools - only if you need them.
# Most platforms have this already defined
# CC = gcc
# AR = ar
# MAKE = make
# SIZE = size
#
# Assumes rm and cp are available
# Directories
BACNET_PORT = linux
@@ -34,23 +42,16 @@ LFLAGS = -Wl,$(LIBRARIES)
.EXPORT_ALL_VARIABLES:
SUBDIRS = readprop writeprop readfile writefile reinit server dcc \
whohas whois ucov timesync epics readpropm mstpcap
whohas whois ucov timesync epics readpropm mstpcap \
whoisrouter iamrouter initrouter
ifneq (,$(findstring -DBAC_ROUTING,$(BACNET_DEFINES)))
SUBDIRS += whoisrouter iamrouter initrouter gateway
SUBDIRS += gateway
endif
TARGETS = all clean
.PHONY : all $(SUBDIRS) clean
all : $(SUBDIRS)
@echo "utilities are in the bin directory"
$(SUBDIRS) :
$(MAKE) -C $@
clean :
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir clean; \
done
$(TARGETS): %: $(patsubst %, %.%, $(SUBDIRS))
$(foreach TGT, $(TARGETS), $(patsubst %, %.$(TGT), $(SUBDIRS))):
$(MAKE) -b -C $(subst ., , $@)
+7 -3
View File
@@ -4,12 +4,15 @@
# Most platforms have this already defined
# CC = gcc
# AR = ar
# MAKE = make
# SIZE = size
#
# Assumes rm and cp are available
# target
TARGET = bacnet
LIBRARY = lib$(TARGET).a
CORE_SRC = \
$(BACNET_CORE)/apdu.c \
$(BACNET_CORE)/npdu.c \
@@ -90,6 +93,7 @@ HANDLER_SRC = \
$(BACNET_HANDLER)/s_iam.c \
$(BACNET_HANDLER)/s_cov.c \
$(BACNET_HANDLER)/s_rd.c \
$(BACNET_HANDLER)/s_router.c \
$(BACNET_HANDLER)/s_rp.c \
$(BACNET_HANDLER)/s_rpm.c \
$(BACNET_HANDLER)/s_ts.c \
@@ -165,9 +169,9 @@ ifneq (,$(findstring -DBAC_ROUTING,$(BACNET_DEFINES)))
ROUTING_SRC = \
$(BACNET_HANDLER)/h_routed_npdu.c \
$(BACNET_HANDLER)/s_router.c \
$(BACNET_OBJECT)/gw_device.c
$(BACNET_OBJECT)/gw_device.c
else
ROUTING_SRC =
ROUTING_SRC =
endif
SRCS = ${CORE_SRC} ${PORT_SRC} ${HANDLER_SRC} ${OBJECT_SRC} ${ROUTING_SRC}