Skip to content

Commit

Permalink
Use 7zip on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
karbassi authored Aug 4, 2021
1 parent 0b6a52a commit d72054d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ INSTALL_DATA = $(INSTALL) -m 644

prefix = /usr/local

ifeq ($(OS), Windows_NT)
ZIP_PROGRAM=7z a -r
else
ZIP_PROGRAM=zip -r -9
endif

# ifdef check allows the user to pass custom dirs
# as per the README

Expand Down Expand Up @@ -54,7 +60,7 @@ dist: $(DISTFILES) todo.sh
chmod +x "$(DISTNAME)/todo.sh"
tar cf $(DISTNAME).tar "$(DISTNAME)"
gzip -f -9 "$(DISTNAME).tar"
zip -r -9 "$(DISTNAME).zip" "$(DISTNAME)"
$(ZIP_PROGRAM) "$(DISTNAME).zip" "$(DISTNAME)"
rm -r "$(DISTNAME)"

.PHONY: clean
Expand All @@ -66,7 +72,7 @@ install: installdirs
$(INSTALL_PROGRAM) todo.sh "$(DESTDIR)$(bindir)/todo.sh"
$(INSTALL_DATA) todo_completion "$(DESTDIR)$(datarootdir)/todo"
[ -e "$(DESTDIR)$(sysconfdir)/todo/config" ] || \
sed "s/^\(export[ \t]*TODO_DIR=\).*/\1~\/.todo/" todo.cfg > "$(DESTDIR)$(sysconfdir)/todo/config"
sed "s/^\(export[ \t]*TODO_DIR=\).*/\1~\/.todo/" todo.cfg > "$(DESTDIR)$(sysconfdir)/todo/config"

uninstall:
rm -f "$(DESTDIR)$(bindir)/todo.sh"
Expand All @@ -78,8 +84,8 @@ uninstall:

installdirs:
mkdir -p "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(sysconfdir)/todo" \
"$(DESTDIR)$(datarootdir)"
"$(DESTDIR)$(sysconfdir)/todo" \
"$(DESTDIR)$(datarootdir)"

#
# Testing
Expand Down

0 comments on commit d72054d

Please sign in to comment.