3 # Generel Makerules for Module image
6 ##################################################
7 # Only allow the module to be built for hardware that suports it. A faild
8 # build will result in the "invalid" target
9 #################################################
11 SUPPORTLIST = cyclops protosb mica2 micaz xyz avrora cricket imote2 tmote sim
14 UTILLIST = all install install2 setup check clean
16 WHITELIST += $(UTILLIST)
17 WHITELIST += $(SUPPORTLIST)
20 ifeq ($(MAKECMDGOALS),)
21 FILTER = $(filter $(WHITELIST), mica2)
24 FILTER = $(filter $(WHITELIST), $(MAKECMDGOALS))
25 PLATFORM = $(filter $(SUPPORTLIST), $(MAKECMDGOALS))
28 FILTER = $(filter $(WHITELIST), $(PLATFORM))
29 PLATFORM = $(filter $(SUPPORTLIST), $(MAKECMDGOALS))
33 $(error Invalid platform. Please try "make [$(WHITELIST)]")
38 ##################################################
39 # Misc. module options
40 #################################################
52 ##################################################
54 #################################################
56 DEFS += -DFAULT_TOLERANT_SOS
64 SFIDEPS += $(PROJ).sbx $(PROJ).sbx.lst
65 MELFDEPS += $(PROJ).sbx.mlf
67 ifeq ($(PLATFORM), sim)
69 MELFDEPS += $(PROJ).sos $(PROJ).mlf
73 ##################################################
75 #################################################
76 ifeq ($(MODE), preemption)
77 DEFS += -DSOS_USE_PREEMPTION
79 ifeq ($(MODE), preemption_profiler)
80 DEFS += -DUSE_PREEMPTION_PROFILER
81 DEFS += -DSOS_USE_PREEMPTION
85 #################################################
87 #################################################
88 #MELFDEPS += $(PROJ).mlf
90 #################################################
92 #################################################
94 #################################################
96 DEFS += -DVM_EXTENSION_ENABLE
100 OBJS += $(SRCS:.c=.o)
103 include $(ROOTDIR)/kernel/Makerules
106 CFLAGS += -Wno-unused-variable
111 $(PLATFORM): $(PROCESSOR) $(PROJ).i $(SFIDEPS) $(MELFDEPS)
115 cilly.asm.exe --out $@ --keepunused --domotesfi $<
118 $(ROOTDIR)/tools/elfloader/utils/elftomini/elftomini.exe -o $@ $<
121 $(ROOTDIR)/tools/harbor/app/avrsandbox/avrsandbox.exe -f $< -o $@
124 $(OBJDUMP) -h -S $< > $@
127 $(ROOTDIR)/tools/elfloader/utils/elftomini/elftomini.exe -o $@ $<
130 @echo "make [$(SUPPORTLIST)]"
133 cp $< $(ROOTDIR)/modules/build/
135 install2: $(PROJ).sos
136 cp $< $(ROOTDIR)/modules/build/
138 installmelf: $(PROJ).mlf
139 cp $< $(ROOTDIR)/modules/build/
141 installsbx: $(PROJ).sbx.mlf
142 cp $< $(ROOTDIR)/modules/build/
145 $(INSTALLER) --wr_fuse_l=0xff
147 $(INSTALLER) --wr_fuse_h=0x9f
149 $(INSTALLER) --wr_fuse_e=0xfe
152 @$(ROOTDIR)/tools/verify/check $(PROJ).i $(ROOTDIR) $(QUIET)
155 rm -f *.sos *.o *.s *.srec *.elf *.lst $(PROJ).map $(PROJ).exe $(PROJ).cil.c \
156 $(PROJ).i $(PROJ).main.i *.i.check $(PROJ).sfi.c *.mlf $(PROJ).sbx $(PROJ).od