diff options
author | Joe <bousset.rudy@gmail.com> | 2019-12-03 20:40:22 +0100 |
---|---|---|
committer | Joe <bousset.rudy@gmail.com> | 2019-12-03 20:40:22 +0100 |
commit | 103970e14215254f60e1eddc93f2a2342c7eb344 (patch) | |
tree | 1347ae7f3eafbc468ef619adaf749cdeae244186 | |
parent | cpp mode (diff) | |
download | lowbat-gnu-103970e14215254f60e1eddc93f2a2342c7eb344.tar.gz lowbat-gnu-103970e14215254f60e1eddc93f2a2342c7eb344.tar.bz2 lowbat-gnu-103970e14215254f60e1eddc93f2a2342c7eb344.tar.xz lowbat-gnu-103970e14215254f60e1eddc93f2a2342c7eb344.tar.zst lowbat-gnu-103970e14215254f60e1eddc93f2a2342c7eb344.zip |
Makefile update
-rw-r--r-- | Makefile | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -2,10 +2,11 @@ default: all -SHELL +SHELL := /bin/sh SRCS_DIR = src/ INCS_DIR = inc/ OBJS_DIR = obj/ +TRGT_DIR = bin/ SRCS = ${SRCS_DIR}main.cpp SRCS += ${SRCS_DIR}jo_exec.cpp @@ -25,7 +26,11 @@ FSANITIZE = -fsanitize=address OPTIMIZE = -O2 -TARGET = lowbat +CFLAGS += ${OPTIMIZE} + +NAME = ${TRGT_DIR}lowbat + +MKDIR = mkdir -p OS = $(shell uname -s) ifeq ($(OS), Darwin) @@ -35,7 +40,15 @@ else endif MANPREFIX = $(PREFIX)/share/man -install: +${OBJS_DIR}%.o: ${SRCS_DIR}%.cpp ${INCS_DIR}${INCS} + @${MKDIR} ${OBJS_DIR} + +${NAME}: ${OBJS} + ${CC} ${CFLAGS} -o ${TARGET} ${OBJS} + +all: + @${MAKE} -j5 ${NAME} +install: all mkdir -p $(DESTDIR)$(PREFIX)/bin cp -f bin/lowbat $(DESTDIR)$(PREFIX)/bin/ chmod 755 $(DESTDIR)$(PREFIX)/bin/lowbat |