]> git.cameronkatri.com Git - pw-darwin.git/blob - chpass/Makefile
Make all calls to install POSIX
[pw-darwin.git] / chpass / 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 PREFIX ?= /usr
7 DESTDIR ?=
8
9 SRC := chpass.c \
10 edit.c \
11 field.c \
12 table.c \
13 util.c \
14 ../libutil/pw_util.c \
15 ../libutil/flopen.c \
16 ../libc/gen/pw_scan.c
17
18 all: chpass
19
20 install: install-chpass
21
22 chpass: $(SRC:%.c=%.o) ../ent.xml
23 $(CC) $(LDFLAGS) -o $@ -lcrypt $(SRC:%.c=%.o)
24 $(STRIP) $@
25 $(LDID) -S../ent.xml $@
26
27 %.o: %.c
28 $(CC) $(CFLAGS) -c -o $@ $< -I. -I../libutil -I../libc/gen
29
30 install-chpass: chpass chpass.1
31 install -d $(DESTDIR)/$(PREFIX)/bin \
32 $(DESTDIR)/$(PREFIX)/share/man/man1
33 install -m4555 chpass $(DESTDIR)/$(PREFIX)/bin/chpass
34 ln -sf chpass $(DESTDIR)/$(PREFIX)/bin/chfn
35 ln -sf chpass $(DESTDIR)/$(PREFIX)/bin/chsh
36 install -Dm644 chpass.1 $(DESTDIR)/$(PREFIX)/share/man/man1/chpass.1
37 ln -sf chpass.1.zst $(DESTDIR)/$(PREFIX)/share/man/man1/chfn.1
38 ln -sf chpass.1.zst $(DESTDIR)/$(PREFIX)/share/man/man1/chsh.1
39
40 clean:
41 rm -f chpass $(SRC:%.c=%.o)
42
43 .PHONY: all install install-chpass clean