This commit is contained in:
Alexander Andreev 2021-12-23 23:58:23 +04:00
parent 1a6312d3f6
commit 5edcbf9fa0
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F
1 changed files with 26 additions and 0 deletions

26
Makefile Normal file
View File

@ -0,0 +1,26 @@
TARGET=kwh-calc
CC=cc
CFLAGS=--std=c2x -O3 -Wall -Werror -Wextra -pedantic
SRC_DIR=src
OBJ_DIR=obj
all: ${TARGET}
${TARGET}: ${OBJ_DIR}/main.o
${CC} ${CFLAGS} $< -o $@
${OBJ_DIR}/main.o: ${SRC_DIR}/main.c ${SRC_DIR}/main.h
@mkdir -p ${OBJ_DIR}
${CC} ${CFLAGS} -c $< -o $@
clean:
rm -r ${OBJ_DIR}
rm ${TARGET}
install:
install -m 755 ${TARGET} /usr/local/bin/${TARGET}
uninstall:
rm -f /usr/local/bin/${TARGET}