From 6328e58027ec224154800abdef46836e03231362 Mon Sep 17 00:00:00 2001 From: Spenser Truex Date: Fri, 5 Sep 2025 02:09:31 -0700 Subject: [PATCH 1/2] Add Makefile uninstall target --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 82b2d72..1b9f5f2 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,17 @@ install-extra: extra $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin $(INSTALL) -m755 $(EXTRA_TARGETS) $(DESTDIR)$(PREFIX)/bin +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/f3write + rm -f $(DESTDIR)$(PREFIX)/bin/f3read + rm -f $(DESTDIR)$(PREFIX)/share/man/man1/f3read.1 + rm -f $(DESTDIR)$(PREFIX)/share/man/man1/f3write.1 + +uninstall-extra: + rm -f $(DESTDIR)$(PREFIX)/bin/f3probe + rm -f $(DESTDIR)$(PREFIX)/bin/f3brew + rm -f $(DESTDIR)$(PREFIX)/bin/f3fix + f3write: utils.o libflow.o f3write.o $(CC) -o $@ $^ $(LDFLAGS) -lm @@ -56,7 +67,7 @@ f3fix: libutils.o f3fix.o -include *.d -PHONY: cscope clean +.PHONY: cscope clean uninstall uninstall-extra cscope: cscope -b *.c *.h From 93588cdd23656b69599459c655f8d66bab1cc0b9 Mon Sep 17 00:00:00 2001 From: Spenser Truex Date: Mon, 8 Sep 2025 18:50:56 -0700 Subject: [PATCH 2/2] Improve the makefile --- Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 1b9f5f2..0bb7ba2 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ EXTRA_TARGETS = f3probe f3brew f3fix PREFIX = /usr/local INSTALL = install LN = ln +UNLINK = unlink ifndef OS OS = $(shell uname -s) @@ -39,16 +40,13 @@ install-extra: extra $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin $(INSTALL) -m755 $(EXTRA_TARGETS) $(DESTDIR)$(PREFIX)/bin -uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/f3write - rm -f $(DESTDIR)$(PREFIX)/bin/f3read +uninstall: uninstall-extra + cd $(DESTDIR)$(PREFIX)/bin ; rm $(TARGETS) rm -f $(DESTDIR)$(PREFIX)/share/man/man1/f3read.1 - rm -f $(DESTDIR)$(PREFIX)/share/man/man1/f3write.1 + $(UNLINK) $(DESTDIR)$(PREFIX)/share/man/man1/f3write.1 uninstall-extra: - rm -f $(DESTDIR)$(PREFIX)/bin/f3probe - rm -f $(DESTDIR)$(PREFIX)/bin/f3brew - rm -f $(DESTDIR)$(PREFIX)/bin/f3fix + cd $(DESTDIR)$(PREFIX)/bin ; rm $(EXTRA_TARGETS) f3write: utils.o libflow.o f3write.o $(CC) -o $@ $^ $(LDFLAGS) -lm