summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 9a7548e3c25f94640394cc0d2700ae293c8807d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
GINSTALL ?= install
PREFIX   ?= /usr
DESTDIR  ?=

SRC := getent.c getutxent.c

all: getent

install: install-getent

copy-headers:
	cp -af $(MACOSX_SYSROOT)/usr/include/netinet include/
	cp -af $(MACOSX_SYSROOT)/usr/include/net include/

getent: $(SRC) ent.xml copy-headers
	$(CC) $(CFLAGS) -o getent -Iinclude $(SRC)
	$(STRIP) getent
	$(LDID) -Sent.xml getent

install-getent: getent getent.1
	$(GINSTALL) -Dm755 getent $(DESTDIR)/$(PREFIX)/bin/getent
	$(GINSTALL) -Dm644 getent.1 $(DESTDIR)/$(PREFIX)/share/man/man1/getent.1

clean:
	rm -f getent

.PHONY: all install install-getent clean copy-headers