Browse Source

build everything in the project directory

dev/timer
Oleg Hahm 9 years ago
parent
commit
1e665b49de
  1. 36
      Makefile.include
  2. 1
      Makefile.modules
  3. 3
      boards/avsextrem/Makefile
  4. 1
      boards/avsextrem/drivers/Makefile
  5. 3
      boards/chronos/Makefile
  6. 2
      boards/chronos/Makefile.include
  7. 1
      boards/chronos/drivers/Makefile
  8. 1
      boards/mbed_lpc1768/Makefile
  9. 1
      boards/msb-430-common/Makefile
  10. 2
      boards/msb-430-common/Makefile.include
  11. 1
      boards/msb-430-common/drivers/Makefile
  12. 3
      boards/msb-430/Makefile
  13. 3
      boards/msb-430h/Makefile
  14. 1
      boards/msba2-common/Makefile
  15. 2
      boards/msba2-common/Makefile.include
  16. 1
      boards/msba2-common/drivers/Makefile
  17. 3
      boards/msba2/Makefile
  18. 3
      boards/native/Makefile
  19. 1
      boards/native/drivers/Makefile
  20. 3
      boards/redbee-econotag/Makefile
  21. 1
      boards/redbee-econotag/drivers/Makefile
  22. 3
      boards/telosb/Makefile
  23. 2
      boards/telosb/Makefile.include
  24. 1
      boards/wsn430-common/Makefile
  25. 2
      boards/wsn430-common/Makefile.include
  26. 5
      boards/wsn430-v1_3b/Makefile
  27. 3
      boards/wsn430-v1_4/Makefile

36
Makefile.include

