maurosmartins Posted September 30, 2021 at 03:13 PM Report Share #623982 Posted September 30, 2021 at 03:13 PM Boa tarde a todos, estive a tentar fazer um makefile para poder compilar e carregar SW para um microcontrolador STM8. Apesar de estar a funcionar compila sempre todos os arquivos e não apenas os alterados, gostaria de perguntar se podiam ajudar a ter o comportamento esperado. Aqui está o conteúdo do makefile: PROJ_NAME=workingproject MICRO=STM8L15xC8 PROGRAMMER=STVP_CmdLine # Compiler CC=cxstm8 # Flags for compiler CFLAGS=+mods0 -pp -dSTM8L15X_HD -iinc -isrc -i"C:\Program Files (x86)\COSMIC\FSE_Compilers\Hstm8" -clRelease\ -coRelease\ # .c files C_SOURCE=$(wildcard *.c) C_SOURCE+=$(wildcard src/*.c) # .h files H_SOURCE=$(wildcard *.h) H_SOURCE+=$(wildcard inc/*.h) # Object files objects=$(C_SOURCE:c=o) %.o : %.c $(CC) $(CFLAGS) $? #target : prerequisites #<TAB>recipe #all : $(PROJ_NAME).sm8 $(PROJ_NAME).sm8 : $(objects) clnk -l"C:\Program Files (x86)\COSMIC\FSE_Compilers\Lib" -o Release\$(PROJ_NAME).sm8 Release\eso.lkf chex -o Release\$(PROJ_NAME).s19 Release\$(PROJ_NAME).sm8 .PHONY : load load: STVP_CmdLine -BoardName=ST-LINK -Port=USB -ProgMode=SWIM -Device=$(MICRO) -no_log -no_loop -no_warn_protect -verif -FileProg=Release\$(PROJ_NAME).s19 desde já obrigado, Mauro. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now