From 2c83768260bb32bfd65daefdcff93e193b2e86ef Mon Sep 17 00:00:00 2001 From: David Robertsson Date: Thu, 2 Feb 2023 17:20:37 +0100 Subject: [PATCH 1/2] Fixed make install/uninstall related to issue #43 Next on the list created by d-torrance --- washerdryer/washerDryer/Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/washerdryer/washerDryer/Makefile b/washerdryer/washerDryer/Makefile index 3bf32a74..bb8c1d6a 100644 --- a/washerdryer/washerDryer/Makefile +++ b/washerdryer/washerDryer/Makefile @@ -2,6 +2,12 @@ LIBDIR = -L/usr/X11R6/lib -L/usr/lib -L/opt/gnome/lib LIBS = -lXpm -lXext -lX11 `pkg-config gtk+-2.0 --libs` -ldockapp CFLAGS = `pkg-config gtk+-2.0 --cflags` OBJS = washerDryer.o +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin +MKDIR_P = mkdir -p +INSTALL = install +INSTALL_PROGRAM = $(INSTALL) .c.o: cc -c -O2 -Wall $< -o $*.o $(CFLAGS) @@ -24,9 +30,8 @@ install:: washerDryer chmod 600 $(HOME)/.wdryerrc @echo @echo "Installing executable..." - cp -f washerDryer /usr/local/bin/ - chmod 755 /usr/local/bin/washerDryer - chown root:root /usr/local/bin/washerDryer + $(MKDIR_P) $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) washerDryer $(DESTDIR)$(bindir)/washerDryer @echo @echo "Installing man page..." cp -f man/washerDryer.1.gz /usr/man/man1/ @@ -37,7 +42,7 @@ install:: washerDryer uninstall:: @echo @echo "Removing executable..." - rm -f /usr/local/bin/washerDryer + rm -f $(DESTDIR)$(bindir)/washerDryer @echo @echo "Removing config file..." rm -f $(HOME)/.wdryerrc From 2cd020bd6c0182ed6170f08ca128d472e139bdb5 Mon Sep 17 00:00:00 2001 From: David Robertsson Date: Thu, 2 Feb 2023 17:38:11 +0100 Subject: [PATCH 2/2] Changed path for man-file installation Changed to what seems to make more sense. A better approach might be to programmaticly examine manpath. At the same time, if multiple paths are available a new problem presents itself. --- washerdryer/washerDryer/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/washerdryer/washerDryer/Makefile b/washerdryer/washerDryer/Makefile index bb8c1d6a..98b52f64 100644 --- a/washerdryer/washerDryer/Makefile +++ b/washerdryer/washerDryer/Makefile @@ -34,8 +34,8 @@ install:: washerDryer $(INSTALL_PROGRAM) washerDryer $(DESTDIR)$(bindir)/washerDryer @echo @echo "Installing man page..." - cp -f man/washerDryer.1.gz /usr/man/man1/ - chmod 644 /usr/man/man1/washerDryer.1.gz + cp -f man/washerDryer.1.gz /usr/local/man/man1/ + chmod 644 /usr/local/man/man1/washerDryer.1.gz @echo @echo "washerDryer installation finished." @@ -48,7 +48,7 @@ uninstall:: rm -f $(HOME)/.wdryerrc @echo @echo "Removing man page..." - rm -f /usr/man/man1/washerDryer.1.gz + rm -f /usr/local/man/man1/washerDryer.1.gz @echo @echo "washerDryer uninstall finished."