@ -17,16 +17,16 @@ CPUDEF = $(shell echo $(CPU)|tr 'a-z' 'A-Z')
CFLAGS += -DBOARD=$(BB) -DCPU_$(CPUDEF)
export CFLAGS
export BINDIR =$(CURDIR)/bin/
# mandatory includes!
include $(RIOTBOARD)/$(BOARD)/Makefile.include
include $(RIOTCPU)/Makefile.include
include $(RIOTBASE)/Makefile.modules
# your binaries to link
BASELIBS += $(RIOTBOARD)/$(BOARD)/bin/$(BOARD)_base.a
BASELIBS += $(PROJBINDIR)/${PROJECT}.a
PROJBINDIR =$(CURDIR)/bin
BASELIBS += $(BINDIR)/$(BOARD)_base.a
BASELIBS += $(BINDIR)/${PROJECT}.a
# clumsy way to enable building native on osx:
BUILDOSXNATIVE = 0
@ -48,46 +48,46 @@ endif
.PHONY: all clean flash doc term
## make script for your project. Build RIOT-base here!
all: $(PROJBINDIR)/$(PROJECT).a
all: $(BINDIR)/$(PROJECT).a
@echo "Building project $(PROJECT) for $(BOARD) w/ MCU $(MCU)."
"$(MAKE)" -C $(RIOTBOARD)
"$(MAKE)" -C $(RIOTBASE)
@for i in $(EXTERNAL_MODULES) ; do "$(MAKE)" -C $$i ; done ;
ifeq ($(BUILDOSXNATIVE),1)
@$(LINK) $(UNDEF) -o $(PROJBINDIR)/$(PROJECT).elf $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie
@$(LINK) $(UNDEF) -o $(BINDIR)/$(PROJECT).elf $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie
else
@$(LINK) $(UNDEF) -o $(PROJBINDIR)/$(PROJECT).elf -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(PROJBINDIR)/$(PROJECT).map $(LINKFLAGS)
@$(SIZE) $(PROJBINDIR)/$(PROJECT).elf
@$(OBJCOPY) $(OFLAGS) $(PROJBINDIR)/$(PROJECT).elf $(PROJBINDIR)/$(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
## Only basic example - modify it for larger projects!!
#$(PROJBINDIR)/$(PROJECT).a: $(PROJBINDIR)/$(PROJECT).o
# $(AR) -rc $(PROJBINDIR)/project.a $(PROJBINDIR)/$(PROJECT).o
#$(BINDIR)/$(PROJECT).a: $(BINDIR)/$(PROJECT).o
# $(AR) -rc $(BINDIR)/project.a $(BINDIR)/$(PROJECT).o
# string array of all names of c files in dir
SRC = $(wildcard *.c)
# string array of all names replaced .c with .o
OBJ = $(SRC:%.c=${PROJBINDIR}/%.o)
OBJ = $(SRC:%.c=${BINDIR}/%.o)
$(PROJBINDIR)/$(PROJECT).a: $(OBJ)
$(AR) -rc $(PROJBINDIR)/$(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)
$(PROJBINDIR)/%.o: %.c $(PROJDEPS)
$(BINDIR)/%.o: %.c $(PROJDEPS)
@echo; echo "Compiling.... $*.c"; echo
@test -d $(PROJBINDIR) || mkdir -p $(PROJBINDIR)
$(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(PROJBINDIR)/$*.o
@test -d $(BINDIR) || mkdir -p $(BINDIR)
$(CC) $(CFLAGS) $(INCLUDES) -c $*.c -o $(BINDIR)/$*.o
clean:
"$(MAKE)" -C $(RIOTBOARD) clean
"$(MAKE)" -C $(RIOTBASE) clean
@for i in $(EXTERNAL_MODULES) ; do "$(MAKE)" -C $$i clean ; done ;
rm -rf $(PROJBINDIR)
rm -rf $(BINDIR)
flash: all
$(FLASHER) $(FFLAGS)

1
Makefile.modules

@ -1,5 +1,4 @@
export MAKEBASE =$(RIOTBASE)
export BINDIR =$(RIOTBASE)/bin/
UNDEF += $(BINDIR)startup.o
USEMODULE += cpu core sys

3
boards/avsextrem/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
export ARCH = avsextrem_base.a
@ -33,6 +32,6 @@ clean:
"$(MAKE)" -C drivers clean
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
@if [ -d $(BINDIR) ] ; \
then rmdir $(BINDIR) ; \
then rm -rf $(BINDIR) ; \
fi

1
boards/avsextrem/drivers/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)

3
boards/chronos/Makefile

@ -1,7 +1,6 @@
export ARCH = chronos_base.a
SRC = $(wildcard *.c)
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)
@ -32,4 +31,4 @@ clean:
$(MAKE) -C drivers clean
rm -f $(OBJ) $(DEP)
rm -f $(BINDIR)$(ARCH)
-rmdir $(BINDIR)
-rm -rf $(BINDIR)

2
boards/chronos/Makefile.include

@ -15,7 +15,7 @@ export AS = $(PREFIX)as
export LINK = $(PREFIX)gcc
export SIZE = $(PREFIX)size
export OBJCOPY = $(PREFIX)objcopy
export LINKFLAGS = -mmcu=$(MCU) -lgcc $(RIOTBASE)/bin/startup.o
export LINKFLAGS = -mmcu=$(MCU) -lgcc $(BINDIR)/startup.o
export FLASHER = mspdebug
export HEXFILE = bin/$(PROJECT).hex
export USEMODULE += msp430_common

1
boards/chronos/drivers/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)

1
boards/mbed_lpc1768/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
DEP = $(SRC:%.c=$(BINDIR)%.d)
export ARCH = mbed_lpc1768_base.a

1
boards/msb-430-common/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
DEP = $(SRC:%.c=$(BINDIR)%.d)

2
boards/msb-430-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 $(RIOTBASE)/bin/startup.o
export LINKFLAGS = -mmcu=$(MCU) -lgcc $(BINDIR)/startup.o
TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm.py
export HEXFILE = bin/$(PROJECT).hex

1
boards/msb-430-common/drivers/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)

3
boards/msb-430/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
export ARCH = msb-430_base.a
@ -30,5 +29,5 @@ clean:
$(MAKE) -C ../msb-430-common clean
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
@if [ -d $(BINDIR) ] ; \
then rmdir $(BINDIR) ; \
then rm -rf $(BINDIR) ; \
fi

