2023-08-11 00:44:28 -04:00
|
|
|
|
2024-01-15 12:26:14 -05:00
|
|
|
CLI_src=src/uxn.c src/devices/system.c src/devices/console.c src/devices/file.c src/devices/datetime.c
|
2023-08-11 00:44:28 -04:00
|
|
|
EMU_src=${CLI_src} src/devices/screen.c src/devices/controller.c src/devices/mouse.c
|
|
|
|
|
|
|
|
RELEASE_flags=-DNDEBUG -O2 -g0 -s
|
2023-08-16 16:29:15 -04:00
|
|
|
DEBUG_flags=-std=c89 -D_POSIX_C_SOURCE=199309L -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-08-11 00:44:28 -04:00
|
|
|
|
2024-08-05 22:09:53 -04:00
|
|
|
PREFIX=${HOME}/.local
|
|
|
|
|
2024-07-15 16:40:10 -04:00
|
|
|
.PHONY: all debug dest run test install uninstall format clean grab archive
|
2023-08-11 11:27:24 -04:00
|
|
|
|
2023-08-11 12:04:13 -04:00
|
|
|
all: dest bin/uxnasm bin/uxncli bin/uxn11
|
2023-08-11 00:49:38 -04:00
|
|
|
|
|
|
|
dest:
|
2023-08-13 17:34:48 -04:00
|
|
|
@ mkdir -p bin
|
2024-02-22 18:47:44 -05:00
|
|
|
run: all bin/uxnasm bin/uxncli bin/uxn11
|
2024-08-05 22:09:53 -04:00
|
|
|
@ bin/uxn11
|
2024-07-15 14:15:21 -04:00
|
|
|
debug: bin/uxnasm-debug bin/uxncli-debug bin/uxn11-debug
|
|
|
|
@ bin/uxncli-debug bin/opctest.rom
|
2024-06-29 15:38:41 -04:00
|
|
|
test: all
|
2024-02-28 11:53:34 -05:00
|
|
|
@ bin/uxnasm -v && ./bin/uxncli -v && ./bin/uxn11 -v
|
|
|
|
@ bin/uxnasm etc/opctest.tal bin/opctest.rom
|
|
|
|
@ bin/uxncli bin/opctest.rom
|
2024-06-29 15:38:41 -04:00
|
|
|
install: all
|
2024-08-05 22:09:53 -04:00
|
|
|
@ mkdir -p ${PREFIX}/bin
|
|
|
|
@ cp bin/uxn11 bin/uxnasm bin/uxncli ${PREFIX}/bin
|
|
|
|
@ mkdir -p ${PREFIX}/share/man/man7
|
|
|
|
@ cp doc/man/uxntal.7 ${PREFIX}/share/man/man7
|
2023-08-11 11:34:30 -04:00
|
|
|
uninstall:
|
2023-08-13 17:34:48 -04:00
|
|
|
@ rm -f ~/bin/uxn11 ~/bin/uxnasm ~/bin/uxncli
|
2023-08-11 11:34:30 -04:00
|
|
|
format:
|
2023-08-13 17:34:48 -04:00
|
|
|
@ clang-format -i src/uxnasm.c src/uxncli.c src/uxn11.c src/devices/*
|
2024-07-15 16:40:10 -04:00
|
|
|
grab:
|
|
|
|
@ cp ../uxn-utils/cli/opctest/opctest.tal etc/opctest.tal
|
2024-03-28 22:56:40 -04:00
|
|
|
archive:
|
|
|
|
@ cp src/uxnasm.c ../oscean/etc/uxnasm.c.txt
|
2023-08-11 11:34:30 -04:00
|
|
|
clean:
|
2024-02-22 18:47:44 -05:00
|
|
|
@ rm -fr bin
|
2023-08-11 00:44:28 -04:00
|
|
|
|
2023-08-11 12:04:13 -04:00
|
|
|
bin/uxnasm: src/uxnasm.c
|
2023-11-11 12:17:24 -05:00
|
|
|
@ cc ${RELEASE_flags} ${CFLAGS} src/uxnasm.c -o bin/uxnasm
|
2023-08-11 12:04:13 -04:00
|
|
|
bin/uxncli: ${CLI_src} src/uxncli.c
|
2024-06-29 15:38:41 -04:00
|
|
|
@ cc ${RELEASE_flags} ${CFLAGS} ${CLI_src} src/uxncli.c -lutil -o bin/uxncli
|
2023-08-11 12:04:13 -04:00
|
|
|
bin/uxn11: ${EMU_src} src/uxn11.c
|
2024-06-29 15:38:41 -04:00
|
|
|
@ cc ${RELEASE_flags} ${CFLAGS} ${EMU_src} src/uxn11.c -lX11 -lutil -o bin/uxn11
|
2024-07-15 14:26:38 -04:00
|
|
|
|
2024-07-15 14:15:21 -04:00
|
|
|
bin/uxnasm-debug: src/uxnasm.c
|
2024-07-15 14:26:38 -04:00
|
|
|
@ cc ${DEBUG_flags} ${CFLAGS} src/uxnasm.c -o bin/uxnasm-debug
|
2024-07-15 14:15:21 -04:00
|
|
|
bin/uxncli-debug: ${CLI_src} src/uxncli.c
|
2024-07-15 14:26:38 -04:00
|
|
|
@ cc ${DEBUG_flags} ${CFLAGS} ${CLI_src} src/uxncli.c -lutil -o bin/uxncli-debug
|
2024-07-15 14:15:21 -04:00
|
|
|
bin/uxn11-debug: ${EMU_src} src/uxn11.c
|
2024-07-15 14:26:38 -04:00
|
|
|
@ cc ${DEBUG_flags} ${CFLAGS} ${EMU_src} src/uxn11.c -lX11 -lutil -o bin/uxn11-debug
|