aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2019-12-03 23:53:08 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2019-12-03 23:53:08 +0100
commit198cb64ca257cf303d16e7271671ea9efbb2bcf2 (patch)
treedcf372264ff5fe62228f411fa9780a492cc00f50
parentBad (diff)
downloadlowbat-gnu-198cb64ca257cf303d16e7271671ea9efbb2bcf2.tar.gz
lowbat-gnu-198cb64ca257cf303d16e7271671ea9efbb2bcf2.tar.bz2
lowbat-gnu-198cb64ca257cf303d16e7271671ea9efbb2bcf2.tar.xz
lowbat-gnu-198cb64ca257cf303d16e7271671ea9efbb2bcf2.tar.zst
lowbat-gnu-198cb64ca257cf303d16e7271671ea9efbb2bcf2.zip
Better Makefile
-rw-r--r--Makefile17
1 files changed, 13 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index b10cb7f..4cf581f 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@ CFLAGS += -Wextra
CFLAGS += -Werror
CFLAGS += ${OPTIMIZE}
#------------------------------------------------------------------------------#
-NAME = ${TRGT_DIR}lowbat
+NAME = lowbat
#==============================================================================#
#--------------------------------- UNIX ---------------------------------------#
#==============================================================================#
@@ -57,10 +57,11 @@ MANPREFIX = $(PREFIX)/share/man
#==============================================================================#
${OBJS_DIR}%.o: ${SRCS_DIR}%.cpp ${INCS_DIR}${INCS}
@${MKDIR} ${OBJS_DIR}
- ${CC} ${CFLAGS} -I${INCS_DIR} -i${INCS} -c -o $@ $<
+ ${CC} ${CFLAGS} -I${INCS_DIR} -c -o $@ $<
#------------------------------------------------------------------------------#
${NAME}: ${OBJS}
- ${CC} ${CFLAGS} -o ${TARGET} ${OBJS}
+ @${MKDIR} ${TRGT_DIR}
+ ${CC} ${CFLAGS} -o ${TRGT_DIR}${NAME} ${OBJS}
#------------------------------------------------------------------------------#
all:
@${MAKE} -j5 ${NAME}
@@ -76,5 +77,13 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/lowbat
rm -f $(DESTDIR)$(MANPREFIX)/man1/lowbat.1
#------------------------------------------------------------------------------#
-.PHONY: all lowbat clean fclean install uninstall
+clean:
+ ${RM} ${OBJS_DIR}
+#------------------------------------------------------------------------------#
+fclean: clean
+#------------------------------------------------------------------------------#
+re: fclean all
+#------------------------------------------------------------------------------#
+ ${RM} ${TRGT_DIR}
+.PHONY: all lowbat clean fclean re install uninstall
#==================================== EOF =====================================#