]> git.cameronkatri.com Git - getent-darwin.git/blob - Makefile
Makefile and reorganizing
[getent-darwin.git] / 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 GINSTALL ?= install
6 PREFIX ?= /usr
7 DESTDIR ?=
8
9 SRC := getent.c getutxent.c
10
11 all: getent
12
13 install: install-getent
14
15 copy-headers:
16 cp -af $(MACOSX_SYSROOT)/usr/include/netinet include/
17 cp -af $(MACOSX_SYSROOT)/usr/include/net include/
18
19 getent: $(SRC) ent.xml copy-headers
20 $(CC) $(CFLAGS) -o getent -Iinclude $(SRC)
21 $(STRIP) getent
22 $(LDID) -Sent.xml getent
23
24 install-getent: getent getent.1
25 $(GINSTALL) -Dm755 getent $(DESTDIR)/$(PREFIX)/bin/getent
26 $(GINSTALL) -Dm644 getent.1 $(DESTDIR)/$(PREFIX)/share/man/man1/getent.1
27
28 clean:
29 rm -f getent
30
31 .PHONY: all install install-getent clean copy-headers