SRC = neofish.c
OBJ = ${SRC:.c=.o}
CFLAGS = -std=c99 -pedantic -Wall -Wextra -O2
LIBS = ${shell pkg-config --libs raylib}
CC = cc
PREFIX = /usr/local

all: neofish

.c.o:
	${CC} -c ${CFLAGS} ${LIBS} $<

neofish: ${OBJ}
	${CC} -o $@ ${OBJ} ${LIBS}

install: all
	mkdir -p ${PREFIX}/bin
	cp -f neofish ${PREFIX}/bin
	chmod 755 ${PREFIX}/bin/neofish
	cp -r assets ${PREFIX}/bin

clean:
	rm -f neofish ${OBJ}

test: neofish
	./neofish

uninstall:
	rm -f ${PREFIX}/bin/neofish

.PHONY: all clean install uninstall
