]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - support/make/null/null.rules
added one more level of redirection for building the StorageVolume.h file. This...
[tinyos-2.x.git] / support / make / null / null.rules
index 1fe3f3b7c8193c75ac4fb4d54f4e5a7a7008b407..58632258ea1efb344dcd616778fc1f48fa131586 100644 (file)
@@ -15,30 +15,40 @@ OBJDUMP = objdump
 NCC = ncc
 LIBS = -lm
 
-BUILDDIR = build/$(PLATFORM)
+BUILDDIR ?= build/$(PLATFORM)
 MAIN_EXE = $(BUILDDIR)/main.exe
 MAIN_SREC = $(BUILDDIR)/main.srec
 MAIN_IHEX = $(BUILDDIR)/main.ihex
 INSTALL_SREC = $(MAIN_SREC).out$(if $(NODEID),-$(NODEID),)
 VOLUMEFILE = volumes-at45db.xml
+VOLUME_ALLOCATOR ?= tos-storage-at45db
 
-PFLAGS += -Wall -Wshadow -DDEF_TOS_AM_GROUP=$(DEFAULT_LOCAL_GROUP) $(NESC_FLAGS)
+PFLAGS += -Wall -Wshadow $(NESC_FLAGS)
 PFLAGS += -target=$(PLATFORM) -fnesc-cfile=$(BUILDDIR)/app.c
 ifdef MSG_SIZE
 PFLAGS += -DTOSH_DATA_LENGTH=$(MSG_SIZE)
 endif
+ifdef DEFAULT_LOCAL_GROUP
+PFLAGS += -DDEFINED_TOS_AM_GROUP=$(DEFAULT_LOCAL_GROUP)
+endif
 
 BUILDLESS_DEPS += bytes
 
 # Build storage file if volumes.xml present
 # We "steal" the at45db storage spec
 ifneq ($(wildcard $(VOLUMEFILE)), )
-exe0: $(BUILDDIR)/StorageVolumes.h
+build_storage: $(BUILDDIR)/StorageVolumes.h
+
+exe0: build_storage
 
 $(BUILDDIR)/StorageVolumes.h: $(VOLUMEFILE)
-       tos-storage-at45db <$(VOLUMEFILE) >$@
+       $(VOLUME_ALLOCATOR) $(VOLUME_ALLOCATOR_FLAGS) <$(VOLUMEFILE) >$@
 
 PFLAGS += -I$(BUILDDIR)
+else
+
+build_storage: 
+
 endif
 
 ifndef BUILD_DEPS