Update Makefile to use dependency files
This commit is contained in:
parent
e882607fe8
commit
03daeeeb36
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ Debug
|
||||
*.user
|
||||
*.user.*
|
||||
*.lss
|
||||
*.d
|
||||
|
37
Makefile
37
Makefile
@ -16,6 +16,11 @@ DEFINES = -DSTM32F407xx -DSTM32F4XX -DARM_MATH_CM4
|
||||
mapfile = dafuqishappening
|
||||
|
||||
##Custom Files###
|
||||
ifneq ($(VERBOSE),true)
|
||||
QUIET=@
|
||||
else
|
||||
QUIET=
|
||||
endif
|
||||
|
||||
|
||||
CFILES += fatfs/option/syscall.c fatfs/option/ccsbcs.c fatfs/diskio.c fatfs/ff.c fatfs/shimatta_sdio_driver/shimatta_sdio.c
|
||||
@ -35,8 +40,8 @@ CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -nostartfiles -Wall -O0 -g3
|
||||
|
||||
####################################################################################
|
||||
|
||||
OBJ = $(CFILES:%.c=%.c.o)
|
||||
ASOBJ = $(ASFILES:%.S=%.S.o)
|
||||
OBJ = $(CFILES:%.c=%.o)
|
||||
ASOBJ = $(ASFILES:%.S=%.o)
|
||||
|
||||
default: $(target).elf
|
||||
|
||||
@ -44,35 +49,40 @@ default: $(target).elf
|
||||
|
||||
|
||||
%.bin: %.elf
|
||||
$(OBJCOPY) -O binary $^ $@
|
||||
$(QUIET)$(OBJCOPY) -O binary $^ $@
|
||||
%.hex: %.elf
|
||||
$(OBJCOPY) -O ihex $^ $@
|
||||
$(QUIET)$(OBJCOPY) -O ihex $^ $@
|
||||
|
||||
|
||||
#Linking
|
||||
$(target).elf: $(OBJ) $(ASOBJ)
|
||||
$(CC) $(LFLAGS) $(LIBRARYPATH) -o $@ $^ $(LIBRARIES)
|
||||
$(SIZE) $@
|
||||
@echo !!! Calling linker $@
|
||||
$(QUIET)$(CC) $(LFLAGS) $(LIBRARYPATH) -o $@ $^ $(LIBRARIES)
|
||||
$(QUIET)$(SIZE) $@
|
||||
|
||||
|
||||
#Compiling
|
||||
%.c.o: %.c
|
||||
$(CC) $(CFLAGS) $(INCLUDEPATH) $(DEFINES) -o $@ $<
|
||||
$(OBJ):
|
||||
@echo !!! Calling Compiler $@
|
||||
$(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:%.o=%.c)
|
||||
|
||||
%.S.o: %.S
|
||||
$(CC) $(CFLAGS) $(INCLUDEPATH) $(DEFINES) -o $@ $<
|
||||
$(ASOBJ):
|
||||
@echo !!! Calling Assembler $@
|
||||
$(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:%.o=%.S)
|
||||
|
||||
.PHONY: qtproject clean mrproper objcopy disassemble
|
||||
|
||||
disassemble: $(target).elf
|
||||
$(OBJDUMP) -D -s $< > $(target).lss
|
||||
$(QUIET)$(OBJDUMP) -D -s $< > $(target).lss
|
||||
|
||||
objcopy: $(target).bin $(target).hex
|
||||
|
||||
mrproper:
|
||||
rm -f $(target).pro
|
||||
$(QUIET)rm -f $(target).pro
|
||||
|
||||
clean:
|
||||
rm -f $(target).elf $(target).bin $(target).hex $(OBJ) $(ASOBJ) $(mapfile).map $(target).lss
|
||||
@echo cleaning up
|
||||
$(QUIET)rm -f $(target).elf $(target).bin $(target).hex $(OBJ) $(ASOBJ) $(mapfile).map $(target).lss $(CFILES:%.c=%.d) $(ASFILES:%.S=%.d)
|
||||
qtproject:
|
||||
echo -e "TEMPLATE = app\nCONFIG -= console app_bundle qt" > $(target).pro
|
||||
echo -e "SOURCES += $(CFILES) $(ASFILES)" >> $(target).pro
|
||||
@ -83,4 +93,5 @@ qtproject:
|
||||
echo -ne "\nDEFINES += " >> $(target).pro
|
||||
echo "$(DEFINES)" | sed "s/-D//g" >> $(target).pro
|
||||
|
||||
-include $(CFILES:%.c=%.d) $(ASFILES:%.S=%.d)
|
||||
|
||||
|
@ -97,3 +97,4 @@ extern void SystemCoreClockUpdate(void);
|
||||
* @}
|
||||
*/
|
||||
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
|
||||
|
||||
|
@ -11,7 +11,5 @@
|
||||
void initUART();
|
||||
void sendChar(char c);
|
||||
void sendString(char* s, int count);
|
||||
#ifdef _P20N_
|
||||
void yuri();
|
||||
#endif
|
||||
|
||||
#endif /* UART_UART_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user