#
# Makefile to be included by each application's Makefile for tinybt.
# Based on tinydiffusion and S-MAC by Mohan Mysore
#


# Cheating a bit here....
REAL_TOSDIR := $(TOSDIR)

TINYBT_TOSDIR = ../../tos
#TINYBT_TOSDIR := $(TOSDIR)
#TOSDIR:=../../tos


#INCLUDE = -I. -I$(TINYBT_TOSDIR)/interfaces \
#          -I$(TINYBT_TOSDIR)/system -I$(TINYBT_TOSDIR)/lib \
#	  -I$(TINYBT_TOSDIR)/platform/$(PLATFORM) \
#	  -I$(TINYBT_TOSDIR)/types/

# Hey, we are running gnu make, right? Right?!

LIBDIRS=$(wildcard $(REAL_TOSDIR)/lib/*/)

testmig:
	echo "LIBDIRS= $(LIBDIRS)"

INCLUDE =	-I$(TINYBT_TOSDIR)/platform/$(PLATFORM) \
		-I. -I$(TINYBT_TOSDIR)/interfaces \
		-I$(TINYBT_TOSDIR)/system -I$(TINYBT_TOSDIR)/lib \
		-I$(TINYBT_TOSDIR)/types/ $(addprefix -I,$(LIBDIRS))

override PLATFORMS := btnode2_2 pc ged

CFLAGS += $(INCLUDE) -O0

PROGRAMMER_EXTRA_FLAGS = -v=2

#include $(TOSDIR)/../apps/Makerules
include $(REAL_TOSDIR)/../apps/Makerules

ifeq ($(PLATFORM)_x, pc_x)
INCLUDE := -include /home/madsdyd/DIKU/TinyOS/tinyos-1.x/contrib/tinybt/tos/platform/pc/hardware.nido.h -D__HARDWARE_NIDO_H_INCLUDED $(INCLUDE)
#INCLUDE := -nostdinc $(INCLUDE) -I$(TOSDIR)/interfaces \
#          -I$(TOSDIR)/system -I$(TOSDIR)/lib \
#	  -I$(TOSDIR)/platform/$(PLATFORM) \
#	  -I$(TOSDIR)/types/
endif

