This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·84 lines (68 loc) · 1.54 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
DEVICE := /media/$(USER)/CIRCUITPY/
ifeq ($(wildcard $(DEVICE).),)
DEVICE := /run/media/$(USER)/CIRCUITPY/
endif
MPYCROSS = ./bin/mpy-cross
LIB = pico_synth_sandbox
LIB_SRCS := \
__init__ \
tasks \
board \
display \
encoder \
audio \
midi \
keyboard/__init__ \
keyboard/touch \
keyboard/ton_touch \
timer \
arpeggiator \
sequencer \
waveform \
synth \
voice/__init__ \
voice/oscillator \
voice/drum \
voice/sample \
microphone \
menu
LIB_MPY = $(LIB_SRCS:%=$(LIB)/%.mpy)
SRCS := boot.py
SETTINGS = settings.toml
SAMPLES_DIR = ./samples
SAMPLES := $(shell find $(SAMPLES_DIR) -type f)
all: package
compile: clean $(LIB_MPY:%=./%)
upload: compile src lib requirements settings samples
update: compile src lib requirements
package: compile zip
clean:
@rm $(LIB_MPY) || true
%.mpy: %.py
$(MPYCROSS) -o $@ $<
src: $(SRCS)
@for file in $^ ; do \
echo $${file} "=>" $(DEVICE)$${file} ; \
cp $${file} $(DEVICE)$${file} ; \
done
lib: $(LIB_MPY)
@mkdir $(DEVICE)lib/$(LIB) || true
@mkdir $(DEVICE)lib/$(LIB)/keyboard || true
@mkdir $(DEVICE)lib/$(LIB)/voice || true
@for file in $^ ; do \
echo ./$${file} "=>" $(DEVICE)lib/$${file} ; \
cp ./$${file} $(DEVICE)lib/$${file} ; \
done
requirements:
circup install -r requirements.txt
settings:
@echo $(SETTINGS) "=>" $(DEVICE)$(SETTINGS)
@cp $(SETTINGS) $(DEVICE)$(SETTINGS)
samples:
@mkdir $(DEVICE)$(SAMPLES_DIR) || true
@for file in $(SAMPLES) ; do \
echo $${file} "=>" $(DEVICE)$${file} ; \
cp $${file} $(DEVICE)$${file} ; \
done
zip:
zip ./$(LIB).zip $(LIB_MPY:%=./%)