shithub: 9pro

ref: 2c1651bd5b23d04b203daf52801dd9b84bb9f6a9
dir: /Makefile/

View raw version
PROGS=9pex 9gc
PREFIX?=/usr/local
BIN=${DESTDIR}${PREFIX}/bin
CFLAGS?=-g -O2
CFLAGS+=-std=c99 -Wall -Wextra -Wshadow -Ic9 -Iparg
PEX_O=9pex.o crc32.o
GC_O=9gc.o
COMMON_O=c9/c9.o parg/parg.o

all: default

default: 9pex 9gc

9pex: ${COMMON_O} ${PEX_O}
	${CC} -o $@ ${COMMON_O} ${PEX_O}

9gc: ${COMMON_O} ${GC_O}
	${CC} -o $@ ${COMMON_O} ${GC_O}

install: all
	install -d ${BIN}
	install -m 755 ${PROGS} ${BIN}

uninstall:
	cd ${BIN} && rm -f ${TARGET}

clean:
	rm -f ${PROGS} ${COMMON_O} ${PEX_O} ${GC_O}

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

.PHONY: all default install uninstall clean