diff --git a/Makefile.include b/Makefile.include index 01311e4668..99f8caf091 100644 --- a/Makefile.include +++ b/Makefile.include @@ -25,8 +25,8 @@ include $(RIOTCPU)/$(CPU)/Makefile.include include $(RIOTBASE)/Makefile.modules # your binaries to link -BASELIBS += $(BINDIR)/$(BOARD)_base.a -BASELIBS += $(BINDIR)/${PROJECT}.a +BASELIBS += $(BINDIR)$(BOARD)_base.a +BASELIBS += $(BINDIR)${PROJECT}.a # clumsy way to enable building native on osx: BUILDOSXNATIVE = 0 @@ -48,17 +48,17 @@ endif .PHONY: all clean flash doc term ## make script for your project. Build RIOT-base here! -all: $(BINDIR)/$(PROJECT).a +all: $(BINDIR)$(PROJECT).a @echo "Building project $(PROJECT) for $(BOARD) w/ MCU $(MCU)." "$(MAKE)" -C $(RIOTBOARD)/$(BOARD) "$(MAKE)" -C $(RIOTBASE) @for i in $(EXTERNAL_MODULES) ; do "$(MAKE)" -C $$i ; done ; ifeq ($(BUILDOSXNATIVE),1) - @$(LINK) $(UNDEF) -o $(BINDIR)/$(PROJECT).elf $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie + @$(LINK) $(UNDEF) -o $(BINDIR)$(PROJECT).elf $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie else - @$(LINK) $(UNDEF) -o $(BINDIR)/$(PROJECT).elf -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(BINDIR)/$(PROJECT).map $(LINKFLAGS) - @$(SIZE) $(BINDIR)/$(PROJECT).elf - @$(OBJCOPY) $(OFLAGS) $(BINDIR)/$(PROJECT).elf $(BINDIR)/$(PROJECT).hex + @$(LINK) $(UNDEF) -o $(BINDIR)$(PROJECT).elf -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(BINDIR)$(PROJECT).map $(LINKFLAGS) + @$(SIZE) $(BINDIR)$(PROJECT).elf + @$(OBJCOPY) $(OFLAGS) $(BINDIR)$(PROJECT).elf $(BINDIR)$(PROJECT).hex endif ## your make rules @@ -70,18 +70,18 @@ endif SRC = $(wildcard *.c) # string array of all names replaced .c with .o -OBJ = $(SRC:%.c=${BINDIR}/%.o) +OBJ = $(SRC:%.c=${BINDIR}%.o) -$(BINDIR)/$(PROJECT).a: $(OBJ) - $(AR) -rc $(BINDIR)/$(PROJECT).a $(OBJ) +$(BINDIR)$(PROJECT).a: $(OBJ) + $(AR) -rc $(BINDIR)$(PROJECT).a $(OBJ) # pull in dependency info for *existing* .o files -include $(OBJ:.o=.d) -$(BINDIR)/%.o: %.c $(PROJDEPS) +$(BINDIR)%.o: %.c $(PROJDEPS) @echo; echo "Compiling.... $*.c"; echo @test -d $(BINDIR) || mkdir -p $(BINDIR) - $(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)/$*.o + $(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)$*.o clean: "$(MAKE)" -C $(RIOTBOARD)/$(BOARD) clean diff --git a/boards/chronos/Makefile.include b/boards/chronos/Makefile.include index ef175a7873..299b631b51 100644 --- a/boards/chronos/Makefile.include +++ b/boards/chronos/Makefile.include @@ -14,7 +14,7 @@ export AS = $(PREFIX)as export LINK = $(PREFIX)gcc export SIZE = $(PREFIX)size export OBJCOPY = $(PREFIX)objcopy -export LINKFLAGS = -mmcu=$(MCU) -lgcc $(BINDIR)/startup.o +export LINKFLAGS = -mmcu=$(MCU) -lgcc $(BINDIR)startup.o export FLASHER = mspdebug export HEXFILE = bin/$(PROJECT).hex export USEMODULE += msp430_common diff --git a/boards/msba2-common/Makefile.include b/boards/msba2-common/Makefile.include index 07119c7eaf..bb11356664 100644 --- a/boards/msba2-common/Makefile.include +++ b/boards/msba2-common/Makefile.include @@ -20,7 +20,7 @@ ifeq ($(strip $(PORT)),) export PORT = /dev/ttyUSB0 endif export HEXFILE = bin/$(PROJECT).hex -export FFLAGS = $(PORT) $(BINDIR)/$(PROJECT).hex +export FFLAGS = $(PORT) $(BINDIR)$(PROJECT).hex include $(RIOTBOARD)/msba2-common/Makefile.dep export INCLUDES += -I$(RIOTCPU)/lpc2387/include -I$(RIOTBOARD)/msba2-common/include -I$(RIOTBOARD)/msba2-common/drivers/include/ diff --git a/boards/telosb/Makefile.include b/boards/telosb/Makefile.include index 213bbf7260..bd985e9338 100644 --- a/boards/telosb/Makefile.include +++ b/boards/telosb/Makefile.include @@ -13,7 +13,7 @@ export AS = $(PREFIX)as export LINK = $(PREFIX)gcc export SIZE = $(PREFIX)size export OBJCOPY = $(PREFIX)objcopy -export LINKFLAGS = -mmcu=$(MCU) -lgcc $(BINDIR)/startup.o +export LINKFLAGS = -mmcu=$(MCU) -lgcc $(BINDIR)startup.o export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm.py export FLASHER = goodfet.bsl ifeq ($(strip $(PORT)),) diff --git a/boards/wsn430-common/Makefile.include b/boards/wsn430-common/Makefile.include index a11626dbc5..923f694fe4 100644 --- a/boards/wsn430-common/Makefile.include +++ b/boards/wsn430-common/Makefile.include @@ -12,7 +12,7 @@ export AS = $(PREFIX)as export LINK = $(PREFIX)gcc export SIZE = $(PREFIX)size export OBJCOPY = $(PREFIX)objcopy -export LINKFLAGS = -mmcu=$(MCU) -lgcc $(BINDIR)/startup.o +export LINKFLAGS = -mmcu=$(MCU) -lgcc $(BINDIR)startup.o export FLASHER = mspdebug ifeq ($(strip $(PORT)),) export PORT = /dev/ttyUSB0