3
boards/msb-430h/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
export ARCH = msb-430h_base.a
@ -31,7 +30,7 @@ clean:
$(MAKE) -C ../msb-430-common clean
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
@if [ -d $(BINDIR) ] ; \
then rmdir $(BINDIR) ; \
then rm -rf $(BINDIR) ; \
fi

1
boards/msba2-common/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
DEP = $(SRC:%.c=$(BINDIR)%.d)

2
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) $(PROJBINDIR)/$(PROJECT).hex
export FFLAGS = $(PORT) $(BINDIR)/$(PROJECT).hex
include $(RIOTBOARD)/msba2-common/Makefile.dep
export INCLUDES += -I$(RIOTCPU)/lpc2387/include

1
boards/msba2-common/drivers/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)

3
boards/msba2/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
export ARCH = msba2_base.a
@ -31,7 +30,7 @@ clean:
$(MAKE) -C ../msba2-common clean
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
@if [ -d $(BINDIR) ] ; \
then rmdir $(BINDIR) ; \
then rm -rf $(BINDIR) ; \
fi

3
boards/native/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
DEP = $(SRC:%.c=$(BINDIR)%.d)
export ARCH = native_base.a
@ -27,5 +26,5 @@ $(BINDIR)%.o: %.c
clean:
${MAKE} -C drivers clean
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
-rmdir -p $(BINDIR)
-rm -rf -p $(BINDIR)

1
boards/native/drivers/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(BINDIR)native-led.o
ifneq (,$(findstring ltc4150,$(USEMODULE)))
OBJ += $(BINDIR)native-ltc4150.o

3
boards/redbee-econotag/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
DEP = $(SRC:%.c=$(BINDIR)%.d)
export ARCH = $(BOARD)_base.a
@ -32,6 +31,6 @@ clean:
"$(MAKE)" -C drivers clean
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
@if [ -d $(BINDIR) ] ; \
then rmdir $(BINDIR) ; \
then rm -rf $(BINDIR) ; \
fi

1
boards/redbee-econotag/drivers/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)

3
boards/telosb/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
export ARCH = telosb_base.a
@ -30,5 +29,5 @@ $(BINDIR)%.o: %.c
clean:
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
@if [ -d $(BINDIR) ] ; \
then rmdir $(BINDIR) ; \
then rm -rf $(BINDIR) ; \
fi

2
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 $(RIOTBASE)/bin/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)),)

1
boards/wsn430-common/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = $(RIOTBOARD)/$(BOARD)/bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
DEP = $(SRC:%.c=$(BINDIR)%.d)

2
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 $(RIOTBASE)/bin/startup.o
export LINKFLAGS = -mmcu=$(MCU) -lgcc $(BINDIR)/startup.o
export FLASHER = mspdebug
ifeq ($(strip $(PORT)),)
export PORT = /dev/ttyUSB0

5
boards/wsn430-v1_3b/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
export ARCH = wsn430-v1_3b_base.a
@ -32,5 +31,5 @@ clean:
$(MAKE) -C ../wsn430-common clean
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
@if [ -d $(BINDIR) ] ; \
then rmdir $(BINDIR) ; \
fi
then rm -rf $(BINDIR) ; \
fi

3
boards/wsn430-v1_4/Makefile

@ -1,5 +1,4 @@
SRC = $(wildcard *.c)
BINDIR = bin/
OBJ = $(SRC:%.c=$(BINDIR)%.o)## defines
export ARCH = wsn430-v1_4_base.a
@ -31,5 +30,5 @@ clean:
$(MAKE) -C ../wsn430-common clean
rm -f $(BINDIR)$(ARCH) $(OBJ) $(DEP)
@if [ -d $(BINDIR) ] ; \
then rmdir $(BINDIR) ; \
then rm -rf $(BINDIR) ; \
fi

Loading…
Cancel
Save