]> git.cameronkatri.com Git - pw-darwin.git/blob - pw/Makefile
Recommit everything, add chpass, improve history (except for a few files that git...
[pw-darwin.git] / pw / Makefile
1 CC ?= aarch64-apple-darwin-clang
2 STRIP ?= aarch64-apple-darwin-strip
3 LDID ?= ldid
4 CFLAGS ?= -arch arm64 -isysroot /home/cameron/Documents/SDK/iPhoneOS14.3.sdk -miphoneos-version-min=13.0
5 LDFLAGS ?=
6 GINSTALL ?= install
7 PREFIX ?= /usr
8 DESTDIR ?=
9
10 SRC := pw_utils.c \
11 pw_user.c \
12 pw_conf.c \
13 bitmap.c \
14 psdate.c \
15 pw_nis.c \
16 pw.c \
17 grupd.c \
18 pwupd.c \
19 pw_group.c \
20 rm_r.c \
21 pw_log.c \
22 strtounum.c \
23 pw_vpw.c \
24 cpdir.c
25
26 LIBUTILSRC := ../libutil/login_cap.c \
27 ../libutil/pw_util.c \
28 ../libutil/gr_util.c \
29 ../libutil/flopen.c \
30 ../libutil/login_crypt.c \
31 ../libutil/_secure_path.c
32
33 LIBCSRC := ../libc/stdlib/strtonum.c \
34 ../libc/gen/pw_scan.c
35
36 all: pw
37
38 install: install-pw
39
40 pw: $(SRC:%.c=%.o) $(LIBCSRC:%.c=%.o) $(LIBUTILSRC:%.c=%.o) ../ent.xml
41 $(CC) $(LDFLAGS) -o $@ -lcrypt $(SRC:%.c=%.o) $(LIBCSRC:%.c=%.o) $(LIBUTILSRC:%.c=%.o)
42 $(STRIP) $@
43 $(LDID) -S../ent.xml $@
44
45 %.o: %.c
46 $(CC) $(CFLAGS) -c -o $@ $< -I. -I../libutil -I../libc/gen
47
48 install-pw: pw pw.8 pw.conf.5
49 $(GINSTALL) -Dm755 pw $(DESTDIR)/$(PREFIX)/sbin/pw
50 $(GINSTALL) -Dm644 pw.8 $(DESTDIR)/$(PREFIX)/share/man/man8/pw.8
51 $(GINSTALL) -Dm644 pw.conf.5 $(DESTDIR)/$(PREFIX)/share/man/man5/pw.conf.5
52 mkdir -p $(DESTDIR)/$(PREFIX)/share/skel
53
54 clean:
55 rm -f pw $(SRC:%.c=%.o) $(LIBCSRC:%.c=%.o) $(LIBUTILSRC:%.c=%.o)
56
57 .PHONY: all install install-pw clean