From f3dab068fce37270e5e4e1a00e5a44e30f00baf7 Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Sun, 2 May 2021 16:00:07 -0400 Subject: Recommit everything, add chpass, improve history (except for a few files that git-filter-repo dislikes for some reason [_secure_path.c and login_cap.h]) --- pw/Makefile | 63 +++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 51 insertions(+), 12 deletions(-) (limited to 'pw/Makefile') diff --git a/pw/Makefile b/pw/Makefile index 353eac1..dc57d1d 100644 --- a/pw/Makefile +++ b/pw/Makefile @@ -1,18 +1,57 @@ -# $FreeBSD$ +CC ?= aarch64-apple-darwin-clang +STRIP ?= aarch64-apple-darwin-strip +LDID ?= ldid +CFLAGS ?= -arch arm64 -isysroot /home/cameron/Documents/SDK/iPhoneOS14.3.sdk -miphoneos-version-min=13.0 +LDFLAGS ?= +GINSTALL ?= install +PREFIX ?= /usr +DESTDIR ?= -PROG= pw -MAN= pw.conf.5 pw.8 -SRCS= pw.c pw_conf.c pw_user.c pw_group.c pw_log.c pw_nis.c pw_vpw.c \ - grupd.c pwupd.c psdate.c bitmap.c cpdir.c rm_r.c strtounum.c \ - pw_utils.c +SRC := pw_utils.c \ + pw_user.c \ + pw_conf.c \ + bitmap.c \ + psdate.c \ + pw_nis.c \ + pw.c \ + grupd.c \ + pwupd.c \ + pw_group.c \ + rm_r.c \ + pw_log.c \ + strtounum.c \ + pw_vpw.c \ + cpdir.c -WARNS?= 3 +LIBUTILSRC := ../libutil/login_cap.c \ + ../libutil/pw_util.c \ + ../libutil/gr_util.c \ + ../libutil/flopen.c \ + ../libutil/login_crypt.c \ + ../libutil/_secure_path.c -LIBADD= crypt util +LIBCSRC := ../libc/stdlib/strtonum.c \ + ../libc/gen/pw_scan.c -.include +all: pw -HAS_TESTS= -SUBDIR.${MK_TESTS}+= tests +install: install-pw -.include +pw: $(SRC:%.c=%.o) $(LIBCSRC:%.c=%.o) $(LIBUTILSRC:%.c=%.o) ../ent.xml + $(CC) $(LDFLAGS) -o $@ -lcrypt $(SRC:%.c=%.o) $(LIBCSRC:%.c=%.o) $(LIBUTILSRC:%.c=%.o) + $(STRIP) $@ + $(LDID) -S../ent.xml $@ + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< -I. -I../libutil -I../libc/gen + +install-pw: pw pw.8 pw.conf.5 + $(GINSTALL) -Dm755 pw $(DESTDIR)/$(PREFIX)/sbin/pw + $(GINSTALL) -Dm644 pw.8 $(DESTDIR)/$(PREFIX)/share/man/man8/pw.8 + $(GINSTALL) -Dm644 pw.conf.5 $(DESTDIR)/$(PREFIX)/share/man/man5/pw.conf.5 + mkdir -p $(DESTDIR)/$(PREFIX)/share/skel + +clean: + rm -f pw $(SRC:%.c=%.o) $(LIBCSRC:%.c=%.o) $(LIBUTILSRC:%.c=%.o) + +.PHONY: all install install-pw clean -- cgit v1.2.3-56-ge451