From 198cb64ca257cf303d16e7271671ea9efbb2bcf2 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 3 Dec 2019 23:53:08 +0100 Subject: Better Makefile --- Makefile | 17 +++++++++++++---- 1 file 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 =====================================# -- cgit v1.2.3