From: Cameron Katri Date: Sun, 14 Feb 2021 05:54:48 +0000 (-0500) Subject: Makefile and reorganizing X-Git-Url: https://git.cameronkatri.com/getent-darwin.git/commitdiff_plain/HEAD?hp=737fa5a9bfd3fd968b92fe94936c524ae3685cf3 Makefile and reorganizing --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1d56f4d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +getent +include/netinet +include/net diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9a7548e --- /dev/null +++ b/Makefile @@ -0,0 +1,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 diff --git a/Makefile.depend b/Makefile.depend deleted file mode 100644 index ff7c06a..0000000 --- a/Makefile.depend +++ /dev/null @@ -1,19 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/arpa \ - include/rpc \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/ent.xml b/ent.xml new file mode 100644 index 0000000..8a59f9f --- /dev/null +++ b/ent.xml @@ -0,0 +1,11 @@ + + + + platform-application + + com.apple.private.security.no-container + + com.apple.private.skip-library-validation + + + diff --git a/utmpx-defines.h b/include/utmpx-defines.h similarity index 100% rename from utmpx-defines.h rename to include/utmpx-defines.h diff --git a/utxdb.h b/include/utxdb.h similarity index 100% rename from utxdb.h rename to include/utxdb.h