kwh-cost/Makefile

26 lines
511 B
Makefile

TARGET=kwh-cost
CFLAGS=--std=c2x -O3 -Wall -Werror -Wextra -pedantic
SRC_DIR=src
OBJ_DIR=obj
DESTDIR=/
.PHONY: all ${TARGET} clean install uninstall
all: ${TARGET}
${TARGET}: ${SRC_DIR}/main.c ${SRC_DIR}/main.h
${CC} ${CFLAGS} ${LDFLAGS} $< -o $@
clean:
rm ${TARGET}
install:
install -Dm755 ${TARGET} ${DESTDIR}usr/bin/${TARGET}
install -Dm644 LICENSE ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE
uninstall:
rm -f ${DESTDIR}usr/bin/${TARGET}
rm -f ${DESTDIR}usr/share/licenses/${TARGET}/LICENSE