diff --git a/bacnet-stack/Makefile b/bacnet-stack/Makefile index d7c1a91e..634896e5 100644 --- a/bacnet-stack/Makefile +++ b/bacnet-stack/Makefile @@ -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 - - diff --git a/bacnet-stack/build.bat b/bacnet-stack/build.bat index 9252b3ae..500f65d9 100644 --- a/bacnet-stack/build.bat +++ b/bacnet-stack/build.bat @@ -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 diff --git a/bacnet-stack/demo/Makefile b/bacnet-stack/demo/Makefile index da2c324e..010a76f4 100644 --- a/bacnet-stack/demo/Makefile +++ b/bacnet-stack/demo/Makefile @@ -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 ., , $@) diff --git a/bacnet-stack/lib/Makefile b/bacnet-stack/lib/Makefile index c35fbb64..1c64b112 100644 --- a/bacnet-stack/lib/Makefile +++ b/bacnet-stack/lib/Makefile @@ -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}