Skip to content

Commit

Permalink
[src] update Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: LAMBS Pierre-Antoine <[email protected]>
  • Loading branch information
plambs committed Jan 12, 2017
1 parent 63a1849 commit 588b4f0
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,36 @@ all:$(BIN)
@echo "[ build $(BIN) ]"

%.o:%.c
@ echo Cross Compile
@ echo "[ Compile .c -> .o ]"
@$(CC) $(INCLUDE) $(CFLAGS) $< -o $@

$(ELF):$(OBJECTS)
@ echo Create ELF
@ echo "[ Create ELF ]"
@$(CC) -o $(ELF) $(OBJECTS) $(LDFLAGS)

$(BIN): $(LIBOPENCM3) $(ELF)
@ echo objcopy elf to bin
@ echo "[ objcopy elf to bin ]"
@ $(CP) $(CPFLAGS) $(ELF) $(BIN)

libopencm3:
@echo Build Libopencm3
@cd ../libopencm3/ && export PATH=$$PATH:$(shell pwd)/../toolchain/bin/ && $(MAKE)
@echo "[ Build Libopencm3 for stm32f1 ]"
@cd ../libopencm3/ && export PATH=$$PATH:$(shell pwd)/../toolchain/bin/ && $(MAKE) lib/stm32/f1

$(LIBOPENCM3):libopencm3

.PHONY:clean

dist_clean:clean clean_libopencm3
@echo "[ Clean ALL project ]"

clean:
@echo "[ clean project ]"
@echo "[ clean SRC ]"
@rm -f $(OBJECTS)
@rm -f $(BIN)
@rm -f $(ELF)

clean_libopencm3:
@echo Clean Libopencm3
@echo "[ Clean Libopencm3 ]"
@cd ../libopencm3/ && export PATH=$$PATH:$(shell pwd)/../toolchain/bin/ && $(MAKE) clean

write:$(ELF)
Expand Down

0 comments on commit 588b4f0

Please sign in to comment.