From dd92901aa149d019a289aec47c4a6e07d5faf5d0 Mon Sep 17 00:00:00 2001 From: tbrennan3 Date: Mon, 29 Nov 2010 15:37:13 +0000 Subject: [PATCH] I like Piotr's new make structure a lot. I've tweaked it a little here: made the most important defines conditional, so if they're set before the call to make, those external definitions will not be overriden, but defaults can be supplied here in the Makefile if they have not been defined. This is really handy for my use of the stack (and probably yours, too): I can take the distribution right out-of-the-box and yet tailor it to my needs by the way I invoke make. Also, can somebody add a comment about what WEAK_FUNC is defined for? I couldn't see any reference to it in the code. If it's really special, it could be removed from the general case here and included by the external definition of BACNET_DEFINES --- bacnet-stack/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bacnet-stack/Makefile b/bacnet-stack/Makefile index 87b7d4f5..d7c1a91e 100644 --- a/bacnet-stack/Makefile +++ b/bacnet-stack/Makefile @@ -6,15 +6,17 @@ # AR = ar # configuration -BACNET_DEFINES = -DPRINT_ENABLED=1 -DBACAPP_ALL -DBACFILE +# If BACNET_DEFINES has not already been set, configure to your needs here +BACNET_DEFINES ?= -DPRINT_ENABLED=1 -DBACAPP_ALL -DBACFILE # un-comment the next line to build the routing demo application #BACNET_DEFINES += -DBAC_ROUTING #BACDL_DEFINE=-DBACDL_ETHERNET=1 #BACDL_DEFINE=-DBACDL_ARCNET=1 #BACDL_DEFINE=-DBACDL_MSTP=1 -BACDL_DEFINE=-DBACDL_BIP=1 +BACDL_DEFINE?=-DBACDL_BIP=1 +# Define WEAK_FUNC for [...somebody help here; I can't find any uses of it] DEFINES = $(BACNET_DEFINES) $(BACDL_DEFINE) -DWEAK_FUNC= # directories @@ -40,6 +42,8 @@ endif endif CFLAGS = $(WARNINGS) $(DEBUGGING) $(OPTIMIZATION) $(STANDARDS) $(INCLUDES) $(DEFINES) +# Export the variables defined here to all subprocesses +# (see http://www.gnu.org/software/automake/manual/make/Special-Targets.html) .EXPORT_ALL_VARIABLES: all: library demos