aboutsummaryrefslogtreecommitdiffstats
path: root/support/ld/libcs3_stm32_src/Makefile
blob: d5275b9ba42395c61768405e812c16dc7fff0fee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# setup environment

TARGET_ARCH = -mcpu=cortex-m3 -mthumb

CC = arm-none-eabi-gcc
CFLAGS =

AS = $(CC) -x assembler-with-cpp -c $(TARGET_ARCH)
ASFLAGS =

AR = arm-none-eabi-ar
ARFLAGS = cr

LIB_OBJS = stm32_vector_table.o stm32_isrs.o start.o start_c.o

help:
	@echo "Targets:"
	@echo "\t medium-density: Target medium density chips (e.g. Maple)"
	@echo "\t high-density: Target high density chips (e.g. Maple-native)"

.PHONY: help medium high

medium-density: $(LIB_OBJS)
	$(AR) $(ARFLAGS) libcs3_stm32_med_density.a $(LIB_OBJS)
	rm -f $(LIB_OBJS)

high-density: CFLAGS := -DSTM32_HIGH_DENSITY
high-density: $(LIB_OBJS)
	$(AR) $(ARFLAGS) libcs3_stm32_high_density.a $(LIB_OBJS)
	rm -f $(LIB_OBJS)

# clean
.PHONY: clean
clean:
	-rm -f $(LIB_OBJS) *.a