]> git.cameronkatri.com Git - getent-darwin.git/commitdiff
Makefile and reorganizing main
authorCameron Katri <me@cameronkatri.com>
Sun, 14 Feb 2021 05:54:48 +0000 (00:54 -0500)
committerCameron Katri <me@cameronkatri.com>
Sun, 14 Feb 2021 05:54:48 +0000 (00:54 -0500)
.gitignore [new file with mode: 0644]
Makefile [new file with mode: 0644]
Makefile.depend [deleted file]
ent.xml [new file with mode: 0644]
include/utmpx-defines.h [moved from utmpx-defines.h with 100% similarity]
include/utxdb.h [moved from utxdb.h with 100% similarity]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..1d56f4d
--- /dev/null
@@ -0,0 +1,3 @@
+getent
+include/netinet
+include/net
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
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 (file)
index ff7c06a..0000000
+++ /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 <dirdeps.mk>
-
-.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 (file)
index 0000000..8a59f9f
--- /dev/null
+++ b/ent.xml
@@ -0,0 +1,11 @@
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>platform-application</key>
+       <true/>
+       <key>com.apple.private.security.no-container</key>
+       <true/>
+       <key>com.apple.private.skip-library-validation</key>
+       <true/>
+</dict>
+</plist>
similarity index 100%
rename from utmpx-defines.h
rename to include/utmpx-defines.h
similarity index 100%
rename from utxdb.h
rename to include/utxdb.h