mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
parent
f3a587f43a
commit
66a3d7da77
@ -67,10 +67,21 @@ BASELIBS += $(USEPKG:%=${BINDIR}%.a)
|
|||||||
|
|
||||||
.PHONY: all clean flash doc term objsize buildsize buildsizes buildsizes-diff
|
.PHONY: all clean flash doc term objsize buildsize buildsizes buildsizes-diff
|
||||||
|
|
||||||
|
export ELFFILE ?= $(BINDIR)$(PROJECT).elf
|
||||||
|
export HEXFILE ?= $(ELFFILE:.elf=.hex)
|
||||||
|
|
||||||
## make script for your application. Build RIOT-base here!
|
## make script for your application. Build RIOT-base here!
|
||||||
all: $(BINDIR)$(PROJECT).elf
|
all: $(BINDIR)$(PROJECT).a
|
||||||
$(AD)$(SIZE) $(BINDIR)$(PROJECT).elf
|
@echo "Building application $(PROJECT) for $(BOARD) w/ MCU $(MCU)."
|
||||||
$(AD)$(OBJCOPY) $(OFLAGS) $(BINDIR)$(PROJECT).elf $(BINDIR)$(PROJECT).hex
|
"$(MAKE)" -C $(RIOTBOARD)/$(BOARD)
|
||||||
|
"$(MAKE)" -C $(RIOTBASE)
|
||||||
|
ifeq ($(BUILDOSXNATIVE),1)
|
||||||
|
$(AD)$(LINK) $(UNDEF) -o $(ELFFILE) $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie
|
||||||
|
else
|
||||||
|
$(AD)$(LINK) $(UNDEF) -o $(ELFFILE) -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(BINDIR)$(PROJECT).map $(LINKFLAGS)
|
||||||
|
endif
|
||||||
|
$(AD)$(SIZE) $(ELFFILE)
|
||||||
|
$(AD)$(OBJCOPY) $(OFLAGS) $(ELFFILE) $(HEXFILE)
|
||||||
|
|
||||||
## your make rules
|
## your make rules
|
||||||
## Only basic example - modify it for larger applications!!
|
## Only basic example - modify it for larger applications!!
|
||||||
@ -83,16 +94,6 @@ SRC = $(wildcard *.c)
|
|||||||
# string array of all names replaced .c with .o
|
# string array of all names replaced .c with .o
|
||||||
OBJ = $(SRC:%.c=${BINDIR}${PROJECT}/%.o)
|
OBJ = $(SRC:%.c=${BINDIR}${PROJECT}/%.o)
|
||||||
|
|
||||||
$(BINDIR)$(PROJECT).elf: $(BINDIR)$(PROJECT).a
|
|
||||||
@echo "Building application $(PROJECT) for $(BOARD) w/ MCU $(MCU)."
|
|
||||||
"$(MAKE)" -C $(RIOTBOARD)/$(BOARD)
|
|
||||||
"$(MAKE)" -C $(RIOTBASE)
|
|
||||||
ifeq ($(BUILDOSXNATIVE),1)
|
|
||||||
$(AD)$(LINK) $(UNDEF) -o $@ $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie
|
|
||||||
else
|
|
||||||
$(AD)$(LINK) $(UNDEF) -o $@ -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(BINDIR)$(PROJECT).map $(LINKFLAGS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(BINDIR)$(PROJECT).a: $(OBJ)
|
$(BINDIR)$(PROJECT).a: $(OBJ)
|
||||||
$(AD)$(AR) -rc $(BINDIR)$(PROJECT).a $(OBJ)
|
$(AD)$(AR) -rc $(BINDIR)$(PROJECT).a $(OBJ)
|
||||||
|
|
||||||
@ -120,7 +121,7 @@ $(RIOTBASE)/pkg/%/Makefile.include::
|
|||||||
$(BINDIR)$(PROJECT)/%.o: %.c $(PROJDEPS) $(USEPKG:%=${BINDIR}%.a)
|
$(BINDIR)$(PROJECT)/%.o: %.c $(PROJDEPS) $(USEPKG:%=${BINDIR}%.a)
|
||||||
@echo; echo "Compiling.... $*.c"; echo
|
@echo; echo "Compiling.... $*.c"; echo
|
||||||
$(AD)mkdir -p "$(dir $@)"
|
$(AD)mkdir -p "$(dir $@)"
|
||||||
$(ADD)$(CC) $(CFLAGS) $(INCLUDES) -c "$<" -o "$@"
|
$(AD)$(CC) $(CFLAGS) $(INCLUDES) -c "$<" -o "$@"
|
||||||
|
|
||||||
$(USEPKG:%=${BINDIR}%.a)::
|
$(USEPKG:%=${BINDIR}%.a)::
|
||||||
@mkdir -p ${BINDIR}
|
@mkdir -p ${BINDIR}
|
||||||
|
Loading…
Reference in New Issue
Block a user