shithub: qoistream

ref: 68a4d1cef5db92f15102ec14ae327430150e8d56
dir: /Makefile/

View raw version
TARG=qoirecv
DESTDIR?=
PREFIX?=/usr/local
BIN=${DESTDIR}${PREFIX}/bin
MAN=${DESTDIR}${PREFIX}/share/man/man1
SDL2_CFLAGS=$$(pkg-config --cflags sdl2)
SDL2_LDFLAGS=$$(pkg-config --libs sdl2)
CFLAGS?=-O2 -pipe -g -Wall
CFLAGS+=${SDL2_CFLAGS}
LDFLAGS?=
LDFLAGS+=${SDL2_LDFLAGS}

OBJS=\
	parg.o\
	qoirecv.o\

.PHONY: all default install uninstall clean

all: default

default: ${TARG}

install: ${TARG} ${TARG}.1
	install -d ${BIN}
	install -m 755 ${TARG} ${BIN}
	install -d ${MAN}
	install -m 644 ${TARG}.1 ${MAN}

uninstall:
	rm -f ${BIN}/${TARG}
	rm -f ${MAN}/${TARG}.1

${TARG}: ${OBJS}
	${CC} -o $@ ${OBJS} ${LDFLAGS}

.SUFFIXES: .c .o
.c.o:
	${CC} -o $@ -c $< ${CFLAGS}

clean:
	rm -f ${TARG} ${OBJS}