aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-18 22:35:38 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-18 22:35:38 +0200
commite79dd10825f15111a961ff3afcfdec9c5c348f8b (patch)
tree83bb0f6c5ca70b05ff714b3ae1162dc655de21ac
parentAdded man (diff)
downloadlowbat-bsd-e79dd10825f15111a961ff3afcfdec9c5c348f8b.tar.gz
lowbat-bsd-e79dd10825f15111a961ff3afcfdec9c5c348f8b.tar.bz2
lowbat-bsd-e79dd10825f15111a961ff3afcfdec9c5c348f8b.tar.xz
lowbat-bsd-e79dd10825f15111a961ff3afcfdec9c5c348f8b.tar.zst
lowbat-bsd-e79dd10825f15111a961ff3afcfdec9c5c348f8b.zip
Man update
-rw-r--r--Makefile40
-rw-r--r--man/lowbat.18
2 files changed, 31 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index f97f5b1..b74e485 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,9 @@ default: all
# ====================================== DIRS ========================================== #
C_SRCS_DIR = src
A_SRCS_DIR = asm
+PREFIX ?= /usr/local
+BINPREFIX ?= ${PREFIX}/bin
+MANPREFIX ?= ${PREFIX}/share/man
# ====================================== FILES ========================================= #
C_SRCS = ${C_SRCS_DIR}/jo_lowbat.c
C_SRCS += ${C_SRCS_DIR}/jo_n_speak.c
@@ -32,7 +35,7 @@ A_OBJS = ${A_SRCS:.asm=.o}
# ===================================== COMPILER ======================================= #
CC = clang
# -------------------------------------------------------------------------------------- #
-CFLAGS = -std=c89
+CFLAGS += -std=c89
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Wno-comment
@@ -41,12 +44,8 @@ CFLAGS += -Wno-c99-extensions
CFLAGS += -Wno-variadic-macros
CFLAGS += -Werror
CFLAGS += -pedantic
-CFLAGS += ${DEBUG}
-# CFLAGS += ${OPTI}
+# CFLAGS += -O0 -glldb
# -------------------------------------------------------------------------------------- #
-OPTI = -O2 -pipe
-# -------------------------------------------------------------------------------------- #
-DEBUG = -glldb
# DEBUG += -fsanitize=address
# -------------------------------------------------------------------------------------- #
CINCS = -Isrc/
@@ -55,11 +54,13 @@ CINCS += -I/usr/local/include/glib-2.0
CINCS += -I/usr/local/lib/glib-2.0/include
CINCS += -I/usr/local/include/gdk-pixbuf-2.0
# -------------------------------------------------------------------------------------- #
-LINK = -L/usr/local/lib
-LINK += -L/usr/lib
-LINK += -lnotify
-LINK += -lespeak
-LINK += -lc
+LDFLAGS ?=
+LDLIBS = ${LDFLAGS}
+LDLIBS += -L/usr/local/lib
+LDLIBS += -L/usr/lib
+LDLIBS += -lnotify
+LDLIBS += -lespeak
+LDLIBS += -lc
# -------------------------------------------------------------------------------------- #
TARGET = lowbat
# ===================================== ASSEMBLER ====================================== #
@@ -70,12 +71,11 @@ ASMARCH = elf64
SHELL := /bin/sh
RM = rm -f
MKDIR = mkdir -p
-CP = cp
+CP = cp -pf
MV = mv
SED = sed
# ======================================= RULES ======================================== #
.SUFFIXES: .asm .c .o
-.PHONY: all clean fclean re depend
# -------------------------------------------------------------------------------------- #
.asm.o:
${ASM} ${ASMFLAGS} ${ASMARCH} -o ${.TARGET} ${.IMPSRC}
@@ -84,7 +84,7 @@ SED = sed
${CC} -c ${CFLAGS} ${CINCS} -o ${.TARGET} ${.IMPSRC}
# -------------------------------------------------------------------------------------- #
${TARGET}: ${A_OBJS} ${C_OBJS}
- ${CC} ${CFLAGS} ${CINCS} -o ${.TARGET} ${A_OBJS} ${C_OBJS} ${LINK}
+ ${CC} ${CFLAGS} ${CINCS} -o ${.TARGET} ${A_OBJS} ${C_OBJS} ${LDLIBS}
# -------------------------------------------------------------------------------------- #
depend:
${CC} ${CINCS} -E -MM ${C_SRCS} > .depend
@@ -95,8 +95,20 @@ all:
${MAKE} depend
${MAKE} ${TARGET}
# -------------------------------------------------------------------------------------- #
+install: all
+ ${MKDIR} "${DESTDIR}${BINPREFIX}"
+ ${CP} ${TARGET} "${DESTDIR}${BINPREFIX}"
+ ${MKDIR} "${DESTDIR}${MANPREFIX}"/man1
+ ${CP} man/${TARGET}.1 "${DESTDIR}${MANPREFIX}"/man1
+# -------------------------------------------------------------------------------------- #
+uninstall:
+ ${RM} "${DESTDIR}${BINPREFIX}"/${TARGET}
+ ${RM} "${DESTDIR}${MANPREFIX}"/man1/${TARGET}.1
+# -------------------------------------------------------------------------------------- #
clean:
${RM} ${C_OBJS} ${A_OBJS} ${TARGET}.core .depend .depend.tmp ${TARGET}
# -------------------------------------------------------------------------------------- #
re: clean all
+# -------------------------------------------------------------------------------------- #
+.PHONY: all clean fclean re depend install uninstall
# ======================================== EOF ========================================= #
diff --git a/man/lowbat.1 b/man/lowbat.1
index cf05938..149c62b 100644
--- a/man/lowbat.1
+++ b/man/lowbat.1
@@ -20,9 +20,11 @@ To get run-time informations, simply run in a new terminal:
.TP
.in +.5i
$ lowbat
-.SH BUGS
-No known bugs. If you found a bug, please get in touch with me via GitHub.
.SH AUTHOR
-Joe
+Written by Joe <bousset.rudy@gmail.com>
+.SH REPORTING BUGS
+No known bugs. Bugs and suggestions should be reported on GitHub at https://github.com/JozanLeClerc/lowbat-bsd/issues
+.SH COPYRIGHT
+Copyright 2020 Joe, under the BSD license (see LICENSE for licensing informations)
.SH SEE ALSO
dunst(1), notify-send(1), espeak(1)