aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2019-12-04 02:53:48 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2019-12-04 02:53:48 +0100
commitba2f81253c607fc5874d579ed7f891ec40156ad6 (patch)
tree89aae79c0b2efb812b01a55abc899780e0cbf64c /Makefile
parentREADME update (diff)
downloadlowbat-gnu-ba2f81253c607fc5874d579ed7f891ec40156ad6.tar.gz
lowbat-gnu-ba2f81253c607fc5874d579ed7f891ec40156ad6.tar.bz2
lowbat-gnu-ba2f81253c607fc5874d579ed7f891ec40156ad6.tar.xz
lowbat-gnu-ba2f81253c607fc5874d579ed7f891ec40156ad6.tar.zst
lowbat-gnu-ba2f81253c607fc5874d579ed7f891ec40156ad6.zip
Removed Makefile comments
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile68
1 files changed, 33 insertions, 35 deletions
diff --git a/Makefile b/Makefile
index d4b14a3..5df1dc0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,50 +1,49 @@
-#================================ Makefile ====================================#
.POSIX:
default: all
-#==============================================================================#
-#--------------------------------- Shell --------------------------------------#
-#==============================================================================#
+
+
+
SHELL := /bin/sh
-#==============================================================================#
-#------------------------------ Directories -----------------------------------#
-#==============================================================================#
+
+
+
SRCS_DIR = src/
INCS_DIR = inc/
OBJS_DIR = obj/
TRGT_DIR = bin/
-#==============================================================================#
-#--------------------------------- Files --------------------------------------#
-#==============================================================================#
+
+
+
SRCS = ${SRCS_DIR}main.cpp
SRCS += ${SRCS_DIR}jo_exec.cpp
SRCS += ${SRCS_DIR}jo_notify.cpp
-#------------------------------------------------------------------------------#
+
INCS = jo_lowbat.hpp
-#------------------------------------------------------------------------------#
+
OBJS = $(patsubst ${SRCS_DIR}%.cpp,${OBJS_DIR}%.o,${SRCS})
-#==============================================================================#
-#-------------------------------- Compiler ------------------------------------#
-#==============================================================================#
+
+
+
CC = g++
-#------------------------------------------------------------------------------#
+
DEBUG = -g3
FSANITIZE = -fsanitize=address
-#------------------------------------------------------------------------------#
+
OPTIMIZE = -O3
-#------------------------------------------------------------------------------#
+
CFLAGS = -Wall
CFLAGS += -Wextra
CFLAGS += -Werror
CFLAGS += ${OPTIMIZE}
-#------------------------------------------------------------------------------#
+
NAME = lowbat
-#==============================================================================#
-#--------------------------------- UNIX ---------------------------------------#
-#==============================================================================#
+
+
+
MKDIR = mkdir -p
RM = rm -rf
-#------------------------------------------------------------------------------#
+
OS = $(shell uname -s)
ifeq ($(OS), Darwin)
PREFIX = /usr/local
@@ -52,37 +51,36 @@ else
PREFIX = /usr
endif
MANPREFIX = $(PREFIX)/share/man
-#==============================================================================#
-#--------------------------------- Rules --------------------------------------#
-#==============================================================================#
+
+
+
${OBJS_DIR}%.o: ${SRCS_DIR}%.cpp ${INCS_DIR}${INCS}
@${MKDIR} ${OBJS_DIR}
${CC} ${CFLAGS} -I${INCS_DIR} -c -o $@ $<
-#------------------------------------------------------------------------------#
+
${NAME}: ${OBJS}
@${MKDIR} ${TRGT_DIR}
${CC} ${CFLAGS} -o ${TRGT_DIR}${NAME} ${OBJS}
-#------------------------------------------------------------------------------#
+
all: ${NAME}
-#------------------------------------------------------------------------------#
+
clean:
${RM} ${OBJS_DIR}
-#------------------------------------------------------------------------------#
+
fclean: clean
${RM} ${TRGT_DIR}
-#------------------------------------------------------------------------------#
+
re: fclean all
-#------------------------------------------------------------------------------#
+
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f bin/lowbat $(DESTDIR)$(PREFIX)/bin/
chmod 755 $(DESTDIR)$(PREFIX)/bin/lowbat
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
cp -f man/lowbat.1 $(DESTDIR)$(MANPREFIX)/man1/lowbat.1
-#------------------------------------------------------------------------------#
+
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/lowbat
rm -f $(DESTDIR)$(MANPREFIX)/man1/lowbat.1
-#------------------------------------------------------------------------------#
+
.PHONY: all lowbat clean fclean re install uninstall
-#==================================== EOF =====================================#