Skip to content

Commit

Permalink
create installation directories if need be, as suggested by @givdieri
Browse files Browse the repository at this point in the history
uninstalling also removes empty directories
  • Loading branch information
frederic-mahe committed Sep 2, 2024
1 parent efab5b3 commit de8b93d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ mandir = $(datarootdir)/man
man1dir = $(mandir)/man1
INSTALL = /usr/bin/install
INSTALL_PROGRAM = $(INSTALL)
RMDIR := rmdir --parents --ignore-fail-on-non-empty

objects := $(patsubst %.cpp, %.o, $(wildcard src/*.cpp))

Expand Down Expand Up @@ -83,12 +84,16 @@ dist-clean: clean
rm -f *~ ./src/*~ ./tests/*~ ./man/*~

install: $(PROG) $(MAN)
$(INSTALL_PROGRAM) --directory $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) --directory $(DESTDIR)$(man1dir)
$(INSTALL_PROGRAM) $(MAN) $(DESTDIR)$(man1dir)

uninstall:
rm $(DESTDIR)$(bindir)/$(PROG)
rm $(DESTDIR)$(man1dir)/$(PROG).1
$(RMDIR) $(DESTDIR)$(man1dir)/
$(RMDIR) $(DESTDIR)$(bindir)/

check:
bash ./tests/mumu.sh ./$(PROG)
Expand Down

0 comments on commit de8b93d

Please sign in to comment.