-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
134 lines (106 loc) · 2.64 KB
/
Makefile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
NAME = Jupiter
CC = arm-none-eabi-gcc
LD = arm-none-eabi-gcc
OBJCOPY = arm-none-eabi-objcopy
DEFINES = -DRGB8Pixels
#DEFINES = -DRGB8Pixels -DEnableOverclocking
C_OPTS = -std=c99 \
-mthumb \
-mcpu=cortex-m4 \
-ILibraries/CMSIS/Include \
-g \
-Werror \
-O3
LIBS = -lm
SOURCE_DIR = .
BUILD_DIR = Build
C_FILES = Audio.c \
BitBin.c \
Button.c \
CityText.c \
Cityscape.c \
Environment.c \
Fields.c \
HeightMap.c \
Jupiter1.c \
Jupiter3.c \
JupiterCyborg.c \
JupiterCyborg2Texture.c \
JupiterHands.c \
JupiterSVATG.c \
JupiterSVATGTexture.c \
LED.c \
LogoShow.c \
Main.c \
Mystery.c \
PixelParticles.c \
Pukezoomer.c \
Random.c \
Rasterize.c \
RayArray.c \
Starfield.c \
Startup.c \
System.c \
TestSong.c \
TorusTunnel.c \
Utils.c \
VGA.c \
Voxelscape.c \
Profiling.c \
bezier.c \
Credits.c \
warpfunc.c \
font.c \
Metablobs.c \
Blobs.c \
Cockpit.c \
CockpitSmall.c \
SvatgLogo.c \
Graphics/Bitmap.c \
Graphics/DrawingBitmaps.c \
Graphics/DrawingLines.c \
Graphics/DrawingPixels.c \
Graphics/DrawingRectangles.c \
Graphics/DrawingRLEBitmaps.c \
Graphics/DrawingStraightLines.c \
VectorLibrary/VectorFixed.c \
VectorLibrary/MatrixFixed.c \
FONT_FILES = \
bezier/font_enri.c \
bezier/font_geo.c \
bezier/font_led.c \
bezier/revision_logo.c \
bezier/rocket.c \
C_FILES += $(FONT_FILES)
S_FILES =
OBJS = $(C_FILES:%.c=$(BUILD_DIR)/%.o) $(S_FILES:%.S=$(BUILD_DIR)/%.o)
ALL_CFLAGS = $(C_OPTS) $(DEFINES) $(CFLAGS)
ALL_LDFLAGS = $(LD_FLAGS) -mthumb -mcpu=cortex-m4 -nostartfiles -Wl,-T,Linker.ld,--gc-sections -specs Terrible.specs
AUTODEPENDENCY_CFLAGS=-MMD -MF$(@:.o=.d) -MT$@
all: $(NAME).bin
upload: $(NAME).bin
openocd -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg \
-c init -c "reset halt" -c "stm32f2x mass_erase 0" \
-c "flash write_bank 0 $(NAME).bin 0" \
-c "reset run" -c shutdown
$(FONT_FILES): bezier/fontToBezier.py
cd bezier; python fontToBezier.py
debug:
arm-eabi-gdb $(NAME).elf \
--eval-command="target remote | openocd -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg -c 'gdb_port pipe'"
stlink:
arm-eabi-gdb $(NAME).elf --eval-command="target ext :4242"
clean:
rm -rf $(BUILD_DIR) $(NAME).elf $(NAME).bin
$(NAME).bin: $(NAME).elf
$(OBJCOPY) -O binary $(NAME).elf $(NAME).bin
$(NAME).elf: $(OBJS)
$(LD) $(ALL_LDFLAGS) -o $@ $^ $(LIBS)
.SUFFIXES: .o .c .S
$(BUILD_DIR)/%.o: $(SOURCE_DIR)/%.c
@mkdir -p $(dir $@)
$(CC) $(ALL_CFLAGS) $(AUTODEPENDENCY_CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SOURCE_DIR)/%.S
@mkdir -p $(dir $@)
$(CC) $(ALL_CFLAGS) $(AUTODEPENDENCY_CFLAGS) -c $< -o $@
-include $(OBJS:.o=.d)