Skip to content

Commit

Permalink
make: remove redundant variables
Browse files Browse the repository at this point in the history
The GNU make manual advises not to use variables for commands like `rm`
which are widely available on all Linux and UNIX-like platforms.
  • Loading branch information
ayushnix committed Mar 22, 2023
1 parent 2f227cd commit 8249a6a
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,24 @@ BASHCOMPDIR ?= ${DATAROOTDIR}/bash-completion/completions
FISHCOMPDIR ?= ${DATAROOTDIR}/fish/vendor_completions.d
PROG ?= tessen

RM := rm
ECHO := @echo
SCDOC := scdoc
INSTALL := install

.PHONY: all install minimal bashcomp fishcomp clean uninstall

all:
${ECHO} "${PROG} is a shell script and doesn't need to be compiled"
${ECHO} "To install it, enter \"make install\""
@echo "${PROG} is a shell script and doesn't need to be compiled"
@echo "To install it, enter \"make install\""

install: man bashcomp fishcomp
${INSTALL} -Dm 0755 ${PROG} -t ${DESTDIR}${BINDIR}
${ECHO} ""
${ECHO} "${PROG} has been installed succesfully"
@echo ""
@echo "${PROG} has been installed succesfully"

minimal:
${INSTALL} -Dm 0755 ${PROG} -t ${DESTDIR}${BINDIR}
${ECHO} ""
${ECHO} "${PROG} has been installed succesfully"
@echo ""
@echo "${PROG} has been installed succesfully"

man: man/${PROG}.1 man/${PROG}.5
${INSTALL} -Dm 0644 man/${PROG}.1 -t ${DESTDIR}${MANDIR}/man1
Expand All @@ -42,12 +40,12 @@ fishcomp:
${INSTALL} -Dm 0644 completion/${PROG}.fish-completion ${DESTDIR}${FISHCOMPDIR}/${PROG}.fish

clean:
${RM} -f man/${PROG}.1
${RM} -f man/${PROG}.5
rm -f man/${PROG}.1
rm -f man/${PROG}.5

uninstall:
${RM} -f "${DESTDIR}${BINDIR}/${PROG}"
${RM} -f "${DESTDIR}${MANDIR}/man1/${PROG}.1"
${RM} -f "${DESTDIR}${MANDIR}/man5/${PROG}.5"
${RM} -f "${DESTDIR}${BASHCOMPDIR}/${PROG}"
${RM} -f "${DESTDIR}${FISHCOMPDIR}/${PROG}.fish"
rm -f "${DESTDIR}${BINDIR}/${PROG}"
rm -f "${DESTDIR}${MANDIR}/man1/${PROG}.1"
rm -f "${DESTDIR}${MANDIR}/man5/${PROG}.5"
rm -f "${DESTDIR}${BASHCOMPDIR}/${PROG}"
rm -f "${DESTDIR}${FISHCOMPDIR}/${PROG}.fish"

0 comments on commit 8249a6a

Please sign in to comment.