Makefile (1199B)
1PREFIX ?= /usr/local 2BINDIR ?= /bin 3 4CFLAGS = -Wunused-function -Wunused-variable -Wconversion -Wswitch 5RAYLIB_SO ?= lib/raylib/build/raylib/libraylib.so 6RAYLIB_SO_DIR = $(shell dirname "$(RAYLIB_SO)") 7 8ifeq ($(DEBUG),1) 9CFLAGS += -Og -g 10else 11CFLAGS += -O2 12endif 13 14all: tis256 tis256-curses tis256-gui 15 16clean: 17 rm -f tis256 tis256-curses tis256-gui 18 19lib/raylib: 20 mkdir -p lib 21 git -C lib clone --tags https://github.com/raysan5/raylib.git 22 git -C lib/raylib checkout 4.5.0 23 24lib/raylib/build/raylib/libraylib.so: | lib/raylib 25 cmake -S lib/raylib -B lib/raylib/build -D BUILD_SHARED_LIBS=1 26 make -C lib/raylib/build raylib 27 28tis256: tis256.c tpu.c util.c asm.c tpu.h asm.h 29 $(CC) -o $@ tis256.c tpu.c util.c asm.c $(CFLAGS) 30 31tis256-curses: tis256-curses.c tpu.c util.c asm.c tpu.h asm.h 32 $(CC) -o $@ tis256-curses.c tpu.c util.c asm.c $(CFLAGS) -lncursesw 33 34tis256-gui: tis256-gui.c tpu.c util.c asm.c tpu.h asm.h $(RAYLIB_SO) 35 $(CC) -o $@ tis256-gui.c tpu.c util.c asm.c $(CFLAGS) -lraylib 36 37install: 38 install -m755 tis256 tis256-curses tis256-gui -t "$(DESTDIR)$(PREFIX)$(BINDIR)" 39 40uninstall: 41 rm -f "$(DESTDIR)$(PREFIX)$(BINDIR)"/{tis256,tis256-curses,tis256-gui} 42 43.PHONY: all clean install uninstall