shithub: 9pro

ref: d71f219b73e3d6ed9875832717afc0f90b60734a
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: progs
	install -d ${BIN}
	install -m 755 ${PROG} ${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