board.h works now

This commit is contained in:
Mariano Alvira 2010-02-23 15:53:00 -05:00
parent 3cc6896981
commit 59391d7529
3 changed files with 23 additions and 7 deletions

View File

@ -32,11 +32,23 @@ $(ISR): $(ISR:.o=.c)
%_$(BOARD).elf: %.elf %_$(BOARD).elf: %.elf
mv $< $@ mv $< $@
%.elf: $(START) $(ISR) $(LIBMC1322X)/libmc1322x.a $(OBJDIR)/%.o $(LINKERSCRIPT) board %.elf: $(START) $(ISR) $(LIBMC1322X)/libmc1322x.a $(OBJDIR)/%.o $(LINKERSCRIPT)
$(LD) $(LDFLAGS) $(AOBJS) \ $(LD) $(LDFLAGS) $(AOBJS) \
--start-group $(PLATFORM_LIBS) --end-group \ --start-group $(PLATFORM_LIBS) --end-group \
$(filter %.o %.a,$+) -o $@ $(filter %.o %.a,$+) -o $@
%.srec: %.elf
$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
%.ihex: %.elf
$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
%.bin: %.elf
$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
%.dis: %.elf
$(OBJDUMP) -SD $< > $@
$(OBJDIR)/%.s: %.S $(OBJDIR)/%.s: %.S
$(CPP) $(AFLAGS) -o $@ $< $(CPP) $(AFLAGS) -o $@ $<
$(OBJDIR)/%.o: %.S $(OBJDIR)/%.o: %.S
@ -49,7 +61,7 @@ clean:
find $(MC1322X) \ find $(MC1322X) \
\( -name 'core' -o -name '*.bak' -o -name '*~' \ \( -name 'core' -o -name '*.bak' -o -name '*~' \
-o -name '*.o' -o -name '*.a' -o -name '*.obj' -o -name '*.elf' -o -name '*.s' -o -name '*.map' \ -o -name '*.o' -o -name '*.a' -o -name '*.obj' -o -name '*.elf' -o -name '*.s' -o -name '*.map' \
-o -name 'obj_*_board' -o -name '.depend' \) -print \ -o -name 'obj_*_board' -o -name '.depend' -o -name '*.bin' -o -name '*.dis' \) -print \
| xargs rm -rf | xargs rm -rf
rm -fr *.*~ rm -fr *.*~

View File

@ -1,9 +1,9 @@
BOARDS = redbee-dev redbee-module redbee-r1 redbee-usb redbee-econotag BOARDS = redbee-dev redbee-module redbee-r1 redbee-usb redbee-econotag
CFLAGS += -I obj_$(BOARD)_board OBJDIR = ./obj_$(BOARD)_board
OBJDIR = obj_$(BOARD)_board CFLAGS += -I$(OBJDIR)
board: $(OBJDIR):
ifndef BOARD ifndef BOARD
${warning BOARD not defined} ${warning BOARD not defined}
${warning echo "make BOARD=foo"} ${warning echo "make BOARD=foo"}
@ -12,4 +12,6 @@ ifndef BOARD
endif endif
@echo "setup object directory for dev board" @echo "setup object directory for dev board"
mkdir -p $(OBJDIR) mkdir -p $(OBJDIR)
cp $(MC1322X)/board/$(BOARD).h $(OBJDIR)
$(OBJDIR)/board.h: $(OBJDIR)
ln -s ../$(MC1322X)/board/$(BOARD).h $(OBJDIR)/board.h

View File

@ -2,5 +2,7 @@ MC1322X = ..
include $(MC1322X)/Makefile.include include $(MC1322X)/Makefile.include
all: board blink-red_$(BOARD).elf TARGETS = blink-red_$(BOARD).bin
all: $(OBJDIR) $(OBJDIR)/board.h $(TARGETS) $(TARGETS:.bin=.dis)