2023-12-15 19:31:57 +00:00
|
|
|
SRC=src/uxn.c src/devices/system.c src/devices/console.c src/devices/screen.c src/devices/controller.c src/devices/mouse.c src/devices/file.c src/devices/datetime.c
|
2023-12-15 20:43:07 +00:00
|
|
|
TMP=src/roms/menu.c src/roms/potato.c src/roms/wallpaper.c
|
2023-12-05 03:43:16 +00:00
|
|
|
RELEASE_flags=-std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas
|
|
|
|
DEBUG_flags=-std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined
|
2023-12-01 04:50:18 +00:00
|
|
|
ASM=bin/uxnasm
|
2023-12-15 20:29:58 +00:00
|
|
|
CLI=bin/uxncli
|
2023-11-30 00:08:22 +00:00
|
|
|
|
2023-12-17 18:11:13 +00:00
|
|
|
.PHONY: all dest run lint install uninstall format clean
|
2023-11-30 00:08:22 +00:00
|
|
|
|
2023-12-15 20:29:58 +00:00
|
|
|
all: bin/uxnasm bin/uxncli bin/porporo
|
2023-11-30 00:08:22 +00:00
|
|
|
|
2023-12-15 20:29:58 +00:00
|
|
|
run: all bin/log.rom
|
2023-12-05 04:27:46 +00:00
|
|
|
@ bin/porporo bin/log.rom
|
2023-12-17 18:11:13 +00:00
|
|
|
|
2023-12-01 04:50:18 +00:00
|
|
|
install: all
|
2023-11-30 00:08:22 +00:00
|
|
|
@ cp bin/porporo ~/bin/
|
2023-12-17 18:11:13 +00:00
|
|
|
|
2023-11-30 00:08:22 +00:00
|
|
|
uninstall:
|
|
|
|
@ rm -f ~/bin/porporo
|
2023-12-17 18:11:13 +00:00
|
|
|
|
2023-11-30 00:08:22 +00:00
|
|
|
format:
|
|
|
|
@ clang-format -i src/porporo.c src/devices/*
|
2023-12-17 18:11:13 +00:00
|
|
|
|
|
|
|
lint:
|
|
|
|
@ ${CLI} ~/roms/uxnlin.rom src/utils/menu.tal
|
|
|
|
@ ${CLI} ~/roms/uxnlin.rom src/utils/wallpaper.tal
|
|
|
|
@ ${CLI} ~/roms/uxnlin.rom src/utils/potato.tal
|
|
|
|
@ ${CLI} ~/roms/uxnlin.rom src/utils/log.tal
|
|
|
|
|
2023-11-30 00:08:22 +00:00
|
|
|
clean:
|
|
|
|
@ rm -f bin/*
|
2023-12-15 20:43:07 +00:00
|
|
|
@ rm -f src/roms/*
|
2023-11-30 00:08:22 +00:00
|
|
|
|
2023-12-15 19:31:57 +00:00
|
|
|
bin/uxnasm: src/uxnasm.c
|
2023-12-15 20:29:58 +00:00
|
|
|
@ mkdir -p bin
|
|
|
|
@ cc ${RELEASE_flags} src/uxnasm.c -o ${ASM}
|
2023-12-17 18:11:13 +00:00
|
|
|
|
|
|
|
bin/uxncli: src/uxncli.c
|
|
|
|
@ mkdir -p src/roms
|
|
|
|
@ cc ${RELEASE_flags} ${SRC} src/uxncli.c -o ${CLI}
|
|
|
|
|
2023-12-15 20:29:58 +00:00
|
|
|
bin/format-c.rom: src/utils/format-c.tal
|
|
|
|
@ ${ASM} src/utils/format-c.tal bin/format-c.rom
|
2023-12-17 18:11:13 +00:00
|
|
|
|
|
|
|
src/roms/menu.c: bin/format-c.rom src/utils/menu.tal src/utils/menu.assets.tal
|
2023-12-01 04:50:18 +00:00
|
|
|
@ ${ASM} src/utils/menu.tal bin/menu.rom
|
2023-12-15 20:43:07 +00:00
|
|
|
@ ${CLI} bin/format-c.rom bin/menu.rom > src/roms/menu.c
|
2023-12-17 18:11:13 +00:00
|
|
|
|
|
|
|
src/roms/potato.c: bin/format-c.rom src/utils/potato.tal src/utils/potato.assets.tal
|
|
|
|
@ ${ASM} src/utils/potato.tal bin/potato.rom
|
2023-12-15 20:43:07 +00:00
|
|
|
@ ${CLI} bin/format-c.rom bin/potato.rom > src/roms/potato.c
|
2023-12-17 18:11:13 +00:00
|
|
|
|
|
|
|
src/roms/wallpaper.c: bin/format-c.rom src/utils/wallpaper.tal
|
|
|
|
@ ${ASM} src/utils/wallpaper.tal bin/wallpaper.rom
|
2023-12-15 20:43:07 +00:00
|
|
|
@ ${CLI} bin/format-c.rom bin/wallpaper.rom > src/roms/wallpaper.c
|
2023-12-17 18:11:13 +00:00
|
|
|
|
|
|
|
bin/porporo: ${SRC} ${TMP} src/porporo.c
|
2023-12-15 21:00:46 +00:00
|
|
|
@ cc ${RELEASE_flags} ${SRC} src/porporo.c -L/usr/local/lib -lSDL2 -o bin/porporo
|
2023-12-17 18:11:13 +00:00
|
|
|
|
2023-12-03 01:17:06 +00:00
|
|
|
bin/log.rom: src/utils/log.tal src/utils/log.assets.tal
|
2023-12-01 04:50:18 +00:00
|
|
|
@ ${ASM} src/utils/log.tal bin/log.rom
|
|
|
|
|