summaryrefslogtreecommitdiffstats
path: root/pw/Makefile
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-03-20 01:47:16 -0400
committerCameron Katri <me@cameronkatri.com>2021-03-20 01:47:16 -0400
commita477b5619a23ec06af401df48724cc6ec49d9f76 (patch)
treea85a80e1f71b3ddb3b216163244dbbf057228359 /pw/Makefile
parentff633087671584f9a0627d2525d07f603f9994cc (diff)
downloadpw-darwin-a477b5619a23ec06af401df48724cc6ec49d9f76.tar.gz
pw-darwin-a477b5619a23ec06af401df48724cc6ec49d9f76.tar.zst
pw-darwin-a477b5619a23ec06af401df48724cc6ec49d9f76.zip
pw(8): Fix userdel -r
Fix userdel -r: Remove check to see if uid is used by second user, which is failing after single user is removed Improve Makefile Disallow removing of apple's system users
Diffstat (limited to 'pw/Makefile')
-rw-r--r--pw/Makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/pw/Makefile b/pw/Makefile
index b6279ef..59ee1bb 100644
--- a/pw/Makefile
+++ b/pw/Makefile
@@ -40,10 +40,13 @@ all: pw
install: install-pw
-pw: $(SRC) $(LIBUTILSRC) $(SBUFSRC) ent.xml
- $(CC) $(CFLAGS) -o pw -I. -Isbuf -Ilibutil $(SRC) $(LIBUTILSRC) $(SBUFSRC) $(LDFLAGS) -lcrypt
- $(STRIP) pw
- $(LDID) -Sent.xml pw
+pw: $(SRC:%.c=%.o) $(LIBUTILSRC:%.c=%.o) $(SBUFSRC:%.c=%.o) ent.xml
+ $(CC) $(LDFLAGS) -o $@ -lcrypt $(SRC:%.c=%.o) $(LIBUTILSRC:%.c=%.o) $(SBUFSRC:%.c=%.o)
+ $(STRIP) $@
+ $(LDID) -Sent.xml $@
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $< -I. -Isbuf -Ilibutil
install-pw: pw pw.8 pw.conf.5
$(GINSTALL) -Dm755 pw $(DESTDIR)/$(PREFIX)/sbin/pw
@@ -52,6 +55,6 @@ install-pw: pw pw.8 pw.conf.5
mkdir -p $(DESTDIR)/$(PREFIX)/share/skel
clean:
- rm -f pw
+ rm -f pw $(SRC:%.c=%.o) $(LIBUTILSRC:%.c=%.o) $(SBUFSRC:%.c=%.o)
.PHONY: all install install-pw clean