oksh-noxz

[fork] Portable OpenBSD ksh, based on the Public Domain Korn Shell (pdksh).
git clone https://noxz.tech/git/oksh-noxz.git
oksh-noxz

commit: 514407b037880bd8650101401ce8fda0eb0418df
parent: 4120f98a13f09cc5bcd6f946e624dcfd6c9e9696
author: Brian Callahan <dodonpachi-github@mailinator.com>
date:   Wed, 7 Jan 2015 23:42:34 -0500
Make universal Makefile. Install as oksh instead of ksh to avoid naming conflicts. Update manpage to reflect name change.
MMakefile36++++++++++++--------
Rksh.1oksh.1oksh.1|
2 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,18 +1,26 @@
-#	$OpenBSD: Makefile,v 1.29 2013/12/02 20:41:01 millert Exp $
+# oksh Makefile
 
-PROG=	ksh
-SRCS=	alloc.c c_ksh.c c_sh.c c_test.c c_ulimit.c edit.c emacs.c eval.c \
-	exec.c expr.c history.c io.c jobs.c lex.c mail.c main.c mknod.c \
-	misc.c path.c shf.c syn.c table.c trap.c tree.c tty.c var.c \
-	version.c vi.c
+# OpenBSD defaults
+CC ?= cc
+CFLAGS ?= -O2 -pipe
+PREFIX ?= /usr/local
 
-DEFS=	-Wall
-CFLAGS+=${DEFS} -I. -I${.CURDIR} -I${.CURDIR}/../../lib/libc/gen
-LDFLAGS+=-static
-MAN=	ksh.1 sh.1
+CFLAGS += -Wall
+LDFLAGS += -static
 
-LINKS=	${BINDIR}/ksh ${BINDIR}/rksh
-LINKS+=	${BINDIR}/ksh ${BINDIR}/sh
-MLINKS=	ksh.1 rksh.1
+PROG =	oksh
+OBJS =	alloc.o c_ksh.o c_sh.o c_test.o c_ulimit.o edit.o emacs.o \
+	eval.o exec.o expr.o history.o io.o jobs.o lex.o mail.o main.o \
+	mknod.o misc.o path.o shf.o syn.o table.o trap.o tree.o tty.o \
+	var.o version.o vi.o
 
-.include <bsd.prog.mk>
+all:	${OBJS}
+	${CC} ${LDFLAGS} -o ${PROG} ${OBJS}
+
+install: all
+	install -c -s -o root -g wheel -m 555 oksh ${PREFIX}/bin
+	install -c -o root -g wheel -m 444 oksh.1 ${PREFIX}/man/man1
+	echo "${PREFIX}/bin/oksh" >> /etc/shells
+
+clean:
+	rm -f ${PROG} *.o *~
diff --git a/ksh.1 b/oksh.1
rename ksh.1 → oksh.1
@@ -3,13 +3,13 @@
 .\"	Public Domain
 .\"
 .Dd $Mdocdate: December 9 2014 $
-.Dt KSH 1
+.Dt OKSH 1
 .Os
 .Sh NAME
-.Nm ksh
+.Nm oksh
 .Nd public domain Korn shell
 .Sh SYNOPSIS
-.Nm ksh
+.Nm oksh
 .Bk -words
 .Op Fl +abCefhiklmnpruvXx
 .Op Fl +o Ar option