forked from Qortal/Brooklyn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
53 lines
1.2 KiB
# Makefile for reGNUal |
|
|
|
PROJECT = regnual |
|
|
|
OBJS = regnual.o usb-stm32f103.o reset.o |
|
|
|
include ../src/config.mk |
|
|
|
LDSCRIPT= regnual.ld |
|
|
|
################################### |
|
MCU = cortex-m3 |
|
|
|
TRGT = arm-none-eabi- |
|
CC = $(TRGT)gcc |
|
LD = $(TRGT)ld |
|
OBJCOPY = $(TRGT)objcopy |
|
OBJDUMP = $(TRGT)objdump |
|
|
|
# THUMB-specific options here |
|
TOPT = -mthumb -DTHUMB -mno-thumb-interwork |
|
# Define C warning options here |
|
CWARN = -Wall -Wextra -Wstrict-prototypes |
|
MCFLAGS= -mcpu=$(MCU) |
|
DEFS += -DFREE_STANDING |
|
|
|
CFLAGS = -O2 -g |
|
CFLAGS += -Wa,-alms=$(notdir $(<:.c=.lst)) -fpie |
|
CFLAGS += $(CWARN) -I . -I ../chopstx -fno-common $(MCFLAGS) $(TOPT) $(DEFS) |
|
|
|
LDFLAGS = -T$(LDSCRIPT) -nostartfiles $(MCFLAGS) $(TOPT) |
|
|
|
|
|
#################### |
|
|
|
all: regnual.hex |
|
|
|
regnual.o: regnual.c ../chopstx/sys.h ../chopstx/usb_lld.h |
|
|
|
regnual.hex: regnual.elf |
|
$(OBJCOPY) -Obinary regnual.elf regnual.bin |
|
$(OBJCOPY) -Oihex regnual.elf regnual.hex |
|
|
|
usb-stm32f103.o: ../chopstx/mcu/usb-stm32f103.c |
|
$(CC) $(CFLAGS) -c -o usb-stm32f103.o ../chopstx/mcu/usb-stm32f103.c |
|
|
|
regnual.elf: $(OBJS) $(LDSCRIPT) |
|
$(CC) $(LDFLAGS) -o regnual.elf $(OBJS) |
|
|
|
clean: |
|
-rm -f $(OBJS) regnual.elf regnual.hex regnual.bin *.lst |
|
|
|
distclean: clean
|
|
|