/
Makefile
63 lines (47 loc) · 1.59 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
##############################################################################
#
# CPC FPGA
#
##############################################################################
PROJECTS = $(wildcard projects/*)
DIRS = sidecar2 client $(PROJECTS)
BUILDDIRS = $(DIRS:%=build-%)
CLEANDIRS = $(DIRS:%=clean-%)
all: build-client build-bitstreams
build: $(BUILDDIRS) build-bitstreams
$(BUILDDIRS):
$(MAKE) -C $(@:build-%=%)
clean: $(CLEANDIRS)
$(CLEANDIRS):
$(MAKE) -C $(@:clean-%=%) clean
.PHONY: $(DIRS)
sidecar2: build-sidecar2
client: build-client
bitstreams: build-bitstreams
#PROJSTREAMS = $(patsubst projects/%,bitstreams/%.fpg,$(PROJECTS))
#bitstreams: $(PROJSTREAMS)
build-bitstreams: $(patsubst projects/%,bitstreams/%.fpg,$(PROJECTS))
bitstreams/%.fpg: build-projects/% build-client
client/prepare_direct_load <$(<:build-projects/%=projects/%)/$(<:build-projects/%=%.mcs) $@
##############################################################################
#
# Specific common operations
scan: build-client
client/scan
log: build-client
client/log
dump: build-client
client/prom_dump
dfu: build-sidecar2 build-client
client/bootloader || true
make -C sidecar2 dfu
reload: build-client
client/prom_reload
reset: build-client
client/avr_reset || dfu-programmer atmega32u2 start
#%.load: bitstreams/%.fpg build-client
# client/fpga_direct_load <$<
%.load: build-projects/% build-client
client/fpga_direct_load <$(<:build-projects/%=projects/%)/$(<:build-projects/%=%.mcs)
%.program: build-projects/% build-client
client/prom_erase_program <$(<:build-projects/%=projects/%)/$(<:build-projects/%=%.mcs)