forked from keirf/flashfloppy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (57 loc) · 1.83 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
PROJ = FlashFloppy
VER = v0.6.1a
SUBDIRS += src bootloader reloader
.PHONY: all clean flash start serial gotek touch
ifneq ($(RULES_MK),y)
export ROOT := $(CURDIR)
all:
$(MAKE) -C src -f $(ROOT)/Rules.mk $(PROJ).elf $(PROJ).bin $(PROJ).hex
$(MAKE) -C bootloader -f $(ROOT)/Rules.mk \
Bootloader.elf Bootloader.bin Bootloader.hex
$(MAKE) -C reloader -f $(ROOT)/Rules.mk \
Reloader.elf Reloader.bin Reloader.hex
srec_cat bootloader/Bootloader.hex -Intel src/$(PROJ).hex -Intel \
-o FF.hex -Intel
python ./scripts/mk_update.py src/$(PROJ).bin FF.upd
python ./scripts/mk_update.py bootloader/Bootloader.bin BL.rld
python ./scripts/mk_update.py reloader/Reloader.bin RL.upd
clean:
rm -f *.hex *.upd *.rld
$(MAKE) -f $(ROOT)/Rules.mk $@
gotek: export gotek=y
gotek: all
mv FF.upd FF_Gotek-$(VER).upd
mv FF.hex FF_Gotek-$(VER).hex
mv BL.rld FF_Gotek-Bootloader-$(VER).rld
mv RL.upd FF_Gotek-Reloader-$(VER).upd
touch: export touch=y
touch: all
dist:
rm -rf flashfloppy_*
mkdir -p flashfloppy_$(VER)/reloader
mkdir -p flashfloppy_$(VER)/alt
$(MAKE) clean
$(MAKE) gotek
cp -a FF_Gotek-$(VER).upd flashfloppy_$(VER)/
cp -a FF_Gotek-$(VER).hex flashfloppy_$(VER)/
cp -a FF_Gotek-Reloader-$(VER).upd flashfloppy_$(VER)/reloader/
cp -a FF_Gotek-Bootloader-$(VER).rld flashfloppy_$(VER)/reloader/
$(MAKE) clean
font_7x16=y $(MAKE) gotek
mv FF_Gotek-$(VER).upd FF_Gotek-7x16-$(VER).upd
cp -a FF_Gotek-7x16-$(VER).upd flashfloppy_$(VER)/alt/
$(MAKE) clean
cp -a COPYING flashfloppy_$(VER)/
cp -a README.md flashfloppy_$(VER)/
cp -a RELEASE_NOTES flashfloppy_$(VER)/
zip -r flashfloppy_$(VER).zip flashfloppy_$(VER)
mrproper: clean
rm -rf flashfloppy_*
endif
BAUD=115200
flash:
sudo stm32flash -b $(BAUD) -w FF_Gotek-$(VER).hex /dev/ttyUSB0
start:
sudo stm32flash -b $(BAUD) -g 0 /dev/ttyUSB0
serial:
sudo miniterm.py /dev/ttyUSB0 3000000