Compare commits

..

No commits in common. "master" and "v2.2" have entirely different histories.
master ... v2.2

View File

@ -1,5 +1,5 @@
################################Shimatta Makefile####################################
#CPU: STM32F030F4P6
#CPU: STM32F030
#Compiler: arm-none-eabi
#####################################################################################
@ -31,11 +31,10 @@ mapfile = memmap
###################################################################################
CROSS_COMPILE ?= arm-none-eabi-
CC := $(CROSS_COMPILE)gcc
OBJCOPY := $(CROSS_COMPILE)objcopy
OBJDUMP := $(CROSS_COMPILE)objdump
SIZE := $(CROSS_COMPILE)size
CC=arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy
OBJDUMP=arm-none-eabi-objdump
SIZE=arm-none-eabi-size
LFLAGS = -mlittle-endian -mthumb -mcpu=cortex-m0 -mthumb-interwork
LFLAGS += -mfloat-abi=soft --disable-newlib-supplied-syscalls -nostartfiles
@ -51,6 +50,8 @@ ASOBJ = $(ASFILES:%.S=$(OBJDIR)/%.S.o)
default: $(target).elf
binary: $(target).bin $(target).hex
%.bin: %.elf
$(OBJCOPY) -O binary $^ $@
%.hex: %.elf
@ -64,16 +65,18 @@ $(target).elf: $(OBJ) $(ASOBJ)
#Compiling
$(OBJ):
@echo [CC] $@
@mkdir -p $(@D)
@echo Compiling $@
$(eval OUTPATH=$(dir $@))
@mkdir -p $(OUTPATH)
$(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:$(OBJDIR)/%.c.o=%.c)
$(ASOBJ):
@echo [AS] $@
@mkdir -p $(@D)
@echo Compiling $@
$(eval OUTPATH=$(dir $@))
@mkdir -p $(OUTPATH)
$(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:$(OBJDIR)/%.S.o=%.S)
.PHONY: clean mrproper objcopy disassemble binary
.PHONY: qtproject clean mrproper objcopy disassemble
disassemble: $(target).elf
$(OBJDUMP) -D -s $< > $(target).lss
@ -83,12 +86,19 @@ objcopy: $(target).bin $(target).hex
mrproper:
rm -f $(target).pro
binary: $(target).bin $(target).hex
clean:
@echo [CLEAN] $(OBJDIR)
@rm -f $(target).elf $(target).bin $(target).hex $(OBJ) $(ASOBJ) $(mapfile).map $(target).lss
@rm -rf $(OBJDIR)/*
rm -f $(target).elf $(target).bin $(target).hex $(OBJ) $(ASOBJ) $(mapfile).map $(target).lss
rm -rfv $(OBJDIR)
qtproject:
echo -e "TEMPLATE = app\nCONFIG -= console app_bundle qt" > $(target).pro
echo -e "SOURCES += $(CFILES) $(ASFILES)" >> $(target).pro
echo -ne "INCLUDEPATH += " >> $(target).pro
echo "$(INCLUDEPATH)" | sed "s!-I!./!g" >> $(target).pro
echo -ne "HEADERS += " >> $(target).pro
find -name "*.h" | tr "\\n" " " >> $(target).pro
echo -ne "\nDEFINES += " >> $(target).pro
echo "$(DEFINES)" | sed "s/-D//g" >> $(target).pro
-include $(CFILES:%.c=$(OBJDIR)/%.c.d) $(ASFILES:%.S=$(OBJDIR)/%.S.d)