~alderwick/pico-uxn

ref: 2027e62d18d971eb8b1392c2283f5744e750c327 pico-uxn/Makefile -rw-r--r-- 1014 bytes
2027e62dAndrew Alderwick Update to latest Uxn. 8 months ago
                                                                                
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
.PHONY: all flash format clean distclean update

all: lib/pico-sdk/lib/tinyusb/.git uxn-boot.h lib/pico-sdk/.git
	cd build && cmake .. && $(MAKE)

build/uxnasm: lib/uxn/src/uxnasm.c lib/uxn/src/uxn.h
	mkdir -p build
	cc lib/uxn/src/uxnasm.c -std=c89 -Os -DNDEBUG -g0 -s -o $@

build/boot.rom: build/uxnasm lib/uxn/projects/examples/gui/animation.tal
	$^ $@

uxn-boot.h: build/boot.rom
	printf 'uint8_t uxn_boot_rom[] = {\n' > $@
	od -A n -t x1 $< | sed -e 's/\S\S/0x&, /g' >> $@
	printf '};\n' >> $@

lib/pico-sdk/.git:
	git submodule update --init

lib/pico-sdk/lib/tinyusb/.git: lib/pico-sdk/.git
	cd lib/pico-sdk && git submodule update --init

flash: all
	picotool load -v build/uxn.uf2
	picotool reboot

format:
	for F in $(wildcard *.c *.h plugins/*/*.c plugins/*/*.h); do clang-format -i "$${F}" || exit 1; done

clean:
	rm -rf build uxn-boot.h

distclean: clean
	git submodule deinit --all

update:
	git submodule foreach 'git fetch && { git reset --hard origin/master || git reset --hard origin/main; }'