ref: 0ac845b70a399350109cadb5ec31b18cb35f2e6f
parent: bd6157cf317c95546a015c2f764d096b13d4491a
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Wed Feb 23 15:51:17 EST 2022
clean up makefile, do not remove built executable on "make uninstall"
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,8 @@
TARGET=pc
DESTDIR?=
PREFIX?=/usr/local
+BIN=$(DESTDIR)$(PREFIX)/bin
+MAN=$(DESTDIR)$(PREFIX)/share/man/man1
CFLAGS?=-g -O2
CFLAGS+=-Iinclude -Wall -Wno-missing-braces -Wno-parentheses -Wno-incompatible-pointer-types
@@ -81,13 +83,13 @@
default: $(TARGET)
install: $(TARGET)
- install -d $(DESTDIR)$(PREFIX)/bin
- install -m 755 $(TARGET) $(DESTDIR)$(PREFIX)/bin
- install -d $(DESTDIR)$(PREFIX)/share/man/man1
- install -m 644 $(TARGET).1 $(DESTDIR)$(PREFIX)/share/man/man1
+ install -d $(BIN)
+ install -m 755 $(TARGET) $(BIN)
+ install -d $(MAN)
+ install -m 644 $(TARGET).1 $(MAN)
uninstall:
- rm -f $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET) $(DESTDIR)$(PREFIX)/share/man/man1/$(TARGET).1
+ rm -f $(BIN)/$(TARGET) $(MAN)/$(TARGET).1
clean:
rm -f $(TARG) $(OFILES) $(TARGET).c