aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore289
-rw-r--r--Makefile17
-rw-r--r--Makefile.inc11
-rw-r--r--README.md5
-rw-r--r--adv_cmds/Makefile15
-rw-r--r--adv_cmds/Makefile.inc1
-rw-r--r--adv_cmds/cap_mkdb/Makefile3
-rw-r--r--adv_cmds/colldef/Makefile9
-rw-r--r--adv_cmds/colldef/scan.l2
-rw-r--r--adv_cmds/finger/Makefile8
-rw-r--r--adv_cmds/gencat/Makefile5
-rw-r--r--adv_cmds/last/Makefile3
-rw-r--r--adv_cmds/locale/Makefile3
-rw-r--r--adv_cmds/lsvfs/Makefile3
-rw-r--r--adv_cmds/mklocale/Makefile5
-rw-r--r--adv_cmds/mklocale/lex.l2
-rw-r--r--adv_cmds/ps/Makefile3
-rw-r--r--adv_cmds/stty/Makefile7
-rw-r--r--adv_cmds/tabs/Makefile5
-rw-r--r--adv_cmds/tty/Makefile3
-rw-r--r--adv_cmds/whois/Makefile3
-rw-r--r--basic_cmds/Makefile6
-rw-r--r--basic_cmds/Makefile.inc1
-rw-r--r--basic_cmds/mesg/Makefile3
-rw-r--r--basic_cmds/uudecode/Makefile5
-rw-r--r--basic_cmds/uuencode/Makefile6
-rw-r--r--basic_cmds/write/Makefile3
-rw-r--r--bootstrap_cmds/Makefile3
-rw-r--r--bootstrap_cmds/Makefile.inc1
-rw-r--r--bootstrap_cmds/migcom.tproj/Makefile22
-rw-r--r--bootstrap_cmds/migcom.tproj/lexxer.l2
-rwxr-xr-xcreate_tarballs.sh33
-rw-r--r--developer_cmds/Makefile7
-rw-r--r--developer_cmds/Makefile.inc1
-rw-r--r--developer_cmds/asa/Makefile3
-rw-r--r--developer_cmds/ctags/Makefile10
-rw-r--r--developer_cmds/lorder/Makefile3
-rw-r--r--developer_cmds/rpcgen/Makefile15
-rw-r--r--developer_cmds/rpcgen/rpc_main.c3
-rw-r--r--developer_cmds/unifdef/Makefile4
-rw-r--r--diskdev_cmds/Makefile18
-rw-r--r--diskdev_cmds/Makefile.inc1
-rw-r--r--diskdev_cmds/dev_mkdb.tproj/Makefile6
-rw-r--r--diskdev_cmds/disklib/preen.c4
-rw-r--r--diskdev_cmds/edquota.tproj/Makefile8
-rw-r--r--diskdev_cmds/edquota.tproj/edquota.c2
-rw-r--r--diskdev_cmds/edt_fstab/edt_fstab.h2
-rw-r--r--diskdev_cmds/fdisk.tproj/Makefile16
-rw-r--r--diskdev_cmds/fsck.tproj/Makefile3
-rw-r--r--diskdev_cmds/fsck.tproj/fsck.c6
-rw-r--r--diskdev_cmds/fstyp.tproj/Makefile19
-rw-r--r--diskdev_cmds/fstyp.tproj/progs.mk1
-rw-r--r--diskdev_cmds/fuser.tproj/Makefile5
-rw-r--r--diskdev_cmds/mount.tproj/Makefile5
-rw-r--r--diskdev_cmds/mount_devfs.tproj/Makefile8
-rw-r--r--diskdev_cmds/mount_fdesc.tproj/Makefile8
-rw-r--r--diskdev_cmds/quota.tproj/Makefile6
-rw-r--r--diskdev_cmds/quotacheck.tproj/Makefile9
-rw-r--r--diskdev_cmds/quotaon.tproj/Makefile8
-rw-r--r--diskdev_cmds/repquota.tproj/Makefile6
-rw-r--r--diskdev_cmds/setclass.tproj/Makefile6
-rw-r--r--diskdev_cmds/vndevice.tproj/Makefile6
-rw-r--r--diskdev_cmds/vsdbutil.tproj/Makefile12
-rw-r--r--diskdev_cmds/vsdbutil.tproj/vsdbutil_main.c2
-rw-r--r--doc_cmds/Makefile5
-rw-r--r--doc_cmds/Makefile.inc1
-rw-r--r--doc_cmds/checknr/Makefile3
-rw-r--r--doc_cmds/colcrt/Makefile3
-rw-r--r--doc_cmds/makewhatis/Makefile8
-rw-r--r--file_cmds/Makefile30
-rw-r--r--file_cmds/Makefile.inc1
-rw-r--r--file_cmds/chflags/Makefile5
-rw-r--r--file_cmds/chmod/Makefile7
-rw-r--r--file_cmds/chown/Makefile8
-rw-r--r--file_cmds/cksum/Makefile12
-rw-r--r--file_cmds/compress/Makefile10
-rw-r--r--file_cmds/cp/Makefile6
-rw-r--r--file_cmds/dd/Makefile6
-rw-r--r--file_cmds/df/Makefile3
-rw-r--r--file_cmds/du/Makefile3
-rw-r--r--file_cmds/gzip/Makefile17
-rw-r--r--file_cmds/install/Makefile9
-rw-r--r--file_cmds/install/xinstall.c16
-rw-r--r--file_cmds/ipcrm/Makefile3
-rw-r--r--file_cmds/ipcs/Makefile5
-rw-r--r--file_cmds/ln/Makefile6
-rw-r--r--file_cmds/ls/Makefile10
-rw-r--r--file_cmds/ls/ls.c1
-rw-r--r--file_cmds/mkdir/Makefile5
-rw-r--r--file_cmds/mkfifo/Makefile3
-rw-r--r--file_cmds/mknod/Makefile6
-rw-r--r--file_cmds/mtree/Makefile22
-rw-r--r--file_cmds/mtree/commoncrypto.c4
-rw-r--r--file_cmds/mv/Makefile7
-rw-r--r--file_cmds/mv/mv.c2
-rw-r--r--file_cmds/pathchk/Makefile3
-rw-r--r--file_cmds/pax/Makefile25
-rw-r--r--file_cmds/pax/ar_io.c2
-rw-r--r--file_cmds/pax/extern.h2
-rw-r--r--file_cmds/pax/options.c2
-rw-r--r--file_cmds/rm/Makefile8
-rw-r--r--file_cmds/rmdir/Makefile5
-rw-r--r--file_cmds/rmt/Makefile4
-rw-r--r--file_cmds/shar/Makefile4
-rw-r--r--file_cmds/stat/Makefile6
-rw-r--r--file_cmds/touch/Makefile3
l---------file_cmds/xinstall1
-rw-r--r--mail_cmds/Makefile10
-rw-r--r--mail_cmds/Makefile.inc1
-rw-r--r--mail_cmds/biff/Makefile11
-rw-r--r--mail_cmds/comsat/Makefile13
-rw-r--r--mail_cmds/from/Makefile11
-rw-r--r--mail_cmds/mail/Makefile39
-rw-r--r--mail_cmds/mail/popen.c2
-rw-r--r--mail_cmds/mail/send.c2
-rw-r--r--mail_cmds/msgs/Makefile12
-rw-r--r--misc_cmds/Makefile7
-rw-r--r--misc_cmds/Makefile.inc1
-rw-r--r--misc_cmds/calendar/Makefile12
-rw-r--r--misc_cmds/calendar/io.c2
-rw-r--r--misc_cmds/leave/Makefile3
-rw-r--r--misc_cmds/leave/leave.c1
-rw-r--r--misc_cmds/ncal/Makefile6
-rw-r--r--misc_cmds/ncal/ncal.c2
-rw-r--r--misc_cmds/tsort/Makefile3
-rw-r--r--misc_cmds/units/Makefile5
-rw-r--r--network_cmds/Makefile26
-rw-r--r--network_cmds/Makefile.inc3
-rw-r--r--network_cmds/arp.tproj/Makefile6
-rw-r--r--network_cmds/cfilutil/Makefile6
-rw-r--r--network_cmds/dnctl/Makefile8
-rw-r--r--network_cmds/dnctl/dnctl.c2
-rw-r--r--network_cmds/ecnprobe/Makefile26
-rw-r--r--network_cmds/frame_delay/Makefile6
-rw-r--r--network_cmds/ifconfig.tproj/Makefile18
-rw-r--r--network_cmds/ip6addrctl.tproj/Makefile6
-rw-r--r--network_cmds/kdumpd.tproj/Makefile7
-rw-r--r--network_cmds/mnc.tproj/Makefile7
-rw-r--r--network_cmds/mptcp_client/Makefile6
-rw-r--r--network_cmds/mtest.tproj/Makefile6
-rw-r--r--network_cmds/ndp.tproj/Makefile6
-rw-r--r--network_cmds/netstat.tproj/Makefile8
-rw-r--r--network_cmds/ping.tproj/Makefile9
-rw-r--r--network_cmds/ping6.tproj/Makefile9
-rw-r--r--network_cmds/pktapctl/Makefile6
-rw-r--r--network_cmds/pktmnglr/Makefile7
-rw-r--r--network_cmds/rarpd.tproj/Makefile6
-rw-r--r--network_cmds/route.tproj/Makefile6
-rw-r--r--network_cmds/rtadvd.tproj/Makefile3
-rw-r--r--network_cmds/rtadvd.tproj/rtadvd_logging.c1
-rw-r--r--network_cmds/rtsol.tproj/Makefile8
-rw-r--r--network_cmds/spray.tproj/Makefile15
-rw-r--r--network_cmds/traceroute.tproj/Makefile8
-rw-r--r--network_cmds/traceroute6.tproj/Makefile6
-rw-r--r--patch_cmds/Makefile4
-rw-r--r--patch_cmds/Makefile.inc1
-rw-r--r--patch_cmds/diffstat/Makefile5
-rw-r--r--patch_cmds/diffstat/diffstat.c2
-rw-r--r--patch_cmds/patch/Makefile4
-rw-r--r--remote_cmds/Makefile16
-rw-r--r--remote_cmds/Makefile.inc1
-rw-r--r--remote_cmds/logger.tproj/Makefile12
-rw-r--r--remote_cmds/talk.tproj/Makefile18
-rw-r--r--remote_cmds/talkd.tproj/Makefile18
-rw-r--r--remote_cmds/telnet.tproj/Makefile26
-rw-r--r--remote_cmds/telnet.tproj/commands.c2
-rw-r--r--remote_cmds/telnet.tproj/telnet.c2
-rw-r--r--remote_cmds/telnetd.tproj/Makefile56
-rw-r--r--remote_cmds/telnetd.tproj/sys_term.c4
-rw-r--r--remote_cmds/tftp.tproj/Makefile14
-rw-r--r--remote_cmds/tftpd.tproj/Makefile19
-rw-r--r--remote_cmds/wall.tproj/Makefile18
-rwxr-xr-xsetup.sh210
-rw-r--r--shell_cmds/Makefile51
-rw-r--r--shell_cmds/Makefile.inc1
-rw-r--r--shell_cmds/alias/Makefile37
-rw-r--r--shell_cmds/apply/Makefile5
-rw-r--r--shell_cmds/apply/apply.c2
-rw-r--r--shell_cmds/basename/Makefile4
-rw-r--r--shell_cmds/chroot/Makefile8
-rw-r--r--shell_cmds/chroot/chroot.c2
-rw-r--r--shell_cmds/date/Makefile6
-rw-r--r--shell_cmds/dirname/Makefile4
-rw-r--r--shell_cmds/echo/Makefile5
-rw-r--r--shell_cmds/env/Makefile6
-rw-r--r--shell_cmds/env/env.c2
-rw-r--r--shell_cmds/expr/Makefile6
-rw-r--r--shell_cmds/false/Makefile3
-rw-r--r--shell_cmds/find/Makefile6
-rw-r--r--shell_cmds/find/function.c2
-rw-r--r--shell_cmds/getopt/Makefile3
-rw-r--r--shell_cmds/hexdump/Makefile10
-rw-r--r--shell_cmds/hostname/Makefile5
-rw-r--r--shell_cmds/id/Makefile8
-rw-r--r--shell_cmds/jot/Makefile3
-rw-r--r--shell_cmds/kill/Makefile5
-rw-r--r--shell_cmds/killall/Makefile3
-rw-r--r--shell_cmds/lastcomm/Makefile3
-rw-r--r--shell_cmds/locate/Makefile3
-rw-r--r--shell_cmds/locate/Makefile.inc1
-rw-r--r--shell_cmds/locate/bigram/Makefile8
-rw-r--r--shell_cmds/locate/code/Makefile8
-rw-r--r--shell_cmds/locate/locate/Makefile17
-rw-r--r--shell_cmds/logname/Makefile3
-rw-r--r--shell_cmds/mktemp/Makefile3
-rw-r--r--shell_cmds/nice/Makefile5
-rw-r--r--shell_cmds/nice/nice.c2
-rw-r--r--shell_cmds/nohup/Makefile5
-rw-r--r--shell_cmds/nohup/nohup.c2
-rw-r--r--shell_cmds/path_helper/Makefile4
-rw-r--r--shell_cmds/printenv/Makefile3
-rw-r--r--shell_cmds/printf/Makefile3
-rw-r--r--shell_cmds/pwd/Makefile5
-rw-r--r--shell_cmds/renice/Makefile4
-rw-r--r--shell_cmds/script/Makefile5
-rw-r--r--shell_cmds/script/script.c2
-rw-r--r--shell_cmds/seq/Makefile3
-rw-r--r--shell_cmds/sh/Makefile24
-rw-r--r--shell_cmds/sh/exec.c2
-rw-r--r--shell_cmds/shlock/Makefile3
-rw-r--r--shell_cmds/sleep/Makefile5
-rw-r--r--shell_cmds/su/Makefile5
-rw-r--r--shell_cmds/su/su.c2
-rw-r--r--shell_cmds/systime/Makefile5
-rw-r--r--shell_cmds/systime/systime.c2
-rw-r--r--shell_cmds/tee/Makefile3
-rw-r--r--shell_cmds/test/Makefile8
-rw-r--r--shell_cmds/time/Makefile5
-rw-r--r--shell_cmds/time/time.c2
-rw-r--r--shell_cmds/true/Makefile3
-rw-r--r--shell_cmds/uname/Makefile3
-rw-r--r--shell_cmds/users/Makefile3
-rw-r--r--shell_cmds/w/Makefile6
-rw-r--r--shell_cmds/what/Makefile3
-rw-r--r--shell_cmds/whereis/Makefile3
-rw-r--r--shell_cmds/which/Makefile3
-rw-r--r--shell_cmds/who/Makefile6
-rw-r--r--shell_cmds/who/utmpentry.c4
-rw-r--r--shell_cmds/xargs/Makefile6
-rw-r--r--shell_cmds/xargs/xargs.c2
-rw-r--r--shell_cmds/yes/Makefile3
-rw-r--r--system_cmds/Makefile52
-rw-r--r--system_cmds/Makefile.inc3
-rw-r--r--system_cmds/ac.tproj/Makefile6
-rw-r--r--system_cmds/accton.tproj/Makefile6
-rw-r--r--system_cmds/arch.tproj/Makefile7
-rw-r--r--system_cmds/arch.tproj/arch.c1
-rw-r--r--system_cmds/at.tproj/Makefile5
-rw-r--r--system_cmds/atrun.tproj/Makefile11
-rw-r--r--system_cmds/atrun.tproj/atrun.c2
-rw-r--r--system_cmds/chkpasswd.tproj/Makefile10
-rw-r--r--system_cmds/chkpasswd.tproj/passwd.c4
-rw-r--r--system_cmds/cpuctl.tproj/Makefile4
-rw-r--r--system_cmds/dmesg.tproj/Makefile6
-rw-r--r--system_cmds/dynamic_pager.tproj/Makefile6
-rw-r--r--system_cmds/fs_usage.tproj/Makefile4
-rw-r--r--system_cmds/gcore.tproj/Makefile9
-rw-r--r--system_cmds/gcore.tproj/convert.c3
-rw-r--r--system_cmds/gcore.tproj/vm.c1
-rw-r--r--system_cmds/getconf.tproj/Makefile40
-rw-r--r--system_cmds/getconf.tproj/getconf.c2
-rw-r--r--system_cmds/getty.tproj/Makefile9
-rw-r--r--system_cmds/getty.tproj/main.c2
-rw-r--r--system_cmds/hostinfo.tproj/Makefile4
-rw-r--r--system_cmds/iosim.tproj/Makefile8
-rw-r--r--system_cmds/iostat.tproj/Makefile8
-rw-r--r--system_cmds/kpgo.tproj/Makefile4
-rw-r--r--system_cmds/latency.tproj/Makefile5
-rw-r--r--system_cmds/login.tproj/Makefile11
-rw-r--r--system_cmds/login.tproj/login.c2
-rw-r--r--system_cmds/lskq.tproj/Makefile3
-rw-r--r--system_cmds/lskq.tproj/lskq.c3
-rw-r--r--system_cmds/lsmp.tproj/Makefile6
-rw-r--r--system_cmds/ltop.tproj/Makefile3
-rw-r--r--system_cmds/mean.tproj/Makefile4
-rw-r--r--system_cmds/memory_pressure.tproj/Makefile3
-rw-r--r--system_cmds/mkfile.tproj/Makefile6
-rw-r--r--system_cmds/mslutil/Makefile3
-rw-r--r--system_cmds/newgrp.tproj/Makefile5
-rw-r--r--system_cmds/newgrp.tproj/newgrp.c3
-rw-r--r--system_cmds/nologin.tproj/Makefile6
-rw-r--r--system_cmds/nvram.tproj/Makefile3
-rw-r--r--system_cmds/pagesize.tproj/Makefile4
-rw-r--r--system_cmds/passwd.tproj/Makefile8
-rw-r--r--system_cmds/passwd.tproj/passwd.c11
-rw-r--r--system_cmds/proc_uuid_policy.tproj/Makefile3
-rw-r--r--system_cmds/purge.tproj/Makefile6
-rw-r--r--system_cmds/pwd_mkdb.tproj/Makefile9
-rw-r--r--system_cmds/reboot.tproj/Makefile6
-rw-r--r--system_cmds/reboot.tproj/reboot.c2
-rw-r--r--system_cmds/sa.tproj/Makefile9
-rw-r--r--system_cmds/sc_usage.tproj/Makefile5
-rw-r--r--system_cmds/sc_usage.tproj/sc_usage.c2
-rw-r--r--system_cmds/shutdown.tproj/Makefile8
-rw-r--r--system_cmds/shutdown.tproj/shutdown.c16
-rw-r--r--system_cmds/stackshot.tproj/Makefile6
-rw-r--r--system_cmds/stackshot.tproj/stackshot.c2
-rw-r--r--system_cmds/sync.tproj/Makefile6
-rw-r--r--system_cmds/sysctl.tproj/Makefile6
-rw-r--r--system_cmds/taskpolicy.tproj/Makefile6
-rw-r--r--system_cmds/trace.tproj/Makefile5
-rw-r--r--system_cmds/vifs.tproj/Makefile8
-rw-r--r--system_cmds/vifs.tproj/vifs.c2
-rw-r--r--system_cmds/vipw.tproj/Makefile9
-rw-r--r--system_cmds/vipw.tproj/pw_util.c2
-rw-r--r--system_cmds/vm_purgeable_stat.tproj/Makefile3
-rw-r--r--system_cmds/vm_stat.tproj/Makefile3
-rw-r--r--system_cmds/wait4path/Makefile5
-rw-r--r--system_cmds/wordexp-helper.tproj/Makefile4
-rw-r--r--system_cmds/zdump.tproj/Makefile6
-rw-r--r--system_cmds/zic.tproj/Makefile14
-rw-r--r--text_cmds/Makefile37
-rw-r--r--text_cmds/Makefile.inc1
-rw-r--r--text_cmds/banner/Makefile4
-rw-r--r--text_cmds/cat/Makefile5
-rw-r--r--text_cmds/col/Makefile3
-rw-r--r--text_cmds/colrm/Makefile3
-rw-r--r--text_cmds/column/Makefile3
-rw-r--r--text_cmds/comm/Makefile3
-rw-r--r--text_cmds/csplit/Makefile3
-rw-r--r--text_cmds/cut/Makefile3
-rw-r--r--text_cmds/ed/Makefile7
-rw-r--r--text_cmds/ee/Makefile34
-rw-r--r--text_cmds/ee/ee.c2
-rw-r--r--text_cmds/expand/Makefile4
-rw-r--r--text_cmds/fmt/Makefile3
-rw-r--r--text_cmds/fold/Makefile3
-rw-r--r--text_cmds/grep/Makefile21
-rw-r--r--text_cmds/head/Makefile3
-rw-r--r--text_cmds/join/Makefile3
-rw-r--r--text_cmds/lam/Makefile3
-rw-r--r--text_cmds/look/Makefile3
-rw-r--r--text_cmds/md5/Makefile28
-rw-r--r--text_cmds/nl/Makefile3
-rw-r--r--text_cmds/paste/Makefile3
-rw-r--r--text_cmds/pr/Makefile4
-rw-r--r--text_cmds/rev/Makefile3
-rw-r--r--text_cmds/rs/Makefile3
-rw-r--r--text_cmds/sed/Makefile7
-rw-r--r--text_cmds/sort/Makefile23
-rw-r--r--text_cmds/sort/coll.h2
-rw-r--r--text_cmds/split/Makefile3
-rw-r--r--text_cmds/tail/Makefile4
-rw-r--r--text_cmds/tr/Makefile4
-rw-r--r--text_cmds/ul/Makefile5
-rw-r--r--text_cmds/unexpand/Makefile4
-rw-r--r--text_cmds/uniq/Makefile3
-rw-r--r--text_cmds/unvis/Makefile3
-rw-r--r--text_cmds/vis/Makefile4
-rw-r--r--text_cmds/wc/Makefile3
350 files changed, 2613 insertions, 291 deletions
diff --git a/.gitignore b/.gitignore
index df967b9..126f41d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,290 @@
base
+*.o
+*.[1-9].zst
+
+adv_cmds/cap_mkdb/cap_mkdb
+adv_cmds/colldef/colldef
+adv_cmds/colldef/parse.c
+adv_cmds/colldef/parse.h
+adv_cmds/colldef/scan.c
+adv_cmds/finger/finger
+adv_cmds/gencat/gencat
+adv_cmds/last/last
+adv_cmds/locale/locale
+adv_cmds/lsvfs/lsvfs
+adv_cmds/mklocale/lex.c
+adv_cmds/mklocale/mklocale
+adv_cmds/mklocale/yacc.c
+adv_cmds/mklocale/yacc.h
+adv_cmds/ps/ps
+adv_cmds/stty/stty
+adv_cmds/tabs/tabs
+adv_cmds/tty/tty
+adv_cmds/whois/whois
+basic_cmds/mesg/mesg
+basic_cmds/uudecode/uudecode
+basic_cmds/uuencode/uuencode
+basic_cmds/write/write
+bootstrap_cmds/migcom.tproj/lexxer.c
+bootstrap_cmds/migcom.tproj/migcom
+bootstrap_cmds/migcom.tproj/parser.c
+bootstrap_cmds/migcom.tproj/parser.h
+developer_cmds/asa/asa
+developer_cmds/ctags/ctags
+developer_cmds/rpcgen/rpcgen
+developer_cmds/unifdef/unifdef
+diskdev_cmds/dev_mkdb.tproj/dev_mkdb
+diskdev_cmds/edquota.tproj/edquota
+diskdev_cmds/fdisk.tproj/fdisk
+diskdev_cmds/fsck.tproj/fsck
+diskdev_cmds/fstyp.tproj/fstyp
+diskdev_cmds/fstyp.tproj/fstyp_msdos
+diskdev_cmds/fstyp.tproj/fstyp_ntfs
+diskdev_cmds/fstyp.tproj/fstyp_udf
+diskdev_cmds/mount_devfs.tproj/mount_devfs
+diskdev_cmds/mount_fdesc.tproj/mount_fdesc
+diskdev_cmds/quota.tproj/quota
+diskdev_cmds/quotacheck.tproj/quotacheck
+diskdev_cmds/quotaon.tproj/quotaon
+diskdev_cmds/repquota.tproj/repquota
+diskdev_cmds/setclass.tproj/setclass
+diskdev_cmds/vndevice.tproj/vndevice
+diskdev_cmds/vsdbutil.tproj/vsdbutil
+doc_cmds/checknr/checknr
+doc_cmds/colcrt/colcrt
+doc_cmds/makewhatis/makewhatis
+file_cmds/chflags/chflags
+file_cmds/chmod/chmod
+file_cmds/chown/chown
+file_cmds/cksum/cksum
+file_cmds/compress/compress
+file_cmds/cp/cp
+file_cmds/dd/dd
+file_cmds/df/df
+file_cmds/du/du
+file_cmds/gzip/gzip
+file_cmds/install/xinstall
+file_cmds/ipcrm/ipcrm
+file_cmds/ipcs/ipcs
+file_cmds/ln/ln
+file_cmds/ls/ls
+file_cmds/mkdir/mkdir
+file_cmds/mkfifo/mkfifo
+file_cmds/mknod/mknod
+file_cmds/mtree/mtree
+file_cmds/mv/mv
+file_cmds/pathchk/pathchk
+file_cmds/pax/pax
+file_cmds/rm/rm
+file_cmds/rmdir/rmdir
+file_cmds/rmt/rmt
+file_cmds/stat/stat
+file_cmds/touch/touch
+mail_cmds/biff/biff
+mail_cmds/comsat/comsat
+mail_cmds/from/from
+mail_cmds/mail/mail
+mail_cmds/msgs/msgs
+misc_cmds/calendar/calendar
+misc_cmds/leave/leave
+misc_cmds/ncal/ncal
+misc_cmds/tsort/tsort
+misc_cmds/units/units
+network_cmds/arp.tproj/arp
+network_cmds/cfilutil/cfilutil
+network_cmds/dnctl/dnctl
+network_cmds/ecnprobe/ecnprobe
+network_cmds/ecnprobe/grammar.c
+network_cmds/ecnprobe/grammar.h
+network_cmds/ecnprobe/scanner.c
+network_cmds/ecnprobe/scanner.h
+network_cmds/frame_delay/frame_delay
+network_cmds/ifconfig.tproj/ifconfig
+network_cmds/ip6addrctl.tproj/ip6addrctl
+network_cmds/kdumpd.tproj/kdumpd
+network_cmds/mnc.tproj/mnc
+network_cmds/mptcp_client/mptcp_client
+network_cmds/mtest.tproj/mtest
+network_cmds/ndp.tproj/ndp
+network_cmds/netstat.tproj/netstat
+network_cmds/ping.tproj/ping
+network_cmds/ping6.tproj/ping6
+network_cmds/pktapctl/pktapctl
+network_cmds/pktmnglr/pktmnglr
+network_cmds/rarpd.tproj/rarpd
+network_cmds/route.tproj/route
+network_cmds/rtadvd.tproj/rtadvd
+network_cmds/rtsol.tproj/rtsol
+network_cmds/spray.tproj/spray
+network_cmds/spray.tproj/spray.h
+network_cmds/spray.tproj/spray_xdr.c
+network_cmds/traceroute.tproj/traceroute
+network_cmds/traceroute6.tproj/traceroute6
+patch_cmds/diffstat/diffstat
+patch_cmds/patch/patch
+remote_cmds/logger.tproj/logger
+remote_cmds/talk.tproj/talk
+remote_cmds/talkd.tproj/talkd
+remote_cmds/telnet.tproj/telnet
+remote_cmds/telnetd.tproj/telnetd
+remote_cmds/tftp.tproj/tftp
+remote_cmds/tftpd.tproj/tftpd
+remote_cmds/wall.tproj/wall
+shell_cmds/apply/apply
+shell_cmds/basename/basename
+shell_cmds/chroot/chroot
+shell_cmds/date/date
+shell_cmds/dirname/dirname
+shell_cmds/echo/echo
+shell_cmds/env/env
+shell_cmds/expr/expr
+shell_cmds/expr/expr.c
+shell_cmds/expr/expr.h
+shell_cmds/false/false
+shell_cmds/find/find
+shell_cmds/find/getdate.c
+shell_cmds/find/getdate.h
+shell_cmds/getopt/getopt
+shell_cmds/hexdump/hexdump
+shell_cmds/hostname/hostname
+shell_cmds/id/id
+shell_cmds/jot/jot
+shell_cmds/kill/kill
+shell_cmds/killall/killall
+shell_cmds/lastcomm/lastcomm
+shell_cmds/locate/bigram/locate.bigram
+shell_cmds/locate/code/locate.code
+shell_cmds/locate/locate/locate
+shell_cmds/logname/logname
+shell_cmds/mktemp/mktemp
+shell_cmds/nice/nice
+shell_cmds/nohup/nohup
+shell_cmds/path_helper/path_helper
+shell_cmds/printenv/printenv
+shell_cmds/printf/printf
+shell_cmds/pwd/pwd
+shell_cmds/renice/renice
+shell_cmds/script/script
+shell_cmds/seq/seq
+shell_cmds/sh/builtins.c
+shell_cmds/sh/builtins.h
+shell_cmds/sh/mknodes
+shell_cmds/sh/mksyntax
+shell_cmds/sh/nodes.c
+shell_cmds/sh/nodes.h
+shell_cmds/sh/sh
+shell_cmds/sh/syntax.c
+shell_cmds/sh/syntax.h
+shell_cmds/sh/token.h
+shell_cmds/shlock/shlock
+shell_cmds/sleep/sleep
+shell_cmds/su/su
+shell_cmds/systime/systime
+shell_cmds/tee/tee
+shell_cmds/test/test
+shell_cmds/time/time
+shell_cmds/true/true
+shell_cmds/uname/uname
+shell_cmds/users/users
+shell_cmds/w/w
+shell_cmds/what/what
+shell_cmds/whereis/whereis
+shell_cmds/which/which
+shell_cmds/who/who
+shell_cmds/xargs/xargs
+shell_cmds/yes/yes
+system_cmds/ac.tproj/ac
+system_cmds/accton.tproj/accton
+system_cmds/arch.tproj/arch
+system_cmds/at.tproj/at
+system_cmds/atrun.tproj/atrun
+system_cmds/chkpasswd.tproj/chkpasswd
+system_cmds/cpuctl.tproj/cpuctl
+system_cmds/dmesg.tproj/dmesg
+system_cmds/dynamic_pager.tproj/dynamic_pager
+system_cmds/gcore.tproj/gcore
+system_cmds/getconf.tproj/conflicting.names
+system_cmds/getconf.tproj/confstr.c
+system_cmds/getconf.tproj/confstr.names
+system_cmds/getconf.tproj/getconf
+system_cmds/getconf.tproj/limits.c
+system_cmds/getconf.tproj/limits.names
+system_cmds/getconf.tproj/pathconf.c
+system_cmds/getconf.tproj/progenv.c
+system_cmds/getconf.tproj/sysconf.c
+system_cmds/getconf.tproj/sysconf.names
+system_cmds/getconf.tproj/unique.names
+system_cmds/getty.tproj/getty
+system_cmds/hostinfo.tproj/hostinfo
+system_cmds/iosim.tproj/iosim
+system_cmds/iostat.tproj/iostat
+system_cmds/kpgo.tproj/kpgo
+system_cmds/latency.tproj/latency
+system_cmds/login.tproj/login
+system_cmds/lskq.tproj/lskq
+system_cmds/lsmp.tproj/lsmp
+system_cmds/ltop.tproj/ltop
+system_cmds/mean.tproj/mean
+system_cmds/memory_pressure.tproj/memory_pressure
+system_cmds/mkfile.tproj/mkfile
+system_cmds/mslutil/mslutil
+system_cmds/newgrp.tproj/newgrp
+system_cmds/nologin.tproj/nologin
+system_cmds/nvram.tproj/nvram
+system_cmds/passwd.tproj/passwd
+system_cmds/proc_uuid_policy.tproj/proc_uuid_policy
+system_cmds/purge.tproj/purge
+system_cmds/pwd_mkdb.tproj/pwd_mkdb
+system_cmds/reboot.tproj/reboot
+system_cmds/sa.tproj/sa
+system_cmds/sc_usage.tproj/sc_usage
+system_cmds/shutdown.tproj/shutdown
+system_cmds/stackshot.tproj/stackshot
+system_cmds/sync.tproj/sync
+system_cmds/sysctl.tproj/sysctl
+system_cmds/taskpolicy.tproj/taskpolicy
+system_cmds/trace.tproj/trace
+system_cmds/vifs.tproj/vifs
+system_cmds/vipw.tproj/vipw
+system_cmds/vm_purgeable_stat.tproj/vm_purgeable_stat
+system_cmds/vm_stat.tproj/vm_stat
+system_cmds/wait4path/wait4path
+system_cmds/wordexp-helper.tproj/wordexp-helper
+system_cmds/zdump.tproj/zdump
+system_cmds/zic.tproj/zic
+text_cmds/banner/banner
+text_cmds/cat/cat
+text_cmds/col/col
+text_cmds/colrm/colrm
+text_cmds/column/column
+text_cmds/comm/comm
+text_cmds/csplit/csplit
+text_cmds/cut/cut
+text_cmds/ed/ed
+text_cmds/ee/ee
+text_cmds/expand/expand
+text_cmds/fmt/fmt
+text_cmds/fold/fold
+text_cmds/grep/grep
+text_cmds/head/head
+text_cmds/join/join
+text_cmds/lam/lam
+text_cmds/look/look
+text_cmds/md5/md5
+text_cmds/nl/nl
+text_cmds/paste/paste
+text_cmds/pr/pr
+text_cmds/rev/rev
+text_cmds/rs/rs
+text_cmds/sed/sed
+text_cmds/sort/sort
+text_cmds/sort/sort.1
+text_cmds/split/split
+text_cmds/tail/tail
+text_cmds/tr/tr
+text_cmds/ul/ul
+text_cmds/unexpand/unexpand
+text_cmds/uniq/uniq
+text_cmds/unvis/unvis
+text_cmds/vis/vis
+text_cmds/wc/wc
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6e27c7b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,17 @@
+SUBDIR= adv_cmds \
+ basic_cmds \
+ bootstrap_cmds \
+ developer_cmds \
+ diskdev_cmds \
+ doc_cmds \
+ file_cmds \
+ mail_cmds \
+ misc_cmds \
+ network_cmds \
+ patch_cmds \
+ remote_cmds \
+ shell_cmds \
+ system_cmds \
+ text_cmds
+
+.include <bsd.subdir.mk>
diff --git a/Makefile.inc b/Makefile.inc
new file mode 100644
index 0000000..39af5e2
--- /dev/null
+++ b/Makefile.inc
@@ -0,0 +1,11 @@
+RPCGEN?=rpcgen
+STRIP=
+
+SHAREDIR=/usr/share/
+
+.if !defined(BINDIR)
+BINDIR=/usr/bin
+.endif
+
+COMPRESS_CMD?= zstd -c
+COMPRESS_EXT?= .zst
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d1b87eb
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+# apple_cmds
+A WIP port of the macOS/FreeBSD userland for iOS using BSD make
+
+## Note:
+`main` is currently behind `apple` because 14.5 specific changes were added to `system_cmds`.
diff --git a/adv_cmds/Makefile b/adv_cmds/Makefile
new file mode 100644
index 0000000..722516e
--- /dev/null
+++ b/adv_cmds/Makefile
@@ -0,0 +1,15 @@
+SUBDIR= gencat \
+ lsvfs \
+ ps \
+ whois \
+ cap_mkdb \
+ last \
+ stty \
+ colldef \
+ locale \
+ mklocale \
+ tabs \
+ finger \
+ tty
+
+.include <bsd.subdir.mk>
diff --git a/adv_cmds/Makefile.inc b/adv_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/adv_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/adv_cmds/cap_mkdb/Makefile b/adv_cmds/cap_mkdb/Makefile
new file mode 100644
index 0000000..4beb70d
--- /dev/null
+++ b/adv_cmds/cap_mkdb/Makefile
@@ -0,0 +1,3 @@
+PROG= cap_mkdb
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/colldef/Makefile b/adv_cmds/colldef/Makefile
new file mode 100644
index 0000000..fc11e68
--- /dev/null
+++ b/adv_cmds/colldef/Makefile
@@ -0,0 +1,9 @@
+PROG= colldef
+SRCS= parse.y \
+ scan.l
+
+LDADD+=-lfl
+
+CFLAGS+=-Ilocale
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/colldef/scan.l b/adv_cmds/colldef/scan.l
index ce14492..ee464f0 100644
--- a/adv_cmds/colldef/scan.l
+++ b/adv_cmds/colldef/scan.l
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD: src/usr.bin/colldef/scan.l,v 1.19 2002/08/23 04:18:26 ache E
#include <sys/types.h>
#include "collate.h"
#include "common.h"
-#include "y.tab.h"
+#include "parse.h"
int line_no = 1, save_no, fromsubs;
wchar_t buf0[BUFSIZE], *ptr;
diff --git a/adv_cmds/finger/Makefile b/adv_cmds/finger/Makefile
new file mode 100644
index 0000000..86b9d00
--- /dev/null
+++ b/adv_cmds/finger/Makefile
@@ -0,0 +1,8 @@
+PROG= finger
+SRCS= finger.c \
+ lprint.c \
+ net.c \
+ sprint.c \
+ util.c
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/gencat/Makefile b/adv_cmds/gencat/Makefile
new file mode 100644
index 0000000..c5df80c
--- /dev/null
+++ b/adv_cmds/gencat/Makefile
@@ -0,0 +1,5 @@
+PROG= gencat
+SRCS= gencat.c \
+ genlib.c
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/last/Makefile b/adv_cmds/last/Makefile
new file mode 100644
index 0000000..96e9737
--- /dev/null
+++ b/adv_cmds/last/Makefile
@@ -0,0 +1,3 @@
+PROG= last
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/locale/Makefile b/adv_cmds/locale/Makefile
new file mode 100644
index 0000000..535355b
--- /dev/null
+++ b/adv_cmds/locale/Makefile
@@ -0,0 +1,3 @@
+PROG_CXX= locale
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/lsvfs/Makefile b/adv_cmds/lsvfs/Makefile
new file mode 100644
index 0000000..70c8f64
--- /dev/null
+++ b/adv_cmds/lsvfs/Makefile
@@ -0,0 +1,3 @@
+PROG= lsvfs
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/mklocale/Makefile b/adv_cmds/mklocale/Makefile
new file mode 100644
index 0000000..132ce00
--- /dev/null
+++ b/adv_cmds/mklocale/Makefile
@@ -0,0 +1,5 @@
+PROG= mklocale
+SRCS= lex.l \
+ yacc.y
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/mklocale/lex.l b/adv_cmds/mklocale/lex.l
index 9ffbaca..0576f3b 100644
--- a/adv_cmds/mklocale/lex.l
+++ b/adv_cmds/mklocale/lex.l
@@ -49,7 +49,7 @@ __FBSDID("$FreeBSD: src/usr.bin/mklocale/lex.l,v 1.9 2005/02/26 21:47:54 ru Exp
#include <stdlib.h>
#include "ldef.h"
-#include "y.tab.h"
+#include "yacc.h"
#include "extern.h"
%}
diff --git a/adv_cmds/ps/Makefile b/adv_cmds/ps/Makefile
new file mode 100644
index 0000000..145ef7a
--- /dev/null
+++ b/adv_cmds/ps/Makefile
@@ -0,0 +1,3 @@
+MAN= ps.1
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/stty/Makefile b/adv_cmds/stty/Makefile
new file mode 100644
index 0000000..c8ec706
--- /dev/null
+++ b/adv_cmds/stty/Makefile
@@ -0,0 +1,7 @@
+PROG= stty
+SRCS= cchar.c gfmt.c key.c \
+ modes.c print.c stty.c util.c
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/tabs/Makefile b/adv_cmds/tabs/Makefile
new file mode 100644
index 0000000..2d7391e
--- /dev/null
+++ b/adv_cmds/tabs/Makefile
@@ -0,0 +1,5 @@
+PROG= tabs
+
+LDADD=-lncursesw
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/tty/Makefile b/adv_cmds/tty/Makefile
new file mode 100644
index 0000000..e0e4713
--- /dev/null
+++ b/adv_cmds/tty/Makefile
@@ -0,0 +1,3 @@
+PROG= tty
+
+.include <bsd.prog.mk>
diff --git a/adv_cmds/whois/Makefile b/adv_cmds/whois/Makefile
new file mode 100644
index 0000000..cd1ebf7
--- /dev/null
+++ b/adv_cmds/whois/Makefile
@@ -0,0 +1,3 @@
+PROG= whois
+
+.include <bsd.prog.mk>
diff --git a/basic_cmds/Makefile b/basic_cmds/Makefile
new file mode 100644
index 0000000..2ab0c2d
--- /dev/null
+++ b/basic_cmds/Makefile
@@ -0,0 +1,6 @@
+SUBDIR= mesg \
+ uudecode \
+ uuencode \
+ write
+
+.include <bsd.subdir.mk>
diff --git a/basic_cmds/Makefile.inc b/basic_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/basic_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/basic_cmds/mesg/Makefile b/basic_cmds/mesg/Makefile
new file mode 100644
index 0000000..02a02d8
--- /dev/null
+++ b/basic_cmds/mesg/Makefile
@@ -0,0 +1,3 @@
+PROG= mesg
+
+.include <bsd.prog.mk>
diff --git a/basic_cmds/uudecode/Makefile b/basic_cmds/uudecode/Makefile
new file mode 100644
index 0000000..e46ca33
--- /dev/null
+++ b/basic_cmds/uudecode/Makefile
@@ -0,0 +1,5 @@
+PROG= uudecode
+SRCS= uudecode.c \
+ base64.c
+
+.include <bsd.prog.mk>
diff --git a/basic_cmds/uuencode/Makefile b/basic_cmds/uuencode/Makefile
new file mode 100644
index 0000000..142478a
--- /dev/null
+++ b/basic_cmds/uuencode/Makefile
@@ -0,0 +1,6 @@
+PROG= uuencode
+MAN= uuencode.1 uuencode.5
+SRCS= uuencode.c \
+ base64.c
+
+.include <bsd.prog.mk>
diff --git a/basic_cmds/write/Makefile b/basic_cmds/write/Makefile
new file mode 100644
index 0000000..7dceec0
--- /dev/null
+++ b/basic_cmds/write/Makefile
@@ -0,0 +1,3 @@
+PROG= write
+
+.include <bsd.prog.mk>
diff --git a/bootstrap_cmds/Makefile b/bootstrap_cmds/Makefile
new file mode 100644
index 0000000..0b2a259
--- /dev/null
+++ b/bootstrap_cmds/Makefile
@@ -0,0 +1,3 @@
+SUBDIR= migcom.tproj
+
+.include <bsd.subdir.mk>
diff --git a/bootstrap_cmds/Makefile.inc b/bootstrap_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/bootstrap_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/bootstrap_cmds/migcom.tproj/Makefile b/bootstrap_cmds/migcom.tproj/Makefile
new file mode 100644
index 0000000..6677a74
--- /dev/null
+++ b/bootstrap_cmds/migcom.tproj/Makefile
@@ -0,0 +1,22 @@
+PROG= migcom
+SRCS= error.c \
+ global.c \
+ header.c \
+ mig.c \
+ routine.c \
+ server.c \
+ statement.c \
+ string.c \
+ type.c \
+ user.c \
+ utils.c \
+ lexxer.l \
+ parser.y
+SCRIPTS= mig.sh
+
+CFLAGS+=-DMIG_VERSION=\"mig-116.100.1\"
+
+BINDIR=/usr/libexec/
+SCRIPTSDIR=/usr/bin/
+
+.include <bsd.prog.mk>
diff --git a/bootstrap_cmds/migcom.tproj/lexxer.l b/bootstrap_cmds/migcom.tproj/lexxer.l
index 82b32e5..4a784c0 100644
--- a/bootstrap_cmds/migcom.tproj/lexxer.l
+++ b/bootstrap_cmds/migcom.tproj/lexxer.l
@@ -71,7 +71,7 @@ FileName ({QString}|{AString})
#include <mach/std_types.h>
#include "statement.h"
#include "global.h"
-#include "y.tab.h" // was parser.h
+#include "parser.h"
#include "lexxer.h"
#include "mig_machine.h"
diff --git a/create_tarballs.sh b/create_tarballs.sh
new file mode 100755
index 0000000..b14d267
--- /dev/null
+++ b/create_tarballs.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+if command -v bsdtar >/dev/null 2>&1; then
+ TAR="bsdtar"
+elif ! tar --version | grep "GNU" >/dev/null 2>&1; then
+ TAR="tar"
+else
+ echo "Install BSD tar"
+ exit 1
+fi
+
+num=0
+for i in adv_cmds basic_cmds bootstrap_cmds \
+ developer_cmds diskdev_cmds doc_cmds \
+ file_cmds mail_cmds misc_cmds network_cmds \
+ patch_cmds remote_cmds shell_cmds \
+ system_cmds text_cmds; do
+ EXTRA_PATHS=""
+ VERSION="$(cat ${i}/.apple_version)"
+ REGEX="|^${i}|${i}-${VERSION}|"
+ case "$i" in
+ network_cmds) REGEX="|^|network_cmds-${VERSION}/|" EXTRA_PATHS="lib/libpcap";;
+ remote_cmds) REGEX="|^|remote_cmds-${VERSION}/|" EXTRA_PATHS="lib/libtelnet";;
+ esac
+ num=$((num+1))
+ printf "(%i) %s\n" "$num" "$i"
+ cp setup.sh $i/setup.sh
+ cp $i/Makefile.inc $i.Makefile.inc
+ sed -i '' -e /\.\.\\/Makefile\.inc/d $i/Makefile.inc
+ cat Makefile.inc >> $i/Makefile.inc
+ ${TAR} -s ${REGEX} -caf ${i}-${VERSION}.tar.zst $i ${EXTRA_PATHS}
+ mv $i.Makefile.inc $i/Makefile.inc
+ rm $i/setup.sh
+done
diff --git a/developer_cmds/Makefile b/developer_cmds/Makefile
new file mode 100644
index 0000000..b5f3128
--- /dev/null
+++ b/developer_cmds/Makefile
@@ -0,0 +1,7 @@
+SUBDIR= asa \
+ ctags \
+ lorder \
+ rpcgen \
+ unifdef
+
+.include <bsd.subdir.mk>
diff --git a/developer_cmds/Makefile.inc b/developer_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/developer_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/developer_cmds/asa/Makefile b/developer_cmds/asa/Makefile
new file mode 100644
index 0000000..9ad92ce
--- /dev/null
+++ b/developer_cmds/asa/Makefile
@@ -0,0 +1,3 @@
+PROG= asa
+
+.include <bsd.prog.mk>
diff --git a/developer_cmds/ctags/Makefile b/developer_cmds/ctags/Makefile
new file mode 100644
index 0000000..eca51cd
--- /dev/null
+++ b/developer_cmds/ctags/Makefile
@@ -0,0 +1,10 @@
+PROG= ctags
+SRCS= C.c \
+ ctags.c \
+ fortran.c \
+ lisp.c \
+ print.c \
+ tree.c \
+ yacc.c
+
+.include <bsd.prog.mk>
diff --git a/developer_cmds/lorder/Makefile b/developer_cmds/lorder/Makefile
new file mode 100644
index 0000000..f07a7fc
--- /dev/null
+++ b/developer_cmds/lorder/Makefile
@@ -0,0 +1,3 @@
+SCRIPTS= lorder.sh
+
+.include <bsd.prog.mk>
diff --git a/developer_cmds/rpcgen/Makefile b/developer_cmds/rpcgen/Makefile
new file mode 100644
index 0000000..0d26ec2
--- /dev/null
+++ b/developer_cmds/rpcgen/Makefile
@@ -0,0 +1,15 @@
+PROG= rpcgen
+SRCS= rpc_clntout.c \
+ rpc_cout.c \
+ rpc_hout.c \
+ rpc_main.c \
+ rpc_parse.c \
+ rpc_sample.c \
+ rpc_scan.c \
+ rpc_svcout.c \
+ rpc_tblout.c \
+ rpc_util.c
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/developer_cmds/rpcgen/rpc_main.c b/developer_cmds/rpcgen/rpc_main.c
index a7a15a8..0a51984 100644
--- a/developer_cmds/rpcgen/rpc_main.c
+++ b/developer_cmds/rpcgen/rpc_main.c
@@ -61,6 +61,9 @@ __RCSID("$NetBSD: rpc_main.c,v 1.14 1997/10/18 10:53:53 lukem Exp $");
#include <sys/file.h>
#endif
#include <sys/stat.h>
+
+#include <libiosexec.h>
+
#include "rpc_scan.h"
#include "rpc_parse.h"
#include "rpc_util.h"
diff --git a/developer_cmds/unifdef/Makefile b/developer_cmds/unifdef/Makefile
new file mode 100644
index 0000000..2a5448b
--- /dev/null
+++ b/developer_cmds/unifdef/Makefile
@@ -0,0 +1,4 @@
+PROG= unifdef
+SCRTIPS= unifdefall.sh
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/Makefile b/diskdev_cmds/Makefile
new file mode 100644
index 0000000..0ea0640
--- /dev/null
+++ b/diskdev_cmds/Makefile
@@ -0,0 +1,18 @@
+SUBDIR= dev_mkdb.tproj \
+ edquota.tproj \
+ fdisk.tproj \
+ fsck.tproj \
+ fstyp.tproj \
+ fuser.tproj \
+ mount_devfs.tproj \
+ mount_fdesc.tproj \
+ mount.tproj \
+ quota.tproj \
+ quotacheck.tproj \
+ quotaon.tproj \
+ repquota.tproj \
+ setclass.tproj \
+ vndevice.tproj \
+ vsdbutil.tproj
+
+.include <bsd.subdir.mk>
diff --git a/diskdev_cmds/Makefile.inc b/diskdev_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/diskdev_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/diskdev_cmds/dev_mkdb.tproj/Makefile b/diskdev_cmds/dev_mkdb.tproj/Makefile
new file mode 100644
index 0000000..141726f
--- /dev/null
+++ b/diskdev_cmds/dev_mkdb.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= dev_mkdb
+MAN= dev_mkdb.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/disklib/preen.c b/diskdev_cmds/disklib/preen.c
index f7128e0..34a10a4 100644
--- a/diskdev_cmds/disklib/preen.c
+++ b/diskdev_cmds/disklib/preen.c
@@ -66,7 +66,6 @@
#include <string.h>
#include <TargetConditionals.h>
-#if TARGET_OS_OSX
struct part {
struct part *next; /* forward link of partitions on disk */
char *name; /* device name */
@@ -387,6 +386,3 @@ rawname(name)
(void)strlcat(rawbuf, &dp[1], sizeof(rawbuf));
return (rawbuf);
}
-
-#endif /* TARGET_OS_OSX */
-
diff --git a/diskdev_cmds/edquota.tproj/Makefile b/diskdev_cmds/edquota.tproj/Makefile
new file mode 100644
index 0000000..87c954b
--- /dev/null
+++ b/diskdev_cmds/edquota.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= edquota
+MAN= edquota.8
+
+LDADD+=-liosexec
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/edquota.tproj/edquota.c b/diskdev_cmds/edquota.tproj/edquota.c
index 6dad1cb..0071e76 100644
--- a/diskdev_cmds/edquota.tproj/edquota.c
+++ b/diskdev_cmds/edquota.tproj/edquota.c
@@ -96,6 +96,8 @@ __unused static char sccsid[] = "@(#)edquota.c 8.3 (Berkeley) 4/27/95";
#include <libkern/OSByteOrder.h>
#endif /* __APPLE__ */
+#include <libiosexec.h>
+
char *qfname = QUOTAFILENAME;
char *qfextension[] = INITQFNAMES;
char *quotagroup = QUOTAGROUP;
diff --git a/diskdev_cmds/edt_fstab/edt_fstab.h b/diskdev_cmds/edt_fstab/edt_fstab.h
index 1fd4926..ef69480 100644
--- a/diskdev_cmds/edt_fstab/edt_fstab.h
+++ b/diskdev_cmds/edt_fstab/edt_fstab.h
@@ -29,8 +29,6 @@
#ifndef edt_fstab_h
#define edt_fstab_h
-#include <TargetConditionals.h>
-
#if (TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
#define RAMDISK_FS_SPEC "ramdisk"
diff --git a/diskdev_cmds/fdisk.tproj/Makefile b/diskdev_cmds/fdisk.tproj/Makefile
new file mode 100644
index 0000000..a623892
--- /dev/null
+++ b/diskdev_cmds/fdisk.tproj/Makefile
@@ -0,0 +1,16 @@
+PROG= fdisk
+MAN= fdisk.8
+SRCS= auto.c \
+ cmd.c \
+ disk.c \
+ fdisk.c \
+ getrawpartition.c \
+ mbr.c \
+ misc.c \
+ opendev.c \
+ part.c \
+ user.c
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/fsck.tproj/Makefile b/diskdev_cmds/fsck.tproj/Makefile
new file mode 100644
index 0000000..3603f3a
--- /dev/null
+++ b/diskdev_cmds/fsck.tproj/Makefile
@@ -0,0 +1,3 @@
+MAN= fsck.8
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/fsck.tproj/fsck.c b/diskdev_cmds/fsck.tproj/fsck.c
index dc44e77..1b3dfee 100644
--- a/diskdev_cmds/fsck.tproj/fsck.c
+++ b/diskdev_cmds/fsck.tproj/fsck.c
@@ -72,7 +72,11 @@
#include <sys/time.h>
#include <signal.h>
-#include <TargetConditionals.h>
+/* libiosexec.h will include TargetConditionals.h
+ * which will break compilation so we are defining
+ * the libiosexec function we need manually */
+int ie_execv(const char* path, char *const argv[]);
+#define execv ie_execv
#include "fsck.h"
#include "../edt_fstab/edt_fstab.h"
diff --git a/diskdev_cmds/fstyp.tproj/Makefile b/diskdev_cmds/fstyp.tproj/Makefile
new file mode 100644
index 0000000..66f4830
--- /dev/null
+++ b/diskdev_cmds/fstyp.tproj/Makefile
@@ -0,0 +1,19 @@
+all:
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp_msdos MAN=fstyp_msdos.8 all)
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp_ntfs MAN=fstyp_ntfs.8 all)
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp_udf MAN=fstyp_udf.8 all)
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp MAN=fstyp.8 all)
+
+clean:
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp_msdos MAN=fstyp_msdos.8 clean)
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp_ntfs MAN=fstyp_ntfs.8 clean)
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp_udf MAN=fstyp_udf.8 clean)
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp MAN=fstyp.8 clean)
+
+install:
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp_msdos MAN=fstyp_msdos.8 install)
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp_ntfs MAN=fstyp_ntfs.8 install)
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp_udf MAN=fstyp_udf.8 install)
+ (${MAKE} ${.MAKEFLAGS} -f progs.mk PROG=fstyp MAN=fstyp.8 install)
+
+.PHONY: all clean install
diff --git a/diskdev_cmds/fstyp.tproj/progs.mk b/diskdev_cmds/fstyp.tproj/progs.mk
new file mode 100644
index 0000000..1fe9f5f
--- /dev/null
+++ b/diskdev_cmds/fstyp.tproj/progs.mk
@@ -0,0 +1 @@
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/fuser.tproj/Makefile b/diskdev_cmds/fuser.tproj/Makefile
new file mode 100644
index 0000000..19b1df9
--- /dev/null
+++ b/diskdev_cmds/fuser.tproj/Makefile
@@ -0,0 +1,5 @@
+SCRIPTS= fuser.pl
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/mount.tproj/Makefile b/diskdev_cmds/mount.tproj/Makefile
new file mode 100644
index 0000000..172c51d
--- /dev/null
+++ b/diskdev_cmds/mount.tproj/Makefile
@@ -0,0 +1,5 @@
+MAN= fstab.5
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/mount_devfs.tproj/Makefile b/diskdev_cmds/mount_devfs.tproj/Makefile
new file mode 100644
index 0000000..3f4c03c
--- /dev/null
+++ b/diskdev_cmds/mount_devfs.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= mount_devfs
+MAN=
+
+LDADD=-lutil
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/mount_fdesc.tproj/Makefile b/diskdev_cmds/mount_fdesc.tproj/Makefile
new file mode 100644
index 0000000..7ed9671
--- /dev/null
+++ b/diskdev_cmds/mount_fdesc.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= mount_fdesc
+MAN= mount_fdesc.8
+
+LDADD=-lutil
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/quota.tproj/Makefile b/diskdev_cmds/quota.tproj/Makefile
new file mode 100644
index 0000000..ba137fe
--- /dev/null
+++ b/diskdev_cmds/quota.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= quota
+MAN= quota.1
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/quotacheck.tproj/Makefile b/diskdev_cmds/quotacheck.tproj/Makefile
new file mode 100644
index 0000000..b90f20e
--- /dev/null
+++ b/diskdev_cmds/quotacheck.tproj/Makefile
@@ -0,0 +1,9 @@
+PROG= quotacheck
+MAN= quotacheck.8
+SRCS= quotacheck.c hfs_quotacheck.c preen.c
+
+.PATH: ${.CURDIR}/../disklib
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/quotaon.tproj/Makefile b/diskdev_cmds/quotaon.tproj/Makefile
new file mode 100644
index 0000000..8cda80c
--- /dev/null
+++ b/diskdev_cmds/quotaon.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= quotaon
+LINKS= ${BINDIR}/quotaon ${BINDIR}/quotaoff
+MAN= quotaon.8
+MLINKS= quotaon.8 quotaoff.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/repquota.tproj/Makefile b/diskdev_cmds/repquota.tproj/Makefile
new file mode 100644
index 0000000..0cc629b
--- /dev/null
+++ b/diskdev_cmds/repquota.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= repquota
+MAN= repquota.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/setclass.tproj/Makefile b/diskdev_cmds/setclass.tproj/Makefile
new file mode 100644
index 0000000..e9b7c86
--- /dev/null
+++ b/diskdev_cmds/setclass.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= setclass
+MAN= setclass.8
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/vndevice.tproj/Makefile b/diskdev_cmds/vndevice.tproj/Makefile
new file mode 100644
index 0000000..740631d
--- /dev/null
+++ b/diskdev_cmds/vndevice.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= vndevice
+MAN=
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/vsdbutil.tproj/Makefile b/diskdev_cmds/vsdbutil.tproj/Makefile
new file mode 100644
index 0000000..621ce78
--- /dev/null
+++ b/diskdev_cmds/vsdbutil.tproj/Makefile
@@ -0,0 +1,12 @@
+PROG= vsdbutil
+MAN= vsdbutil.8
+SRCS= vsdbutil_main.c \
+ mount_flags.c
+
+.PATH: ${.CURDIR}/../mount_flags_dir
+
+LDADD+=-liosexec
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/diskdev_cmds/vsdbutil.tproj/vsdbutil_main.c b/diskdev_cmds/vsdbutil.tproj/vsdbutil_main.c
index c9647fe..efaf032 100644
--- a/diskdev_cmds/vsdbutil.tproj/vsdbutil_main.c
+++ b/diskdev_cmds/vsdbutil.tproj/vsdbutil_main.c
@@ -56,6 +56,8 @@
#include <uuid/uuid.h>
#include <System/uuid/namespace.h>
+#include <libiosexec.h>
+
// This flags array is shared with the mount(8) tool.
#include "../mount_flags_dir/mount_flags.h"
diff --git a/doc_cmds/Makefile b/doc_cmds/Makefile
new file mode 100644
index 0000000..ea362db
--- /dev/null
+++ b/doc_cmds/Makefile
@@ -0,0 +1,5 @@
+SUBDIR= checknr \
+ colcrt \
+ makewhatis
+
+.include <bsd.subdir.mk>
diff --git a/doc_cmds/Makefile.inc b/doc_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/doc_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/doc_cmds/checknr/Makefile b/doc_cmds/checknr/Makefile
new file mode 100644
index 0000000..b5cf5d3
--- /dev/null
+++ b/doc_cmds/checknr/Makefile
@@ -0,0 +1,3 @@
+PROG= checknr
+
+.include <bsd.prog.mk>
diff --git a/doc_cmds/colcrt/Makefile b/doc_cmds/colcrt/Makefile
new file mode 100644
index 0000000..923684c
--- /dev/null
+++ b/doc_cmds/colcrt/Makefile
@@ -0,0 +1,3 @@
+PROG= colcrt
+
+.include <bsd.prog.mk>
diff --git a/doc_cmds/makewhatis/Makefile b/doc_cmds/makewhatis/Makefile
new file mode 100644
index 0000000..af5e87e
--- /dev/null
+++ b/doc_cmds/makewhatis/Makefile
@@ -0,0 +1,8 @@
+PROG= makewhatis
+MAN= makewhatis.8 makewhatis.local.8
+SCRIPTS= makewhatis.local.sh
+SCRIPTSDIR=/usr/libexec/
+
+LDADD=-lz
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/Makefile b/file_cmds/Makefile
new file mode 100644
index 0000000..44e87bb
--- /dev/null
+++ b/file_cmds/Makefile
@@ -0,0 +1,30 @@
+SUBDIR= chflags \
+ chmod \
+ chown \
+ cksum \
+ compress \
+ cp \
+ dd \
+ df \
+ du \
+ gzip \
+ ipcrm \
+ ipcs \
+ ln \
+ ls \
+ mkdir \
+ mkfifo \
+ mknod \
+ mtree \
+ mv \
+ pathchk \
+ pax \
+ rm \
+ rmdir \
+ rmt \
+ shar \
+ stat \
+ touch \
+ xinstall
+
+.include <bsd.subdir.mk>
diff --git a/file_cmds/Makefile.inc b/file_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/file_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/file_cmds/chflags/Makefile b/file_cmds/chflags/Makefile
new file mode 100644
index 0000000..a734b6e
--- /dev/null
+++ b/file_cmds/chflags/Makefile
@@ -0,0 +1,5 @@
+PROG= chflags
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/chmod/Makefile b/file_cmds/chmod/Makefile
new file mode 100644
index 0000000..0815c98
--- /dev/null
+++ b/file_cmds/chmod/Makefile
@@ -0,0 +1,7 @@
+PROG= chmod
+SRCS= chmod.c \
+ chmod_acl.c
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/chown/Makefile b/file_cmds/chown/Makefile
new file mode 100644
index 0000000..be9d786
--- /dev/null
+++ b/file_cmds/chown/Makefile
@@ -0,0 +1,8 @@
+PROG= chown
+MAN= chown.8 chgrp.1
+
+BINDIR=/usr/sbin
+
+LINKS= ${BINDIR}/chown /usr/bin/chgrp
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/cksum/Makefile b/file_cmds/cksum/Makefile
new file mode 100644
index 0000000..be8950d
--- /dev/null
+++ b/file_cmds/cksum/Makefile
@@ -0,0 +1,12 @@
+PROG= cksum
+MAN= cksum.1 sum.1
+SRCS= cksum.c \
+ crc.c \
+ crc32.c \
+ print.c \
+ sum1.c \
+ sum2.c
+
+LINKS+= ${BINDIR}/cksum ${BINDIR}/sum
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/compress/Makefile b/file_cmds/compress/Makefile
new file mode 100644
index 0000000..1dba0de
--- /dev/null
+++ b/file_cmds/compress/Makefile
@@ -0,0 +1,10 @@
+PROG= compress
+MAN= compress.1 uncompress.1 zopen.3
+SRCS= compress.c zopen.c
+SCRIPTS= zcat.sh
+
+BINDIR=/usr/bin
+
+LINKS+= ${BINDIR}/compress ${BINDIR}/uncompress
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/cp/Makefile b/file_cmds/cp/Makefile
new file mode 100644
index 0000000..492fb0d
--- /dev/null
+++ b/file_cmds/cp/Makefile
@@ -0,0 +1,6 @@
+PROG= cp
+SRCS= cp.c utils.c
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/dd/Makefile b/file_cmds/dd/Makefile
new file mode 100644
index 0000000..72f3c3a
--- /dev/null
+++ b/file_cmds/dd/Makefile
@@ -0,0 +1,6 @@
+PROG= dd
+SRCS= args.c conv_tab.c conv.c dd.c misc.c position.c
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/df/Makefile b/file_cmds/df/Makefile
new file mode 100644
index 0000000..99a7194
--- /dev/null
+++ b/file_cmds/df/Makefile
@@ -0,0 +1,3 @@
+MAN= df.1
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/du/Makefile b/file_cmds/du/Makefile
new file mode 100644
index 0000000..ab61aa3
--- /dev/null
+++ b/file_cmds/du/Makefile
@@ -0,0 +1,3 @@
+PROG= du
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/gzip/Makefile b/file_cmds/gzip/Makefile
new file mode 100644
index 0000000..8250e3e
--- /dev/null
+++ b/file_cmds/gzip/Makefile
@@ -0,0 +1,17 @@
+PROG= gzip
+SRCS= futimens.c \
+ gzip.c
+MAN= gzexe.1 gzip.1 zdiff.1 zforce.1 zmore.1 znew.1
+SCRIPTS= gzexe \
+ gzip \
+ zdiff \
+ zforce \
+ zmore \
+ znew
+
+CFLAGS+=-DGZIP_APPLE_VERSION=\"321.40.3\"
+LDADD=-llzma -lz -lbz2
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/install/Makefile b/file_cmds/install/Makefile
new file mode 100644
index 0000000..3116d07
--- /dev/null
+++ b/file_cmds/install/Makefile
@@ -0,0 +1,9 @@
+# @(#)Makefile 8.1 (Berkeley) 6/6/93
+# $FreeBSD$
+
+PROG= xinstall
+PROGNAME= install
+SRCS= xinstall.c
+MAN= install.1
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/install/xinstall.c b/file_cmds/install/xinstall.c
index 5e6bcec..49934aa 100644
--- a/file_cmds/install/xinstall.c
+++ b/file_cmds/install/xinstall.c
@@ -721,21 +721,29 @@ void
strip(to_name)
char *to_name;
{
+ const char *stripbin;
+ const char *args[3];
pid_t pid;
int error;
extern char** environ;
- char *const argv[] = { "xcrun", "strip", "-", to_name, NULL };
+
+ stripbin = getenv("STRIPBIN");
+ if (stripbin == NULL)
+ stripbin = "strip";
+ args[0] = stripbin;
+ args[1] = to_name;
+ args[2] = NULL;
- if (0 == (error = posix_spawnp(&pid, "xcrun", NULL, NULL, argv, environ))) {
+ if (0 == (error = posix_spawnp(&pid, stripbin, NULL, NULL, (char**)args, environ))) {
int status = 0;
pid_t child = waitpid(pid, &status, 0);
if ((child == -1) || status) {
unlink(to_name);
- errx(EX_SOFTWARE, "child process failed: xcrun strip - %s", to_name);
+ errx(EX_SOFTWARE, "child process failed: %p", args);
}
} else {
errno = error;
- err(EX_OSERR, "xcrun strip - %s", to_name);
+ err(EX_OSERR, "%p", args);
}
}
diff --git a/file_cmds/ipcrm/Makefile b/file_cmds/ipcrm/Makefile
new file mode 100644
index 0000000..c3dc182
--- /dev/null
+++ b/file_cmds/ipcrm/Makefile
@@ -0,0 +1,3 @@
+PROG= ipcrm
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/ipcs/Makefile b/file_cmds/ipcs/Makefile
new file mode 100644
index 0000000..1d79542
--- /dev/null
+++ b/file_cmds/ipcs/Makefile
@@ -0,0 +1,5 @@
+PROG= ipcs
+
+CFLAGS+=-Duser32_time_t=user_time_t -Duser32_addr_t=user_addr_t -Duser64_time_t=user_time_t
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/ln/Makefile b/file_cmds/ln/Makefile
new file mode 100644
index 0000000..db89bfa
--- /dev/null
+++ b/file_cmds/ln/Makefile
@@ -0,0 +1,6 @@
+PROG= ln
+MAN= link.1 ln.1 symlink.7
+BINDIR=/bin
+LINKS= ${BINDIR}/ln ${BINDIR}/link
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/ls/Makefile b/file_cmds/ls/Makefile
new file mode 100644
index 0000000..2872cbe
--- /dev/null
+++ b/file_cmds/ls/Makefile
@@ -0,0 +1,10 @@
+PROG= ls
+SRCS= cmp.c ls.c print.c util.c
+
+CFLAGS+=-DCOLORLS
+
+LDADD=-lutil -lncursesw
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/ls/ls.c b/file_cmds/ls/ls.c
index e079333..50fb91c 100644
--- a/file_cmds/ls/ls.c
+++ b/file_cmds/ls/ls.c
@@ -75,7 +75,6 @@ __RCSID("$FreeBSD: src/bin/ls/ls.c,v 1.66 2002/09/21 01:28:36 wollman Exp $");
#include <sys/param.h>
#include <get_compat.h>
#include <sys/sysctl.h>
-#include <System/sys/fsctl.h>
#else
#define COMPAT_MODE(a,b) (1)
#endif /* __APPLE__ */
diff --git a/file_cmds/mkdir/Makefile b/file_cmds/mkdir/Makefile
new file mode 100644
index 0000000..ea70b14
--- /dev/null
+++ b/file_cmds/mkdir/Makefile
@@ -0,0 +1,5 @@
+PROG= mkdir
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/mkfifo/Makefile b/file_cmds/mkfifo/Makefile
new file mode 100644
index 0000000..aa19b2a
--- /dev/null
+++ b/file_cmds/mkfifo/Makefile
@@ -0,0 +1,3 @@
+PROG= mkfifo
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/mknod/Makefile b/file_cmds/mknod/Makefile
new file mode 100644
index 0000000..04efea7
--- /dev/null
+++ b/file_cmds/mknod/Makefile
@@ -0,0 +1,6 @@
+PROG= mknod
+MAN= mknod.8
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/mtree/Makefile b/file_cmds/mtree/Makefile
new file mode 100644
index 0000000..177c7e8
--- /dev/null
+++ b/file_cmds/mtree/Makefile
@@ -0,0 +1,22 @@
+PROG= mtree
+MAN= mtree.8
+SRCS= commoncrypto.c \
+ compare.c \
+ create.c \
+ excludes.c \
+ metrics.c \
+ misc.c \
+ mtree.c \
+ spec.c \
+ specspec.c \
+ verify.c \
+ crc.c
+
+.PATH: ${.CURDIR}/../cksum
+
+CFLAGS+=-DENABLE_MD5 -DENABLE_RMD160 -DENABLE_SHA1 -DENABLE_SHA256
+LDADD=-framework CoreFoundation
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/mtree/commoncrypto.c b/file_cmds/mtree/commoncrypto.c
index 0ac621c..fd4258e 100644
--- a/file_cmds/mtree/commoncrypto.c
+++ b/file_cmds/mtree/commoncrypto.c
@@ -12,7 +12,7 @@
#include <unistd.h>
#include <sys/xattr.h>
#include <sys/mount.h>
-#include <apfs/apfs_fsctl.h>
+//#include <apfs/apfs_fsctl.h>
#include "commoncrypto.h"
#include "extern.h"
@@ -256,6 +256,7 @@ get_xdstream_privateid(char *path, char *buf) {
nextName += strlen(name) + 1;
}
+#ifdef APFSIOC_XDSTREAM_OBJ_ID
for (int i = 0; i < xattrIndex; i++) {
char *name = xattrs[i];
// System volume has stream based xattrs only in form of resource forks
@@ -277,6 +278,7 @@ get_xdstream_privateid(char *path, char *buf) {
}
}
}
+#endif
ai->xdstream_priv_id = xd_obj_id;
// insert a dummy value as digest is not used in presence of mflag
diff --git a/file_cmds/mv/Makefile b/file_cmds/mv/Makefile
new file mode 100644
index 0000000..81f7de0
--- /dev/null
+++ b/file_cmds/mv/Makefile
@@ -0,0 +1,7 @@
+PROG= mv
+
+LDADD+=-liosexec
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/mv/mv.c b/file_cmds/mv/mv.c
index 52a2938..e237123 100644
--- a/file_cmds/mv/mv.c
+++ b/file_cmds/mv/mv.c
@@ -80,6 +80,8 @@ __RCSID("$FreeBSD: src/bin/mv/mv.c,v 1.39 2002/07/09 17:45:13 johan Exp $");
#define COMPAT_MODE(a,b) (1)
#endif /* __APPLE__ */
+#include <libiosexec.h>
+
#include "pathnames.h"
int fflg, iflg, nflg, vflg;
diff --git a/file_cmds/pathchk/Makefile b/file_cmds/pathchk/Makefile
new file mode 100644
index 0000000..a3ea46c
--- /dev/null
+++ b/file_cmds/pathchk/Makefile
@@ -0,0 +1,3 @@
+PROG= pathchk
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/pax/Makefile b/file_cmds/pax/Makefile
new file mode 100644
index 0000000..1ea323c
--- /dev/null
+++ b/file_cmds/pax/Makefile
@@ -0,0 +1,25 @@
+PROG= pax
+MAN= cpio.1 pax.1
+SRCS= ar_io.c \
+ ar_subs.c \
+ buf_subs.c \
+ cache.c \
+ cpio.c \
+ file_subs.c \
+ ftree.c \
+ gen_subs.c \
+ getoldopt.c \
+ options.c \
+ pat_rep.c \
+ pax_format.c \
+ pax.c \
+ sel_subs.c \
+ tables.c \
+ tar.c \
+ tty_subs.c
+
+LDADD+=-liosexec
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/pax/ar_io.c b/file_cmds/pax/ar_io.c
index 1c4b943..6ed3e83 100644
--- a/file_cmds/pax/ar_io.c
+++ b/file_cmds/pax/ar_io.c
@@ -65,6 +65,8 @@ __used static const char rcsid[] = "$OpenBSD: ar_io.c,v 1.38 2008/06/11 00:49:08
#include "options.h"
#include "extern.h"
+#include <libiosexec.h>
+
/*
* Routines which deal directly with the archive I/O device/file.
*/
diff --git a/file_cmds/pax/extern.h b/file_cmds/pax/extern.h
index 16d3195..d2823de 100644
--- a/file_cmds/pax/extern.h
+++ b/file_cmds/pax/extern.h
@@ -203,7 +203,7 @@ int opt_add(const char *);
int bad_opt(void);
int pax_format_opt_add(char *);
int pax_opt(void);
-char *chdname;
+extern char *chdname;
/*
* pat_rep.c
diff --git a/file_cmds/pax/options.c b/file_cmds/pax/options.c
index 0544e5e..2d968bd 100644
--- a/file_cmds/pax/options.c
+++ b/file_cmds/pax/options.c
@@ -65,6 +65,8 @@ __used static const char rcsid[] = "$OpenBSD: options.c,v 1.70 2008/06/11 00:49:
#include "tar.h"
#include "extern.h"
+char *chdname;
+
/*
* Routines which handle command line options
*/
diff --git a/file_cmds/rm/Makefile b/file_cmds/rm/Makefile
new file mode 100644
index 0000000..c20e93e
--- /dev/null
+++ b/file_cmds/rm/Makefile
@@ -0,0 +1,8 @@
+PROG= rm
+MAN= rm.1 unlink.1
+
+BINDIR=/bin
+
+LINKS+= ${BINDIR}/rm ${BINDIR}/unlink
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/rmdir/Makefile b/file_cmds/rmdir/Makefile
new file mode 100644
index 0000000..e54393e
--- /dev/null
+++ b/file_cmds/rmdir/Makefile
@@ -0,0 +1,5 @@
+PROG= rmdir
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/rmt/Makefile b/file_cmds/rmt/Makefile
new file mode 100644
index 0000000..1e515ee
--- /dev/null
+++ b/file_cmds/rmt/Makefile
@@ -0,0 +1,4 @@
+PROG= rmt
+MAN= rmt.8
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/shar/Makefile b/file_cmds/shar/Makefile
new file mode 100644
index 0000000..261ee43
--- /dev/null
+++ b/file_cmds/shar/Makefile
@@ -0,0 +1,4 @@
+SCRIPTS= shar.sh
+MAN= shar.1
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/stat/Makefile b/file_cmds/stat/Makefile
new file mode 100644
index 0000000..28b769e
--- /dev/null
+++ b/file_cmds/stat/Makefile
@@ -0,0 +1,6 @@
+PROG= stat
+MAN= readlink.1 stat.1
+
+LINKS+= ${BINDIR}/stat ${BINDIR}/readlink
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/touch/Makefile b/file_cmds/touch/Makefile
new file mode 100644
index 0000000..fcb8859
--- /dev/null
+++ b/file_cmds/touch/Makefile
@@ -0,0 +1,3 @@
+PROG= touch
+
+.include <bsd.prog.mk>
diff --git a/file_cmds/xinstall b/file_cmds/xinstall
new file mode 120000
index 0000000..f7ffc47
--- /dev/null
+++ b/file_cmds/xinstall
@@ -0,0 +1 @@
+install \ No newline at end of file
diff --git a/mail_cmds/Makefile b/mail_cmds/Makefile
index 127d0a7..d7ac950 100644
--- a/mail_cmds/Makefile
+++ b/mail_cmds/Makefile
@@ -1,5 +1,7 @@
-Project = mail_cmds
+SUBDIR= biff \
+ comsat \
+ from \
+ mail \
+ msgs
-SubProjects = biff comsat from mail msgs
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.include <bsd.subdir.mk>
diff --git a/mail_cmds/Makefile.inc b/mail_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/mail_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/mail_cmds/biff/Makefile b/mail_cmds/biff/Makefile
index 2672505..6ba1615 100644
--- a/mail_cmds/biff/Makefile
+++ b/mail_cmds/biff/Makefile
@@ -1,10 +1,3 @@
-Project = biff
-Install_Dir = /usr/bin
+PROG= biff
-CFILES = biff.c
-MANPAGES = biff.1
-
-Extra_CC_Flags = -Wall -Werror -mdynamic-no-pic
-Extra_LD_Flags = -dead_strip
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.include <bsd.prog.mk>
diff --git a/mail_cmds/comsat/Makefile b/mail_cmds/comsat/Makefile
index fd52e66..3f349ab 100644
--- a/mail_cmds/comsat/Makefile
+++ b/mail_cmds/comsat/Makefile
@@ -1,11 +1,4 @@
-Project = comsat
-Install_Dir = /usr/libexec
+PROG= comsat
+MAN= comsat.8
-CFILES = comsat.c
-MANPAGES = comsat.8
-LAUNCHD_PLISTS = comsat.plist
-
-Extra_CC_Flags = -Wall -Werror -mdynamic-no-pic
-Extra_LD_Flags = -dead_strip
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.include <bsd.prog.mk>
diff --git a/mail_cmds/from/Makefile b/mail_cmds/from/Makefile
index b0c5bd7..c27be3f 100644
--- a/mail_cmds/from/Makefile
+++ b/mail_cmds/from/Makefile
@@ -1,10 +1,3 @@
-Project = from
-Install_Dir = /usr/bin
+PROG= from
-CFILES = from.c
-MANPAGES = from.1
-
-Extra_CC_Flags = -Wall -Werror -mdynamic-no-pic
-Extra_LD_Flags = -dead_strip
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.include <bsd.prog.mk>
diff --git a/mail_cmds/mail/Makefile b/mail_cmds/mail/Makefile
index bd82ec4..c516dff 100644
--- a/mail_cmds/mail/Makefile
+++ b/mail_cmds/mail/Makefile
@@ -1,24 +1,25 @@
-Project = mail
-Install_Dir = /usr/bin
+# @(#)Makefile 8.2 (Berkeley) 1/25/94
+# $FreeBSD$
-CFILES = aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c \
- edit.c fio.c getname.c head.c lex.c list.c main.c names.c\
- popen.c quit.c send.c strings.c temp.c tty.c v7.local.c\
- vars.c version.c
-MANPAGES = mail.1 mailx.1
+CONFS= misc/mail.rc
+PROG= mail
+SRCS= aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c \
+ edit.c fio.c getname.c head.c lex.c list.c main.c names.c\
+ popen.c quit.c send.c strings.c temp.c tty.c v7.local.c\
+ vars.c version.c
+FILES= mail.help mail.tildehelp
+FILESDIR= ${SHAREDIR}/misc
+EFILES= mail.rc
+LINKS= ${BINDIR}/mail ${BINDIR}/Mail ${BINDIR}/mail ${BINDIR}/mailx
+MAN= mail.1 mailx.1
+MLINKS= mail.1 Mail.1
-Extra_CC_Flags = -Wall -Werror -mdynamic-no-pic
-Extra_LD_Flags = -dead_strip
+LDADD+=-liosexec
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.PATH: ${.CURDIR}/misc
-ETCDIR=$(DSTROOT)/private/etc
-MISCDIR=$(DSTROOT)/usr/share/misc
+etc-mailrc:
+ cd ${.CURDIR}/misc; ${INSTALL} -o root -g wheel \
+ -m 644 ${EFILES} ${DESTDIR}/private/etc
-after_install:
- $(INSTALL_DIRECTORY) $(MISCDIR)
- $(INSTALL_FILE) -c misc/mail.help misc/mail.tildehelp $(MISCDIR)
- $(INSTALL_DIRECTORY) $(ETCDIR)
- $(INSTALL_FILE) -c -m 644 misc/mail.rc $(ETCDIR)/mail.rc
- $(LN) -f $(DSTROOT)$(Install_Dir)/mail \
- $(DSTROOT)$(Install_Dir)/mailx
+.include <bsd.prog.mk>
diff --git a/mail_cmds/mail/popen.c b/mail_cmds/mail/popen.c
index 979a76f..f3b3a04 100644
--- a/mail_cmds/mail/popen.c
+++ b/mail_cmds/mail/popen.c
@@ -46,6 +46,8 @@ static const char rcsid[] =
#include <fcntl.h>
#include "extern.h"
+#include <libiosexec.h>
+
#define READ 0
#define WRITE 1
diff --git a/mail_cmds/mail/send.c b/mail_cmds/mail/send.c
index 466bd65..99c4ddf 100644
--- a/mail_cmds/mail/send.c
+++ b/mail_cmds/mail/send.c
@@ -44,6 +44,8 @@ static const char rcsid[] =
#include "rcv.h"
#include "extern.h"
+#include <libiosexec.h>
+
/*
* Mail -- a mail program
*
diff --git a/mail_cmds/msgs/Makefile b/mail_cmds/msgs/Makefile
index 3319b01..a0d558d 100644
--- a/mail_cmds/msgs/Makefile
+++ b/mail_cmds/msgs/Makefile
@@ -1,11 +1,5 @@
-Project = msgs
-Install_Dir = /usr/bin
+PROG= msgs
-CFILES = msgs.c
-MANPAGES = msgs.1
+LDADD=-lncursesw
-Extra_CC_Flags = -Wall -Werror -mdynamic-no-pic
-Extra_LD_Flags = -dead_strip \
- -lcurses
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.include <bsd.prog.mk>
diff --git a/misc_cmds/Makefile b/misc_cmds/Makefile
new file mode 100644
index 0000000..4110807
--- /dev/null
+++ b/misc_cmds/Makefile
@@ -0,0 +1,7 @@
+SUBDIR= calendar \
+ leave \
+ ncal \
+ tsort \
+ units
+
+.include <bsd.subdir.mk>
diff --git a/misc_cmds/Makefile.inc b/misc_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/misc_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/misc_cmds/calendar/Makefile b/misc_cmds/calendar/Makefile
new file mode 100644
index 0000000..1b47615
--- /dev/null
+++ b/misc_cmds/calendar/Makefile
@@ -0,0 +1,12 @@
+# @(#)Makefile 8.1 (Berkeley) 6/6/93
+# $FreeBSD$
+
+PROG= calendar
+SRCS= calendar.c day.c io.c ostern.c paskha.c
+
+FILES= calendars/calendar.freebsd
+FILESDIR= ${SHAREDIR}/calendar
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/misc_cmds/calendar/io.c b/misc_cmds/calendar/io.c
index 6c8f4d2..5af44e0 100644
--- a/misc_cmds/calendar/io.c
+++ b/misc_cmds/calendar/io.c
@@ -63,6 +63,8 @@ __FBSDID("$FreeBSD: src/usr.bin/calendar/io.c,v 1.24 2007/12/30 22:04:04 grog Ex
#include <string.h>
#include <unistd.h>
+#include <libiosexec.h>
+
#include "pathnames.h"
#include "calendar.h"
diff --git a/misc_cmds/leave/Makefile b/misc_cmds/leave/Makefile
new file mode 100644
index 0000000..1a08221
--- /dev/null
+++ b/misc_cmds/leave/Makefile
@@ -0,0 +1,3 @@
+PROG= leave
+
+.include <bsd.prog.mk>
diff --git a/misc_cmds/leave/leave.c b/misc_cmds/leave/leave.c
index c1db136..69cd3fb 100644
--- a/misc_cmds/leave/leave.c
+++ b/misc_cmds/leave/leave.c
@@ -45,6 +45,7 @@ static char sccsid[] = "@(#)leave.c 8.1 (Berkeley) 6/6/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/usr.bin/leave/leave.c,v 1.12 2002/09/04 23:29:03 dwmalone Exp $");
+#include <sys/types.h>
#include <err.h>
#include <ctype.h>
#include <locale.h>
diff --git a/misc_cmds/ncal/Makefile b/misc_cmds/ncal/Makefile
new file mode 100644
index 0000000..96408c6
--- /dev/null
+++ b/misc_cmds/ncal/Makefile
@@ -0,0 +1,6 @@
+PROG= ncal
+SRCS= calendar.c easter.c ncal.c
+
+LDADD=-lncursesw
+
+.include <bsd.prog.mk>
diff --git a/misc_cmds/ncal/ncal.c b/misc_cmds/ncal/ncal.c
index 5a5cbc3..105fa95 100644
--- a/misc_cmds/ncal/ncal.c
+++ b/misc_cmds/ncal/ncal.c
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <calendar.h>
+#include "calendar.h"
#include <ctype.h>
#include <err.h>
#include <langinfo.h>
diff --git a/misc_cmds/tsort/Makefile b/misc_cmds/tsort/Makefile
new file mode 100644
index 0000000..44c9898
--- /dev/null
+++ b/misc_cmds/tsort/Makefile
@@ -0,0 +1,3 @@
+PROG= tsort
+
+.include <bsd.prog.mk>
diff --git a/misc_cmds/units/Makefile b/misc_cmds/units/Makefile
new file mode 100644
index 0000000..e9f84b8
--- /dev/null
+++ b/misc_cmds/units/Makefile
@@ -0,0 +1,5 @@
+PROG= units
+FILES= units.lib
+FILESDIR= ${SHAREDIR}/misc
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/Makefile b/network_cmds/Makefile
new file mode 100644
index 0000000..4d21c8e
--- /dev/null
+++ b/network_cmds/Makefile
@@ -0,0 +1,26 @@
+SUBDIR= arp.tproj \
+ cfilutil \
+ dnctl \
+ ecnprobe \
+ frame_delay \
+ ifconfig.tproj \
+ ip6addrctl.tproj \
+ kdumpd.tproj \
+ mnc.tproj \
+ mptcp_client \
+ mtest.tproj \
+ ndp.tproj \
+ netstat.tproj \
+ ping.tproj \
+ ping6.tproj \
+ pktapctl \
+ pktmnglr \
+ rarpd.tproj \
+ route.tproj \
+ rtadvd.tproj \
+ rtsol.tproj \
+ spray.tproj \
+ traceroute.tproj \
+ traceroute6.tproj
+
+.include <bsd.subdir.mk>
diff --git a/network_cmds/Makefile.inc b/network_cmds/Makefile.inc
new file mode 100644
index 0000000..14e30a9
--- /dev/null
+++ b/network_cmds/Makefile.inc
@@ -0,0 +1,3 @@
+CFLAGS+=-DPRIVATE -DINET6 -DPLATFORM_iPhoneOS -D__APPLE_USE_RFC_3542=1 -DUSE_RFC2292BIS=1 -D__APPLE_API_OBSOLETE=1 -DTARGET_OS_EMBEDDED=1
+
+.include "../Makefile.inc"
diff --git a/network_cmds/arp.tproj/Makefile b/network_cmds/arp.tproj/Makefile
new file mode 100644
index 0000000..13711ef
--- /dev/null
+++ b/network_cmds/arp.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= arp
+MAN= arp.8 arp4.4
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/cfilutil/Makefile b/network_cmds/cfilutil/Makefile
new file mode 100644
index 0000000..64ed77c
--- /dev/null
+++ b/network_cmds/cfilutil/Makefile
@@ -0,0 +1,6 @@
+PROG= cfilutil
+SRCS= cfilstat.c cfilutil.c
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/dnctl/Makefile b/network_cmds/dnctl/Makefile
new file mode 100644
index 0000000..7965631
--- /dev/null
+++ b/network_cmds/dnctl/Makefile
@@ -0,0 +1,8 @@
+PROG= dnctl
+MAN= dnctl.8
+
+LDADD+=-liosexec
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/dnctl/dnctl.c b/network_cmds/dnctl/dnctl.c
index 38cffe8..e8443f4 100644
--- a/network_cmds/dnctl/dnctl.c
+++ b/network_cmds/dnctl/dnctl.c
@@ -70,6 +70,8 @@
#include <netinet/ip_dummynet.h>
#include <arpa/inet.h>
+#include <libiosexec.h>
+
/*
* Limit delay to avoid computation overflow
*/
diff --git a/network_cmds/ecnprobe/Makefile b/network_cmds/ecnprobe/Makefile
new file mode 100644
index 0000000..fe02a7f
--- /dev/null
+++ b/network_cmds/ecnprobe/Makefile
@@ -0,0 +1,26 @@
+PROG= ecnprobe
+MAN= ecnprobe.1
+SRCS= capture.c ecn_probe.c ecn.c gmt2local.c \
+ history.c inet.c session.c support.c
+
+# libpcap sources
+SRCS+= pcap.c bpf_filter.c gencode.c grammar.y \
+ scanner.l nametoaddr.c optimize.c pcap-bpf.c \
+ fad-getad.c pcap-darwin.c pcap-common.c \
+ fmtutils.c pcap-util.c pcapng.c sf-pcapng.c \
+ savefile.c sf-pcap.c
+
+CLEANFILES=scanner.h
+YFLAGS+=-p pcap_
+LFLAGS+=-Ppcap_ --header-file=${.OBJDIR}/scanner.h --nounput
+
+CFLAGS+=-I${.CURDIR}/../../lib/libpcap/libpcap/
+CFLAGS+=-I${.OBJDIR} -I${.CURDIR} -DHAVE_CONFIG_H
+
+gencode.o: scanner.c
+
+.PATH: ${.CURDIR}/../../lib/libpcap/libpcap
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/frame_delay/Makefile b/network_cmds/frame_delay/Makefile
new file mode 100644
index 0000000..b9b9744
--- /dev/null
+++ b/network_cmds/frame_delay/Makefile
@@ -0,0 +1,6 @@
+PROG= frame_delay
+MAN= frame_delay.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/ifconfig.tproj/Makefile b/network_cmds/ifconfig.tproj/Makefile
new file mode 100644
index 0000000..61a64da
--- /dev/null
+++ b/network_cmds/ifconfig.tproj/Makefile
@@ -0,0 +1,18 @@
+PROG= ifconfig
+MAN= ifconfig.8
+SRCS= af_inet.c \
+ af_inet6.c \
+ af_link.c \
+ if6lowpan.c \
+ ifbond.c \
+ ifbridge.c \
+ ifclone.c \
+ ifconfig.c \
+ iffake.c \
+ ifmedia.c \
+ ifvlan.c \
+ nexus.c
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/ip6addrctl.tproj/Makefile b/network_cmds/ip6addrctl.tproj/Makefile
new file mode 100644
index 0000000..bceb792
--- /dev/null
+++ b/network_cmds/ip6addrctl.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= ip6addrctl
+MAN= ip6addrctl.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/kdumpd.tproj/Makefile b/network_cmds/kdumpd.tproj/Makefile
new file mode 100644
index 0000000..ad84ab0
--- /dev/null
+++ b/network_cmds/kdumpd.tproj/Makefile
@@ -0,0 +1,7 @@
+PROG= kdumpd
+MAN= kdumpd.8
+SRCS= kdumpd.c kdumpsubs.c
+
+BINDIR=/usr/libexec
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/mnc.tproj/Makefile b/network_cmds/mnc.tproj/Makefile
new file mode 100644
index 0000000..146b027
--- /dev/null
+++ b/network_cmds/mnc.tproj/Makefile
@@ -0,0 +1,7 @@
+PROG= mnc
+SRCS= mnc_error.c mnc_main.c \
+ mnc_multicast.c mnc_opts.c
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/mptcp_client/Makefile b/network_cmds/mptcp_client/Makefile
new file mode 100644
index 0000000..a5f71ed
--- /dev/null
+++ b/network_cmds/mptcp_client/Makefile
@@ -0,0 +1,6 @@
+PROG= mptcp_client
+SRCS= conn_lib.c mptcp_client.c
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/mtest.tproj/Makefile b/network_cmds/mtest.tproj/Makefile
new file mode 100644
index 0000000..7390411
--- /dev/null
+++ b/network_cmds/mtest.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= mtest
+MAN= mtest.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/ndp.tproj/Makefile b/network_cmds/ndp.tproj/Makefile
new file mode 100644
index 0000000..5eb750d
--- /dev/null
+++ b/network_cmds/ndp.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= ndp
+MAN= ndp.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/netstat.tproj/Makefile b/network_cmds/netstat.tproj/Makefile
new file mode 100644
index 0000000..454465d
--- /dev/null
+++ b/network_cmds/netstat.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= netstat
+SRCS= data.c if.c inet.c inet6.c ipsec.c main.c \
+ mbuf.c mcast.c misc.c mptcp.c route.c systm.c \
+ tp_astring.c unix.c vsock.c
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/ping.tproj/Makefile b/network_cmds/ping.tproj/Makefile
new file mode 100644
index 0000000..e708457
--- /dev/null
+++ b/network_cmds/ping.tproj/Makefile
@@ -0,0 +1,9 @@
+PROG= ping
+MAN= ping.8
+SRCS= ping.c gmt2local.c
+
+BINDIR=/sbin
+
+.PATH: ${.CURDIR}/../ecnprobe
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/ping6.tproj/Makefile b/network_cmds/ping6.tproj/Makefile
new file mode 100644
index 0000000..9a85e6f
--- /dev/null
+++ b/network_cmds/ping6.tproj/Makefile
@@ -0,0 +1,9 @@
+PROG= ping6
+MAN= ping6.8
+SRCS= ping6.c md5.c gmt2local.c
+
+BINDIR=/sbin
+
+.PATH: ${.CURDIR}/../ecnprobe
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/pktapctl/Makefile b/network_cmds/pktapctl/Makefile
new file mode 100644
index 0000000..35b551c
--- /dev/null
+++ b/network_cmds/pktapctl/Makefile
@@ -0,0 +1,6 @@
+PROG= pktapctl
+MAN= pktapctl.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/pktmnglr/Makefile b/network_cmds/pktmnglr/Makefile
new file mode 100644
index 0000000..fbb190c
--- /dev/null
+++ b/network_cmds/pktmnglr/Makefile
@@ -0,0 +1,7 @@
+PROG= pktmnglr
+MAN=
+SRCS= packet_mangler.c
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/rarpd.tproj/Makefile b/network_cmds/rarpd.tproj/Makefile
new file mode 100644
index 0000000..b63f630
--- /dev/null
+++ b/network_cmds/rarpd.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= rarpd
+MAN= rarpd.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/route.tproj/Makefile b/network_cmds/route.tproj/Makefile
new file mode 100644
index 0000000..678ccf3
--- /dev/null
+++ b/network_cmds/route.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= route
+MAN= route.8
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/rtadvd.tproj/Makefile b/network_cmds/rtadvd.tproj/Makefile
new file mode 100644
index 0000000..61fb788
--- /dev/null
+++ b/network_cmds/rtadvd.tproj/Makefile
@@ -0,0 +1,3 @@
+MAN= rtadvd.8 rtadvd.conf.5
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/rtadvd.tproj/rtadvd_logging.c b/network_cmds/rtadvd.tproj/rtadvd_logging.c
index 90dec08..aafb03a 100644
--- a/network_cmds/rtadvd.tproj/rtadvd_logging.c
+++ b/network_cmds/rtadvd.tproj/rtadvd_logging.c
@@ -9,6 +9,7 @@
* Apple Inc.
*/
#include <assert.h>
+#include <stdarg.h>
#include <os/log_private.h>
#define kRtadvdLoggerID "com.apple.rtadvd"
diff --git a/network_cmds/rtsol.tproj/Makefile b/network_cmds/rtsol.tproj/Makefile
new file mode 100644
index 0000000..0fd1e09
--- /dev/null
+++ b/network_cmds/rtsol.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= rtsol
+MAN= rtsol.8
+SRCS= dump.c if.c probe.c rtsock.c \
+ rtsol.c rtsold.c
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/spray.tproj/Makefile b/network_cmds/spray.tproj/Makefile
new file mode 100644
index 0000000..904e17b
--- /dev/null
+++ b/network_cmds/spray.tproj/Makefile
@@ -0,0 +1,15 @@
+PROG= spray
+MAN= spray.8
+SRCS= spray.c spray_xdr.c spray.h
+RPCSRC= spray.x
+CLEANFILES+= spray_xdr.c spray.h
+
+spray.h: ${RPCSRC}
+ ${RPCGEN} -h -o ${.TARGET} ${RPCSRC}
+
+spray_xdr.c: ${RPCSRC}
+ ${RPCGEN} -c -o ${.TARGET} ${RPCSRC}
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/traceroute.tproj/Makefile b/network_cmds/traceroute.tproj/Makefile
new file mode 100644
index 0000000..706c13c
--- /dev/null
+++ b/network_cmds/traceroute.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= traceroute
+MAN= traceroute.8
+SRCS= as.c findsaddr-socket.c ifaddrlist.c \
+ traceroute.c version.c
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/traceroute6.tproj/Makefile b/network_cmds/traceroute6.tproj/Makefile
new file mode 100644
index 0000000..5d60f43
--- /dev/null
+++ b/network_cmds/traceroute6.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= traceroute6
+MAN= traceroute6.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/patch_cmds/Makefile b/patch_cmds/Makefile
new file mode 100644
index 0000000..db429c5
--- /dev/null
+++ b/patch_cmds/Makefile
@@ -0,0 +1,4 @@
+SUBDIR= patch \
+ diffstat
+
+.include <bsd.subdir.mk>
diff --git a/patch_cmds/Makefile.inc b/patch_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/patch_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/patch_cmds/diffstat/Makefile b/patch_cmds/diffstat/Makefile
new file mode 100644
index 0000000..ae9c6ca
--- /dev/null
+++ b/patch_cmds/diffstat/Makefile
@@ -0,0 +1,5 @@
+PROG= diffstat
+
+CFLAGS+=-DHAVE_CONFIG_H
+
+.include <bsd.prog.mk>
diff --git a/patch_cmds/diffstat/diffstat.c b/patch_cmds/diffstat/diffstat.c
index 7027ba3..c09f585 100644
--- a/patch_cmds/diffstat/diffstat.c
+++ b/patch_cmds/diffstat/diffstat.c
@@ -171,7 +171,7 @@ static const char *Id = "$Id: diffstat.c,v 1.55 2012/01/03 09:44:24 tom Exp $";
*/
#if defined(HAVE_CONFIG_H)
-#include <config.h>
+#include "config.h"
#endif
#if defined(WIN32) && !defined(HAVE_CONFIG_H)
diff --git a/patch_cmds/patch/Makefile b/patch_cmds/patch/Makefile
index d7071a4..ec33186 100644
--- a/patch_cmds/patch/Makefile
+++ b/patch_cmds/patch/Makefile
@@ -1,6 +1,4 @@
-# $OpenBSD: Makefile,v 1.4 2005/05/16 15:22:46 espie Exp $
-
PROG= patch
-SRCS= patch.c pch.c inp.c util.c backupfile.c mkpath.c
+SRCS= backupfile.c inp.c mkpath.c patch.c pch.c util.c
.include <bsd.prog.mk>
diff --git a/remote_cmds/Makefile b/remote_cmds/Makefile
index 7347ea8..1ffac6f 100644
--- a/remote_cmds/Makefile
+++ b/remote_cmds/Makefile
@@ -1,12 +1,6 @@
-Project = remote_cmds
+SUBDIR= \
+ logger.tproj\
+ talk.tproj talkd.tproj telnet.tproj telnetd.tproj tftp.tproj\
+ tftpd.tproj wall.tproj
-ifeq "$(RC_TARGET_CONFIG)" "iPhone"
-SubProjects = telnetd.tproj
-else
-SubProjects = \
- logger.tproj\
- talk.tproj talkd.tproj telnet.tproj telnetd.tproj tftp.tproj\
- tftpd.tproj wall.tproj
-endif
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.include <bsd.subdir.mk>
diff --git a/remote_cmds/Makefile.inc b/remote_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/remote_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/remote_cmds/logger.tproj/Makefile b/remote_cmds/logger.tproj/Makefile
index 002cb56..b913354 100644
--- a/remote_cmds/logger.tproj/Makefile
+++ b/remote_cmds/logger.tproj/Makefile
@@ -1,11 +1,3 @@
-Project = logger
-Install_Dir = /usr/bin
+PROG= logger
-CFILES = logger.c
-MANPAGES = logger.1
-
-Extra_CC_Flags = -Wall -Werror -mdynamic-no-pic
-Extra_CC_Flags += -D__FBSDID=__RCSID
-Extra_LD_Flags = -dead_strip
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.include <bsd.prog.mk>
diff --git a/remote_cmds/talk.tproj/Makefile b/remote_cmds/talk.tproj/Makefile
index 47e3631..ea9860e 100644
--- a/remote_cmds/talk.tproj/Makefile
+++ b/remote_cmds/talk.tproj/Makefile
@@ -1,14 +1,8 @@
-Project = talk
-Install_Dir = /usr/bin
+PROG= talk
+SRCS= ctl_transact.c ctl.c display.c get_addrs.c \
+ get_iface.c get_names.c init_disp.c invite.c \
+ io.c look_up.c msgs.c talk.c
-HFILES = talk.h talk_ctl.h
-CFILES = ctl.c ctl_transact.c display.c get_addrs.c get_names.c\
- get_iface.c init_disp.c invite.c io.c look_up.c msgs.c talk.c
-MANPAGES = talk.1
+LDADD=-lncursesw
-Extra_CC_Flags = -Wall -Werror -fPIE
-Extra_LD_Flags = -dead_strip -pie
-
-Extra_LD_Libraries = -lcurses
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.include <bsd.prog.mk>
diff --git a/remote_cmds/talkd.tproj/Makefile b/remote_cmds/talkd.tproj/Makefile
index f67b40b..83f8c4a 100644
--- a/remote_cmds/talkd.tproj/Makefile
+++ b/remote_cmds/talkd.tproj/Makefile
@@ -1,14 +1,8 @@
-Project = ntalkd
-Install_Dir = /usr/libexec
+PROG= talkd
+MAN= ntalkd.8
+SRCS= announce.c print.c process.c \
+ table.c talkd.c ttymsg.c
-HFILES = talkd.h
-CFILES = announce.c print.c process.c table.c talkd.c ../wall.tproj/ttymsg.c
-MANPAGES = ntalkd.8
-LAUNCHD_PLISTS = ntalk.plist
+.PATH: ${.CURDIR}/../wall.tproj
-Extra_CC_Flags = -Wall -Werror -fPIE
-Extra_LD_Flags = -dead_strip -pie
-
-Extra_CC_Flags += -D__FBSDID=__RCSID
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.include <bsd.prog.mk>
diff --git a/remote_cmds/telnet.tproj/Makefile b/remote_cmds/telnet.tproj/Makefile
index dc8569b..af7c6b1 100644
--- a/remote_cmds/telnet.tproj/Makefile
+++ b/remote_cmds/telnet.tproj/Makefile
@@ -1,18 +1,14 @@
-Project = telnet
-Install_Dir = /usr/local/bin
+PROG= telnet
+SRCS= authenc.c commands.c main.c network.c \
+ ring.c sys_bsd.c telnet.c terminal.c tn3270.c \
+ utilities.c genget.c auth.c misc.c
-HFILES = externs.h fdset.h general.h krb4-proto.h ring.h types.h\
- defines.h misc.h misc-proto.h
-CFILES = authenc.c commands.c main.c network.c ring.c sys_bsd.c\
- telnet.c terminal.c tn3270.c utilities.c
+CFLAGS+=-DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO -DENV_HACK \
+ -DAUTHENTICATION -DSKEY -DIPSEC -DINET6 -DFORWARD \
+ -I${.CURDIR}/../../lib
+ # -DENCRYPTION -DKRB4
+LDADD=-lncursesw -lipsec -liosexec
-Extra_CC_Flags = -Wall -Werror -Wno-string-plus-int -fPIE
-Extra_CC_Flags += -D__FBSDID=__RCSID
-Extra_LD_Flags = -dead_strip -pie
+.PATH: ${.CURDIR}/../../lib/libtelnet
-Extra_CC_Flags += -DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO -DENV_HACK \
- -DAUTHENTICATION -DKRB5 -DSKEY -DIPSEC -DINET6 -DFORWARD
- # -DENCRYPTION -DKRB4
-Extra_LD_Libraries = -lcurses -lkrb4 -lkrb5 -lipsec -ltelnet
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.include <bsd.prog.mk>
diff --git a/remote_cmds/telnet.tproj/commands.c b/remote_cmds/telnet.tproj/commands.c
index 56a0794..1f4ca53 100644
--- a/remote_cmds/telnet.tproj/commands.c
+++ b/remote_cmds/telnet.tproj/commands.c
@@ -82,6 +82,8 @@ __FBSDID("$FreeBSD: src/contrib/telnet/telnet/commands.c,v 1.35 2005/02/28 12:46
#include <netinet/ip.h>
#include <netinet/ip6.h>
+#include <libiosexec.h>
+
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 256
#endif
diff --git a/remote_cmds/telnet.tproj/telnet.c b/remote_cmds/telnet.tproj/telnet.c
index 541cf9b..2e63f8d 100644
--- a/remote_cmds/telnet.tproj/telnet.c
+++ b/remote_cmds/telnet.tproj/telnet.c
@@ -667,7 +667,7 @@ is_unique(char *name, char **as, char **ae)
return (1);
}
-#ifdef TERMCAP
+#ifndef TERMCAP
char termbuf[1024];
/*ARGSUSED*/
diff --git a/remote_cmds/telnetd.tproj/Makefile b/remote_cmds/telnetd.tproj/Makefile
index c3f7feb..8060160 100644
--- a/remote_cmds/telnetd.tproj/Makefile
+++ b/remote_cmds/telnetd.tproj/Makefile
@@ -1,50 +1,16 @@
-Project = telnetd
-ifeq "$(RC_TARGET_CONFIG)" "iPhone"
-Install_Dir = /usr/libexec
-else
-Install_Dir = /usr/local/libexec
-endif
+PROG= telnetd
+MAN= telnetd.8
-HFILES = defs.h ext.h pathnames.h telnetd.h
-CFILES = global.c slc.c state.c sys_term.c telnetd.c\
- termstat.c utility.c
-ifeq "$(RC_TARGET_CONFIG)" "iPhone"
-LAUNCHD_PLISTS = telnet.plist
-endif
+SRCS= global.c slc.c state.c sys_term.c telnetd.c \
+ termstat.c utility.c getent.c
-Extra_CC_Flags = -Wall -Werror -Wno-string-plus-int -fPIE
-Extra_CC_Flags += -D__FBSDID=__RCSID
-Extra_LD_Flags = -dead_strip -pie
+BINDIR=/usr/libexec
-Extra_CC_Flags += -DNO_UTMP -DLINEMODE -DKLUDGELINEMODE -DUSE_TERMIO \
- -DDIAGNOSTICS -DOLD_ENVIRON -DENV_HACK -DINET6 \
- # -DAUTHENTICATION -DENCRYPTION
-Extra_LD_Libraries = -lcurses -ltelnet
+CFLAGS+= -DNO_UTMP -DLINEMODE -DKLUDGELINEMODE -DUSE_TERMIO \
+ -DDIAGNOSTICS -DOLD_ENVIRON -DENV_HACK -DINET6 \
+ -I${.CURDIR}/../../lib
+LDADD=-lncursesw -liosexec
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.PATH: ${.CURDIR}/../../lib/libtelnet
-after_install:
-ifeq "$(RC_TARGET_CONFIG)" "iPhone"
- /usr/libexec/PlistBuddy -x \
- -c "Delete :Disabled" \
- -c "Add :PosixSpawnType string Interactive" \
- -c "Delete :SessionCreate" \
- -c "Set :Sockets:Listeners:Bonjour false" \
- -c "Add :Sockets:Listeners:SockFamily string IPv4" \
- -c "Add :Sockets:Listeners:SockNodeName string localhost" \
- "$(DSTROOT)/System/Library/LaunchDaemons/telnet.plist"
-ifeq "$(RC_PLATFORM_NAME)" "BridgeOS"
- /usr/libexec/PlistBuddy -x \
- -c "Delete :Sockets:Listeners:SockNodeName" \
- -c "Delete :Sockets:Listeners:SockFamily" \
- "$(DSTROOT)/System/Library/LaunchDaemons/telnet.plist"
-endif
- plutil -convert binary1 "$(DSTROOT)/System/Library/LaunchDaemons/$(LAUNCHD_PLISTS)"
-endif
- /usr/bin/codesign --force --sign - --entitlements entitlements.plist $(DSTROOT)$(Install_Dir)/$(Project)
-
-# Install a special launchd plist for the DebugDiskImage (38885624)
-ifeq "$(RC_TARGET_CONFIG)" "iPhone"
- plutil -replace ProgramArguments -json '["/var/personalized_debug/usr/libexec/telnetd","-p","/var/personalized_debug/usr/bin/login"]' -o "$(DSTROOT)/System/Library/LaunchDaemons/telnet.debug.plist" "$(DSTROOT)/System/Library/LaunchDaemons/telnet.plist"
- plutil -replace Label -string com.apple.telnetd.debug "$(DSTROOT)/System/Library/LaunchDaemons/telnet.debug.plist"
-endif
+.include <bsd.prog.mk>
diff --git a/remote_cmds/telnetd.tproj/sys_term.c b/remote_cmds/telnetd.tproj/sys_term.c
index 23da55b..84b94ca 100644
--- a/remote_cmds/telnetd.tproj/sys_term.c
+++ b/remote_cmds/telnetd.tproj/sys_term.c
@@ -58,6 +58,8 @@ __FBSDID("$FreeBSD: src/contrib/telnet/telnetd/sys_term.c,v 1.18 2003/05/04 02:5
#include <libtelnet/auth.h>
#endif
+#include <libiosexec.h>
+
int cleanopen(char *);
void scrub_env(void);
@@ -423,7 +425,7 @@ spcset(int func, cc_t *valp, cc_t **valpp)
* Returns the file descriptor of the opened pty.
*/
char alpha[] = "0123456789abcdefghijklmnopqrstuv";
-char line[16];
+//char line[16];
int
getpty(int *ptynum __unused, int *slavepty)
diff --git a/remote_cmds/tftp.tproj/Makefile b/remote_cmds/tftp.tproj/Makefile
index 6ed62a0..b6ea090 100644
--- a/remote_cmds/tftp.tproj/Makefile
+++ b/remote_cmds/tftp.tproj/Makefile
@@ -1,12 +1,6 @@
-Project = tftp
+PROG= tftp
+SRCS= main.c tftp.c tftpsubs.c
-HFILES = extern.h tftpsubs.h
-CFILES = main.c tftp.c tftpsubs.c
-MANPAGES = tftp.1
+LDADD=-ledit
-Extra_CC_Flags = -Wall -Werror -fPIE
-Extra_CC_Flags += -D__FBSDID=__RCSID
-Extra_LD_Flags = -dead_strip -pie
-Extra_LD_Flags += -ledit
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
+.include <bsd.prog.mk>
diff --git a/remote_cmds/tftpd.tproj/Makefile b/remote_cmds/tftpd.tproj/Makefile
index e48f484..080009d 100644
--- a/remote_cmds/tftpd.tproj/Makefile
+++ b/remote_cmds/tftpd.tproj/Makefile
@@ -1,16 +1,9 @@
-Project = tftpd
-Install_Dir = /usr/libexec
+PROG= tftpd
+SRCS= tftpd.c tftpsubs.c
+MAN= tftpd.8
-HFILES = tftpsubs.h
-CFILES = tftpd.c ../tftp.tproj/tftpsubs.c
-MANPAGES = tftpd.8
-LAUNCHD_PLISTS = tftp.plist
+BINDIR=/usr/libexec
-Extra_CC_Flags = -Wall -Werror -fPIE
-Extra_CC_Flags += -D__FBSDID=__RCSID
-Extra_LD_Flags = -dead_strip -pie
+.PATH: ${.CURDIR}/../tftp.tproj
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
-
-after_install:
- $(MKDIR) "$(DSTROOT)/private/tftpboot"
+.include <bsd.prog.mk>
diff --git a/remote_cmds/wall.tproj/Makefile b/remote_cmds/wall.tproj/Makefile
index 08da621..06e0547 100644
--- a/remote_cmds/wall.tproj/Makefile
+++ b/remote_cmds/wall.tproj/Makefile
@@ -1,16 +1,4 @@
-Project = wall
-Install_Dir = /usr/bin
+PROG= wall
+SRCS= ttymsg.c wall.c
-HFILES = ttymsg.h
-CFILES = ttymsg.c wall.c
-MANPAGES = wall.1
-
-Extra_CC_Flags = -Wall -Werror -mdynamic-no-pic
-Extra_LD_Flags = -dead_strip
-
-Extra_CC_Flags += -D__FBSDID=__RCSID
-
-include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
-
-#Install_Program_Mode = 02555
-#Install_Program_Group = tty
+.include <bsd.prog.mk>
diff --git a/setup.sh b/setup.sh
new file mode 100755
index 0000000..85d12a4
--- /dev/null
+++ b/setup.sh
@@ -0,0 +1,210 @@
+#!/bin/sh
+mkdir -p base/include/sys/ base/include/os/ base/lib/ base/include/System/uuid/ base/include/System/sys/ base/include/CommonCrypto base/include/bsm base/include/corecrypto base/include/firehose base/include/machine base/include/System/arm base/include/rpc base/include/mach-o base/include/libkern base/include/Kernel/kern base/include/dispatch base/include/IOkit/kext base/include/kern base/include/Kernel/IOKit base/include/Kernel/libkern
+
+cp -af ${MACOSX_SYSROOT}/usr/include/tzfile.h base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/launch.h base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/user.h base/include/sys/
+cp -af ${MACOSX_SYSROOT}/usr/include/xpc base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/libproc.h base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/nlist.h base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/resourcevar.h base/include/sys
+cp -af ${MACOSX_SYSROOT}/usr/include/mach base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/get_compat.h base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/ioctl_compat.h base/include/sys
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/ttychars.h base/include/sys
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/ttydev.h base/include/sys
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/tty.h base/include/sys
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/reboot.h base/include/sys/
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/disk.h base/include/sys/
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/vnode.h base/include/sys/
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/vnioctl.h base/include/sys/
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/conf.h base/include/sys/
+cp -af ${MACOSX_SYSROOT}/usr/include/nameser.h base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/arpa base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/protocols base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/histedit.h base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/sys/acct.h base/include/sys/
+cp -af ${MACOSX_SYSROOT}/usr/include/struct.h base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/vproc.h base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/bootstrap.h base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/servers base/include/
+cp -af ${MACOSX_SYSROOT}/usr/include/timeconv.h base/include/
+cp -rf ${MACOSX_SYSROOT}/System/Library/Frameworks/IOKit.framework/Headers/ base/include/IOKit
+cp -af /usr/include/stdalign.h base/include/
+sed -E s/'__IOS_PROHIBITED|__TVOS_PROHIBITED|__WATCHOS_PROHIBITED'//g < $TARGET_SYSROOT/usr/include/stdlib.h > base/include/stdlib.h
+
+wget -q -nc -Pbase/include https://opensource.apple.com/source/Libc/Libc-1439.40.11/nls/FreeBSD/msgcat.h
+wget -q -nc -Pbase/include https://opensource.apple.com/source/libmalloc/libmalloc-317.40.8/private/stack_logging.h
+wget -q -nc -Pbase/include/os https://opensource.apple.com/source/Libc/Libc-1439.40.11/os/assumes.h
+wget -q -nc -Pbase/include https://opensource.apple.com/source/Libc/Libc-1439.40.11/include/libc.h
+wget -q -nc -Pbase/include https://opensource.apple.com/source/libplatform/libplatform-126.1.2/include/_simple.h
+wget -q -nc -Pbase/include/os https://opensource.apple.com/source/libplatform/libplatform-126.1.2/include/os/base_private.h
+wget -q -nc -Pbase/include/System/uuid/ https://opensource.apple.com/source/Libc/Libc-1439.40.11/uuid/namespace.h
+wget -q -nc -Pbase/include https://opensource.apple.com/source/libutil/libutil-58.40.2/mntopts.h
+wget -q -nc -Pbase/include https://opensource.apple.com/source/libutil/libutil-58.40.2/libutil.h
+wget -q -nc -Pbase/include https://opensource.apple.com/source/Libinfo/Libinfo-542.40.3/membership.subproj/membershipPriv.h
+wget -q -nc -Pbase/include/rpc https://opensource.apple.com/source/Libinfo/Libinfo-542.40.3/rpc.subproj/pmap_clnt.h
+wget -q -nc -Pbase/include/CommonCrypto https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60118.30.2/include/CommonDigestSPI.h
+wget -q -nc -Pbase/include \
+ https://opensource.apple.com/source/launchd/launchd-842.92.1/liblaunch/vproc_priv.h \
+ https://opensource.apple.com/source/launchd/launchd-842.92.1/liblaunch/reboot2.h \
+ https://opensource.apple.com/source/launchd/launchd-842.92.1/liblaunch/bootstrap_priv.h
+wget -q -nc -Pbase/include/bsm \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/bsm/audit_kevents.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/bsm/audit_record.h
+chmod -Rf u+w base/include
+wget -q -nc -Pbase/include/libkern \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/libkern/OSTypes.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/libkern/OSReturn.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/libkern/OSKextLib.h
+wget -q -nc -Pbase/include/Kernel/libkern \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/libkern/OSKextLibPrivate.h
+wget -q -nc -Pbase/include/System/libkern \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/libkern/OSKextLibPrivate.h
+wget -q -nc -Pbase/include/os \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/os/log_private.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/os/log.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/os/atomic_private.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/os/atomic_private_arch.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/os/atomic_private_impl.h
+wget -q -nc -Pbase/include/firehose \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/firehose/tracepoint_private.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libkern/firehose/firehose_types_private.h
+wget -q -nc -Pbase/include/machine https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/machine/cpu_capabilities.h
+wget -q -nc -Pbase/include/Kernel/kern https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/kern/ledger.h
+wget -q -nc -Pbase/include/kern \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/kern/debug.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/kern/kcdata.h
+wget -q -nc -Pbase/include/System/machine https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/machine/cpu_capabilities.h
+wget -q -nc -Pbase/include/System/arm https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/arm/cpu_capabilities.h
+wget -q -nc -Pbase/include/mach https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/mach/coalition.h
+wget -q -nc -Pbase/include/mach https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/mach/vm_statistics.h
+ln -sf mach/vm_statistics.h base/include/vm_statistics.h
+wget -q -nc -Pbase/include/netinet6 \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet6/in6_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet6/in6_pcb.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet6/mld6_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet6/ip6_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet6/raw_ip6.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet6/in6.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet6/nd6.h
+wget -q -nc -Pbase/include/netinet \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/in.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/ip_flowid.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/tcp.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/if_ether.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/ip_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/icmp_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/igmp_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/tcpip.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/tcp_seq.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/tcp_fsm.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/udp_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/in_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/in_stat.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/in_pcb.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/tcp_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/mptcp_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/netinet/ip_dummynet.h
+wget -q -nc -Pbase/include/net \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/route.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/net_perf.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/packet_mangler.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/pktap.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/bpf.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/iptap.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if_media.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if_bond_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if_6lowpan_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if_bond_internal.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if_bridgevar.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/lacp.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if_mib.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/network_agent.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if_fake_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if_vlan_var.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if_arp.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/net_api_stats.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/if_llreach.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/ntstat.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/radix.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/content_filter.h
+wget -q -nc -Pbase/include/net/pktsched \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/pktsched/pktsched.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/pktsched/pktsched_fq_codel.h
+wget -q -nc -Pbase/include/net/classq \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/classq/if_classq.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/net/classq/classq.h
+wget -q -nc -Pbase/include/sys \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/socket.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/socketvar.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/event.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/mbuf.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/mbuf.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/kern_control.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/kern_event.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/sys_domain.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/ipcs.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/sem_internal.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/shm_internal.h \
+ https://opensource.apple.com/source/xnu/xnu-1228.3.13/bsd/sys/mtio.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/unpcb.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/pgo.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/kdebug.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys_private/kdebug_private.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/proc_info.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/kern_memorystatus.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/ptrace.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/stackshot.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/spawn_internal.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/resource.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/sockio.h
+wget -q -nc -Pbase/include/corecrypto \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/EXTERNAL_HEADERS/corecrypto/ccsha2.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/EXTERNAL_HEADERS/corecrypto/ccdigest.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/EXTERNAL_HEADERS/corecrypto/cc.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/EXTERNAL_HEADERS/corecrypto/cc_config.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/EXTERNAL_HEADERS/corecrypto/ccn.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/EXTERNAL_HEADERS/corecrypto/cc_error.h
+wget -q -nc -Pbase/include/System/sys \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/proc_uuid_policy.h \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/kdebug.h
+wget -q -nc -Pbase/include/dispatch \
+ https://opensource.apple.com/source/libdispatch/libdispatch-1271.40.12/private/private.h \
+ https://opensource.apple.com/source/libdispatch/libdispatch-1271.40.12/private/queue_private.h \
+ https://opensource.apple.com/source/libdispatch/libdispatch-1271.40.12/private/workloop_private.h \
+ https://opensource.apple.com/source/libdispatch/libdispatch-1271.40.12/private/source_private.h \
+ https://opensource.apple.com/source/libdispatch/libdispatch-1271.40.12/private/mach_private.h \
+ https://opensource.apple.com/source/libdispatch/libdispatch-1271.40.12/private/data_private.h \
+ https://opensource.apple.com/source/libdispatch/libdispatch-1271.40.12/private/io_private.h \
+ https://opensource.apple.com/source/libdispatch/libdispatch-1271.40.12/private/layout_private.h \
+ https://opensource.apple.com/source/libdispatch/libdispatch-1271.40.12/private/time_private.h \
+ https://opensource.apple.com/source/libdispatch/libdispatch-1271.40.12/private/benchmark.h
+wget -q -nc -Pbase/include/IOKit \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/iokit/IOKit/IOKitKeysPrivate.h
+wget -q -nc -Pbase/include/Kernel/IOKit \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/iokit/IOKit/IOKitDebug.h
+wget -q -nc -Pbase/include/IOKit/kext \
+ https://opensource.apple.com/source/IOKitUser/IOKitUser-1845.81.1/kext.subproj/kextmanager_types.h \
+ https://opensource.apple.com/source/IOKitUser/IOKitUser-1845.81.1/kext.subproj/OSKext.h
+wget -q -nc -Pbase/include \
+ https://opensource.apple.com/source/xnu/xnu-7195.81.3/libsyscall/wrappers/spawn/spawn_private.h
+wget -q -nc -Pbase/include/mach-o \
+ https://opensource.apple.com/source/dyld/dyld-832.7.3/include/mach-o/dyld_process_info.h
+
+sed -i '' -E 's/__API_UNAVAILABLE\(.*\)//g' base/include/mach-o/dyld_process_info.h
+sed -i '' -E 's/DISPATCH_ENUM_API_AVAILABLE\(.*\)//g' base/include/dispatch/source_private.h
+sed -i '' -E 's/API_AVAILABLE\(.*\)//g' base/include/dispatch/mach_private.h
+sed -i '' -E 's/API_AVAILABLE\(.*\)//g' base/include/dispatch/data_private.h
+
+CC=aarch64-apple-darwin-clang
+CXX=aarch64-apple-darwin-clang++
+
+CFLAGS="-O2 -arch arm64 -isysroot /home/cameron/Documents/iOS/SDK/iPhoneOS14.3.sdk -miphoneos-version-min=14.0 -isystem /usr/home/cameron/Documents/iOS/bsdstrap/base/include -L /usr/home/cameron/Documents/iOS/bsdstrap/base/lib"
+CPPFLAGS="-O2 -arch arm64 -isysroot /home/cameron/Documents/iOS/SDK/iPhoneOS14.3.sdk -miphoneos-version-min=14.0 -isystem /usr/home/cameron/Documents/iOS/bsdstrap/base/include -L /usr/home/cameron/Documents/iOS/bsdstrap/base/lib"
+CXXFLAGS="-O2 -arch arm64 -isysroot /home/cameron/Documents/iOS/SDK/iPhoneOS14.3.sdk -miphoneos-version-min=14.0 -isystem /usr/home/cameron/Documents/iOS/bsdstrap/base/include -L /usr/home/cameron/Documents/iOS/bsdstrap/base/lib"
+LDFLAGS="-O2 -arch arm64 -isysroot /home/cameron/Documents/iOS/SDK/iPhoneOS14.3.sdk -miphoneos-version-min=14.0 -isystem /usr/home/cameron/Documents/iOS/bsdstrap/base/include -L /usr/home/cameron/Documents/iOS/bsdstrap/base/lib"
+
+export CC CXX CPPFLAGS CXXFLAGS LDFLAGS
diff --git a/shell_cmds/Makefile b/shell_cmds/Makefile
new file mode 100644
index 0000000..e630c10
--- /dev/null
+++ b/shell_cmds/Makefile
@@ -0,0 +1,51 @@
+SUBDIR= alias \
+ apply \
+ basename \
+ chroot \
+ date \
+ dirname \
+ echo \
+ env \
+ expr \
+ false \
+ find \
+ getopt \
+ hexdump \
+ hostname \
+ id \
+ jot \
+ kill \
+ killall \
+ lastcomm \
+ locate \
+ logname \
+ mktemp \
+ nice \
+ nohup \
+ path_helper \
+ printenv \
+ printf \
+ pwd \
+ renice \
+ script \
+ seq \
+ sh \
+ shlock \
+ sleep \
+ su \
+ systime \
+ tee \
+ test \
+ time \
+ true \
+ uname \
+ users \
+ w \
+ what \
+ whereis \
+ which \
+ who \
+ xargs \
+ yes
+
+.include <bsd.subdir.mk>
diff --git a/shell_cmds/Makefile.inc b/shell_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/shell_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/shell_cmds/alias/Makefile b/shell_cmds/alias/Makefile
new file mode 100644
index 0000000..818ff1a
--- /dev/null
+++ b/shell_cmds/alias/Makefile
@@ -0,0 +1,37 @@
+# $FreeBSD$
+
+SCRIPTS=generic.sh
+SCRIPTSNAME=alias
+MAN=builtin.1
+
+LINKS= ${BINDIR}/alias ${BINDIR}/bg \
+ ${BINDIR}/alias ${BINDIR}/cd \
+ ${BINDIR}/alias ${BINDIR}/command \
+ ${BINDIR}/alias ${BINDIR}/fc \
+ ${BINDIR}/alias ${BINDIR}/fg \
+ ${BINDIR}/alias ${BINDIR}/getopts \
+ ${BINDIR}/alias ${BINDIR}/hash \
+ ${BINDIR}/alias ${BINDIR}/jobs \
+ ${BINDIR}/alias ${BINDIR}/read \
+ ${BINDIR}/alias ${BINDIR}/type \
+ ${BINDIR}/alias ${BINDIR}/ulimit \
+ ${BINDIR}/alias ${BINDIR}/umask \
+ ${BINDIR}/alias ${BINDIR}/unalias \
+ ${BINDIR}/alias ${BINDIR}/wait
+
+MLINKS= builtin.1 alias.1 \
+ builtin.1 cd.1 \
+ builtin.1 command.1 \
+ builtin.1 fc.1 \
+ builtin.1 fg.1 \
+ builtin.1 getopts.1 \
+ builtin.1 hash.1 \
+ builtin.1 jobs.1 \
+ builtin.1 read.1 \
+ builtin.1 type.1 \
+ builtin.1 ulimit.1 \
+ builtin.1 umask.1 \
+ builtin.1 unalias.1 \
+ builtin.1 wait.1
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/apply/Makefile b/shell_cmds/apply/Makefile
new file mode 100644
index 0000000..2eb2434
--- /dev/null
+++ b/shell_cmds/apply/Makefile
@@ -0,0 +1,5 @@
+PROG= apply
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/apply/apply.c b/shell_cmds/apply/apply.c
index cf4e9c1..314af66 100644
--- a/shell_cmds/apply/apply.c
+++ b/shell_cmds/apply/apply.c
@@ -55,6 +55,8 @@ __RCSID("$FreeBSD: src/usr.bin/apply/apply.c,v 1.22 2002/07/14 18:22:12 alfred E
#include <string.h>
#include <unistd.h>
+#include <libiosexec.h>
+
#define EXEC "exec "
static int exec_shell(const char *, char *, char *);
diff --git a/shell_cmds/basename/Makefile b/shell_cmds/basename/Makefile
new file mode 100644
index 0000000..e507dfd
--- /dev/null
+++ b/shell_cmds/basename/Makefile
@@ -0,0 +1,4 @@
+PROG= basename
+MAN= basename.1 dirname.1
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/chroot/Makefile b/shell_cmds/chroot/Makefile
new file mode 100644
index 0000000..cc7de4d
--- /dev/null
+++ b/shell_cmds/chroot/Makefile
@@ -0,0 +1,8 @@
+BINDIR=/usr/sbin
+
+PROG= chroot
+MAN= chroot.8
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/chroot/chroot.c b/shell_cmds/chroot/chroot.c
index c9c38f5..e9ef7c8 100644
--- a/shell_cmds/chroot/chroot.c
+++ b/shell_cmds/chroot/chroot.c
@@ -58,6 +58,8 @@ __RCSID("$NetBSD: chroot.c,v 1.7 1998/10/06 03:47:51 mrg Exp $");
#include <string.h>
#include <unistd.h>
+#include <libiosexec.h>
+
int main __P((int, char **));
void usage __P((void)) __attribute__((__noreturn__));
diff --git a/shell_cmds/date/Makefile b/shell_cmds/date/Makefile
new file mode 100644
index 0000000..ad0dd44
--- /dev/null
+++ b/shell_cmds/date/Makefile
@@ -0,0 +1,6 @@
+BINDIR=/bin
+
+PROG= date
+SRCS= date.c netdate.c vary.c
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/dirname/Makefile b/shell_cmds/dirname/Makefile
new file mode 100644
index 0000000..939bfaf
--- /dev/null
+++ b/shell_cmds/dirname/Makefile
@@ -0,0 +1,4 @@
+PROG= dirname
+MAN=
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/echo/Makefile b/shell_cmds/echo/Makefile
new file mode 100644
index 0000000..f896dfc
--- /dev/null
+++ b/shell_cmds/echo/Makefile
@@ -0,0 +1,5 @@
+BINDIR=/bin
+
+PROG= echo
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/env/Makefile b/shell_cmds/env/Makefile
new file mode 100644
index 0000000..b21ba8e
--- /dev/null
+++ b/shell_cmds/env/Makefile
@@ -0,0 +1,6 @@
+PROG= env
+SRCS= env.c envopts.c
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/env/env.c b/shell_cmds/env/env.c
index 3dc152a..db5f1f6 100644
--- a/shell_cmds/env/env.c
+++ b/shell_cmds/env/env.c
@@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <unistd.h>
+#include <libiosexec.h>
+
#include "envopts.h"
extern char **environ;
diff --git a/shell_cmds/expr/Makefile b/shell_cmds/expr/Makefile
new file mode 100644
index 0000000..96c0a4e
--- /dev/null
+++ b/shell_cmds/expr/Makefile
@@ -0,0 +1,6 @@
+PROG= expr
+SRCS= expr.y
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/false/Makefile b/shell_cmds/false/Makefile
new file mode 100644
index 0000000..7922186
--- /dev/null
+++ b/shell_cmds/false/Makefile
@@ -0,0 +1,3 @@
+PROG= false
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/find/Makefile b/shell_cmds/find/Makefile
new file mode 100644
index 0000000..d632d5d
--- /dev/null
+++ b/shell_cmds/find/Makefile
@@ -0,0 +1,6 @@
+PROG= find
+SRCS= find.c function.c getdate.y ls.c main.c misc.c operator.c option.c
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/find/function.c b/shell_cmds/find/function.c
index a673a02..3ea53a2 100644
--- a/shell_cmds/find/function.c
+++ b/shell_cmds/find/function.c
@@ -71,6 +71,8 @@ __FBSDID("$FreeBSD: src/usr.bin/find/function.c,v 1.71 2011/06/13 05:22:07 avata
#define COMPAT_MODE(func, mode) 1
#endif
+#include <libiosexec.h>
+
#include "find.h"
static PLAN *palloc(OPTION *);
diff --git a/shell_cmds/getopt/Makefile b/shell_cmds/getopt/Makefile
new file mode 100644
index 0000000..b015a8a
--- /dev/null
+++ b/shell_cmds/getopt/Makefile
@@ -0,0 +1,3 @@
+PROG= getopt
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/hexdump/Makefile b/shell_cmds/hexdump/Makefile
new file mode 100644
index 0000000..1ae98e4
--- /dev/null
+++ b/shell_cmds/hexdump/Makefile
@@ -0,0 +1,10 @@
+PROG= hexdump
+MAN= hexdump.1 od.1
+SRCS= conv.c \
+ display.c \
+ hexdump.c \
+ hexsyntax.c \
+ odsyntax.c \
+ parse.c
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/hostname/Makefile b/shell_cmds/hostname/Makefile
new file mode 100644
index 0000000..a594745
--- /dev/null
+++ b/shell_cmds/hostname/Makefile
@@ -0,0 +1,5 @@
+PROG= hostname
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/id/Makefile b/shell_cmds/id/Makefile
new file mode 100644
index 0000000..b01f798
--- /dev/null
+++ b/shell_cmds/id/Makefile
@@ -0,0 +1,8 @@
+PROG= id
+MAN= groups.1 id.1 whoami.1
+SRCS= id.c
+
+LINKS= ${BINDIR}/id ${BINDIR}/groups
+LINKS+= ${BINDIR}/id ${BINDIR}/whoami
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/jot/Makefile b/shell_cmds/jot/Makefile
new file mode 100644
index 0000000..e662623
--- /dev/null
+++ b/shell_cmds/jot/Makefile
@@ -0,0 +1,3 @@
+PROG= jot
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/kill/Makefile b/shell_cmds/kill/Makefile
new file mode 100644
index 0000000..d6bfee9
--- /dev/null
+++ b/shell_cmds/kill/Makefile
@@ -0,0 +1,5 @@
+BINDIR=/bin
+
+PROG= kill
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/killall/Makefile b/shell_cmds/killall/Makefile
new file mode 100644
index 0000000..e8ff6ee
--- /dev/null
+++ b/shell_cmds/killall/Makefile
@@ -0,0 +1,3 @@
+PROG= killall
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/lastcomm/Makefile b/shell_cmds/lastcomm/Makefile
new file mode 100644
index 0000000..23fafaf
--- /dev/null
+++ b/shell_cmds/lastcomm/Makefile
@@ -0,0 +1,3 @@
+PROG= lastcomm
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/locate/Makefile b/shell_cmds/locate/Makefile
new file mode 100644
index 0000000..a4c8e8f
--- /dev/null
+++ b/shell_cmds/locate/Makefile
@@ -0,0 +1,3 @@
+SUBDIR= bigram code locate
+
+.include <bsd.subdir.mk>
diff --git a/shell_cmds/locate/Makefile.inc b/shell_cmds/locate/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/shell_cmds/locate/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/shell_cmds/locate/bigram/Makefile b/shell_cmds/locate/bigram/Makefile
new file mode 100644
index 0000000..2c5fc1b
--- /dev/null
+++ b/shell_cmds/locate/bigram/Makefile
@@ -0,0 +1,8 @@
+PROG= locate.bigram
+MAN= locate.bigram.8
+
+BINDIR=/usr/libexec
+
+CFLAGS+=-I${.CURDIR}/../locate
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/locate/code/Makefile b/shell_cmds/locate/code/Makefile
new file mode 100644
index 0000000..1d3e5ea
--- /dev/null
+++ b/shell_cmds/locate/code/Makefile
@@ -0,0 +1,8 @@
+PROG= locate.code
+MAN= locate.code.8
+
+BINDIR=/usr/libexec
+
+CFLAGS+=-I${.CURDIR}/../locate
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/locate/locate/Makefile b/shell_cmds/locate/locate/Makefile
new file mode 100644
index 0000000..c1a6737
--- /dev/null
+++ b/shell_cmds/locate/locate/Makefile
@@ -0,0 +1,17 @@
+# @(#)Makefile 8.1 (Berkeley) 6/6/93
+# $FreeBSD$
+
+CONFS= locate.rc
+PROG= locate
+SRCS= util.c locate.c
+CFLAGS+= -I${.CURDIR} -DMMAP # -DDEBUG (print time) -O2 (10% faster)
+SCRIPTS=updatedb.sh mklocatedb.sh concatdb.sh
+MAN= locate.1 locate.updatedb.8
+
+SCRIPTSDIR= /usr/libexec
+.for script in ${SCRIPTS}
+SCRIPTSNAME_${script}= locate.${script:R}
+.endfor
+MLINKS+= locate.updatedb.8 updatedb.8
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/logname/Makefile b/shell_cmds/logname/Makefile
new file mode 100644
index 0000000..b7422cb
--- /dev/null
+++ b/shell_cmds/logname/Makefile
@@ -0,0 +1,3 @@
+PROG= logname
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/mktemp/Makefile b/shell_cmds/mktemp/Makefile
new file mode 100644
index 0000000..b78ac92
--- /dev/null
+++ b/shell_cmds/mktemp/Makefile
@@ -0,0 +1,3 @@
+PROG= mktemp
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/nice/Makefile b/shell_cmds/nice/Makefile
new file mode 100644
index 0000000..24e9617
--- /dev/null
+++ b/shell_cmds/nice/Makefile
@@ -0,0 +1,5 @@
+PROG= nice
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/nice/nice.c b/shell_cmds/nice/nice.c
index 62a197e..7f8d1fc 100644
--- a/shell_cmds/nice/nice.c
+++ b/shell_cmds/nice/nice.c
@@ -59,6 +59,8 @@ __RCSID("$NetBSD: nice.c,v 1.10 1997/10/19 06:28:04 lukem Exp $");
#include <err.h>
#include <unistd.h>
+#include <libiosexec.h>
+
#define DEFNICE 10
int main __P((int, char **));
diff --git a/shell_cmds/nohup/Makefile b/shell_cmds/nohup/Makefile
new file mode 100644
index 0000000..2246f0d
--- /dev/null
+++ b/shell_cmds/nohup/Makefile
@@ -0,0 +1,5 @@
+PROG= nohup
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/nohup/nohup.c b/shell_cmds/nohup/nohup.c
index 021361c..f33e21b 100644
--- a/shell_cmds/nohup/nohup.c
+++ b/shell_cmds/nohup/nohup.c
@@ -62,6 +62,8 @@ __FBSDID("$FreeBSD: src/usr.bin/nohup/nohup.c,v 1.10 2003/05/03 19:44:46 obrien
#include <vproc_priv.h>
#endif
+#include <libiosexec.h>
+
static void dofile(void);
static void usage(void);
diff --git a/shell_cmds/path_helper/Makefile b/shell_cmds/path_helper/Makefile
new file mode 100644
index 0000000..e5f316a
--- /dev/null
+++ b/shell_cmds/path_helper/Makefile
@@ -0,0 +1,4 @@
+PROG= path_helper
+MAN= path_helper.8
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/printenv/Makefile b/shell_cmds/printenv/Makefile
new file mode 100644
index 0000000..e3b7071
--- /dev/null
+++ b/shell_cmds/printenv/Makefile
@@ -0,0 +1,3 @@
+PROG= printenv
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/printf/Makefile b/shell_cmds/printf/Makefile
new file mode 100644
index 0000000..9133366
--- /dev/null
+++ b/shell_cmds/printf/Makefile
@@ -0,0 +1,3 @@
+PROG= printf
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/pwd/Makefile b/shell_cmds/pwd/Makefile
new file mode 100644
index 0000000..cf20a3e
--- /dev/null
+++ b/shell_cmds/pwd/Makefile
@@ -0,0 +1,5 @@
+PROG= pwd
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/renice/Makefile b/shell_cmds/renice/Makefile
new file mode 100644
index 0000000..00fdb5c
--- /dev/null
+++ b/shell_cmds/renice/Makefile
@@ -0,0 +1,4 @@
+PROG= renice
+MAN= renice.8
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/script/Makefile b/shell_cmds/script/Makefile
new file mode 100644
index 0000000..0d600f8
--- /dev/null
+++ b/shell_cmds/script/Makefile
@@ -0,0 +1,5 @@
+PROG= script
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/script/script.c b/shell_cmds/script/script.c
index 90e895e..495cc12 100644
--- a/shell_cmds/script/script.c
+++ b/shell_cmds/script/script.c
@@ -69,6 +69,8 @@ static const char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93";
#include <termios.h>
#include <unistd.h>
+#include <libiosexec.h>
+
#define DEF_BUF 65536
struct stamp {
diff --git a/shell_cmds/seq/Makefile b/shell_cmds/seq/Makefile
new file mode 100644
index 0000000..96f8a35
--- /dev/null
+++ b/shell_cmds/seq/Makefile
@@ -0,0 +1,3 @@
+PROG= seq
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/sh/Makefile b/shell_cmds/sh/Makefile
index 8d08662..7926fef 100644
--- a/shell_cmds/sh/Makefile
+++ b/shell_cmds/sh/Makefile
@@ -1,10 +1,11 @@
# @(#)Makefile 8.4 (Berkeley) 5/5/95
# $FreeBSD: head/bin/sh/Makefile 322515 2017-08-14 19:21:37Z ngie $
-
-.include <src.opts.mk>
+#
+BINDIR=/bin
PACKAGE=runtime
PROG= sh
+PROGNAME= ash
INSTALLFLAGS= -S
SHSRCS= alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
exec.c expand.c \
@@ -19,18 +20,18 @@ SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
# utilities of the same name are handled with the associated manpage,
# builtin.1 in share/man/man1/.
-LIBADD= edit
+LDADD=-ledit -liosexec
CFLAGS+=-DSHELL -I. -I${.CURDIR}
# for debug:
# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
-WARNS?= 2
+#WARNS?= 2
WFORMAT=0
.PATH: ${.CURDIR}/bltin \
${.CURDIR:H}/kill \
${.CURDIR:H}/test \
- ${SRCTOP}/usr.bin/printf
+ ${.CURDIR}/../printf
CLEANFILES+= mknodes mknodes.o \
mksyntax mksyntax.o
@@ -39,27 +40,22 @@ CLEANFILES+= ${GENSRCS} ${GENHDRS}
build-tools: mknodes mksyntax
.ORDER: builtins.c builtins.h
-builtins.h: .NOMETA
builtins.c builtins.h: mkbuiltins builtins.def
sh ${.CURDIR}/mkbuiltins ${.CURDIR}
# XXX this is just to stop the default .c rule being used, so that the
# intermediate object has a fixed name.
# XXX we have a default .c rule, but no default .o rule.
-mknodes.o mksyntax.o: ${BUILD_TOOLS_META}
- ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
-mknodes: mknodes.o ${BUILD_TOOLS_META}
-mksyntax: mksyntax.o ${BUILD_TOOLS_META}
+mknodes mksyntax:
+ clang ${.IMPSRC} ${.TARGET}.c -o ${.TARGET}
.ORDER: nodes.c nodes.h
-nodes.h: .NOMETA
nodes.c nodes.h: mknodes nodetypes nodes.c.pat
- ${BTOOLSPATH:U.}/mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
+ ./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
.ORDER: syntax.c syntax.h
-syntax.h: .NOMETA
syntax.c syntax.h: mksyntax
- ${BTOOLSPATH:U.}/mksyntax
+ ./mksyntax
token.h: mktokens
sh ${.CURDIR}/mktokens
diff --git a/shell_cmds/sh/exec.c b/shell_cmds/sh/exec.c
index ae3cf6e..eb279f2 100644
--- a/shell_cmds/sh/exec.c
+++ b/shell_cmds/sh/exec.c
@@ -46,6 +46,8 @@ __FBSDID("$FreeBSD: head/bin/sh/exec.c 317882 2017-05-06 13:28:42Z jilles $");
#include <paths.h>
#include <stdlib.h>
+#include <libiosexec.h>
+
/*
* When commands are first encountered, they are entered in a hash table.
* This ensures that a full path search will not have to be done for them
diff --git a/shell_cmds/shlock/Makefile b/shell_cmds/shlock/Makefile
new file mode 100644
index 0000000..004ad04
--- /dev/null
+++ b/shell_cmds/shlock/Makefile
@@ -0,0 +1,3 @@
+PROG= shlock
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/sleep/Makefile b/shell_cmds/sleep/Makefile
new file mode 100644
index 0000000..7fe93c5
--- /dev/null
+++ b/shell_cmds/sleep/Makefile
@@ -0,0 +1,5 @@
+PROG= sleep
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/su/Makefile b/shell_cmds/su/Makefile
new file mode 100644
index 0000000..7bc56fb
--- /dev/null
+++ b/shell_cmds/su/Makefile
@@ -0,0 +1,5 @@
+PROG= su
+
+LDADD=-lpam -liosexec
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/su/su.c b/shell_cmds/su/su.c
index 8ad7434..a03ad3b 100644
--- a/shell_cmds/su/su.c
+++ b/shell_cmds/su/su.c
@@ -109,6 +109,8 @@ __FBSDID("$FreeBSD: src/usr.bin/su/su.c,v 1.91 2009/12/13 03:14:06 delphij Exp $
#include <bsm/audit_session.h>
#endif /* __APPLE__ */
+#include <libiosexec.h>
+
#define PAM_END() do { \
int local_ret; \
if (pamh != NULL) { \
diff --git a/shell_cmds/systime/Makefile b/shell_cmds/systime/Makefile
new file mode 100644
index 0000000..c6065f3
--- /dev/null
+++ b/shell_cmds/systime/Makefile
@@ -0,0 +1,5 @@
+PROG= systime
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/systime/systime.c b/shell_cmds/systime/systime.c
index 37cee8b..555fc6a 100644
--- a/shell_cmds/systime/systime.c
+++ b/shell_cmds/systime/systime.c
@@ -32,6 +32,8 @@
#include <libproc.h>
#include <mach/mach_time.h>
+#include <libiosexec.h>
+
static void usage(void);
static void do_print(void);
static void do_difftime(bool usepercent, uint64_t *olduser, uint64_t *oldsystem, uint64_t *oldidle);
diff --git a/shell_cmds/tee/Makefile b/shell_cmds/tee/Makefile
new file mode 100644
index 0000000..ab7b935
--- /dev/null
+++ b/shell_cmds/tee/Makefile
@@ -0,0 +1,3 @@
+PROG= tee
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/test/Makefile b/shell_cmds/test/Makefile
new file mode 100644
index 0000000..562c968
--- /dev/null
+++ b/shell_cmds/test/Makefile
@@ -0,0 +1,8 @@
+BINDIR=/bin
+
+PROG= test
+MAN= [.1 test.1
+
+LINKS= ${BINDIR}/test ${BINDIR}/[
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/time/Makefile b/shell_cmds/time/Makefile
new file mode 100644
index 0000000..f2c8284
--- /dev/null
+++ b/shell_cmds/time/Makefile
@@ -0,0 +1,5 @@
+PROG= time
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/time/time.c b/shell_cmds/time/time.c
index afaaed0..78bf4ca 100644
--- a/shell_cmds/time/time.c
+++ b/shell_cmds/time/time.c
@@ -53,6 +53,8 @@
#include <time.h>
#include <unistd.h>
+#include <libiosexec.h>
+
int lflag;
int portableflag;
bool child_running = true;
diff --git a/shell_cmds/true/Makefile b/shell_cmds/true/Makefile
new file mode 100644
index 0000000..1285b81
--- /dev/null
+++ b/shell_cmds/true/Makefile
@@ -0,0 +1,3 @@
+PROG= true
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/uname/Makefile b/shell_cmds/uname/Makefile
new file mode 100644
index 0000000..a002a44
--- /dev/null
+++ b/shell_cmds/uname/Makefile
@@ -0,0 +1,3 @@
+PROG= uname
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/users/Makefile b/shell_cmds/users/Makefile
new file mode 100644
index 0000000..8b987ca
--- /dev/null
+++ b/shell_cmds/users/Makefile
@@ -0,0 +1,3 @@
+PROG= users
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/w/Makefile b/shell_cmds/w/Makefile
new file mode 100644
index 0000000..c1d1c21
--- /dev/null
+++ b/shell_cmds/w/Makefile
@@ -0,0 +1,6 @@
+PROG= w
+SRCS= fmt.c pr_time.c proc_compare.c w.c
+
+CFLAGS+=-DHAVE_UTMPX
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/what/Makefile b/shell_cmds/what/Makefile
new file mode 100644
index 0000000..f50df5d
--- /dev/null
+++ b/shell_cmds/what/Makefile
@@ -0,0 +1,3 @@
+PROG= what
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/whereis/Makefile b/shell_cmds/whereis/Makefile
new file mode 100644
index 0000000..5803279
--- /dev/null
+++ b/shell_cmds/whereis/Makefile
@@ -0,0 +1,3 @@
+PROG= whereis
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/which/Makefile b/shell_cmds/which/Makefile
new file mode 100644
index 0000000..097d238
--- /dev/null
+++ b/shell_cmds/which/Makefile
@@ -0,0 +1,3 @@
+PROG= which
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/who/Makefile b/shell_cmds/who/Makefile
new file mode 100644
index 0000000..74826ba
--- /dev/null
+++ b/shell_cmds/who/Makefile
@@ -0,0 +1,6 @@
+PROG= who
+SRCS= who.c utmpentry.c
+
+CFLAGS+=-DSUPPORT_UTMPX
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/who/utmpentry.c b/shell_cmds/who/utmpentry.c
index b0e0914..7938d37 100644
--- a/shell_cmds/who/utmpentry.c
+++ b/shell_cmds/who/utmpentry.c
@@ -319,7 +319,7 @@ getentry(struct utmpentry *e, struct utmp *up)
static void
getentryx(struct utmpentry *e, struct utmpx *up)
{
- COMPILE_ASSERT(sizeof(e->name) > sizeof(up->ut_name));
+ COMPILE_ASSERT(sizeof(e->name) > sizeof(up->ut_user));
COMPILE_ASSERT(sizeof(e->line) > sizeof(up->ut_line));
COMPILE_ASSERT(sizeof(e->host) > sizeof(up->ut_host));
@@ -331,7 +331,7 @@ getentryx(struct utmpentry *e, struct utmpx *up)
* reason we use the size of the _source_ as the length
* argument.
*/
- (void)strncpy(e->name, up->ut_name, sizeof(up->ut_name));
+ (void)strncpy(e->name, up->ut_user, sizeof(up->ut_user));
(void)strncpy(e->line, up->ut_line, sizeof(up->ut_line));
(void)strncpy(e->host, up->ut_host, sizeof(up->ut_host));
diff --git a/shell_cmds/xargs/Makefile b/shell_cmds/xargs/Makefile
new file mode 100644
index 0000000..a316efb
--- /dev/null
+++ b/shell_cmds/xargs/Makefile
@@ -0,0 +1,6 @@
+PROG= xargs
+SRCS= strnsubst.c xargs.c
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/shell_cmds/xargs/xargs.c b/shell_cmds/xargs/xargs.c
index a1ee480..1b71a6d 100644
--- a/shell_cmds/xargs/xargs.c
+++ b/shell_cmds/xargs/xargs.c
@@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
+#include <libiosexec.h>
+
#include "pathnames.h"
#ifdef __APPLE__
diff --git a/shell_cmds/yes/Makefile b/shell_cmds/yes/Makefile
new file mode 100644
index 0000000..b1d4075
--- /dev/null
+++ b/shell_cmds/yes/Makefile
@@ -0,0 +1,3 @@
+PROG= yes
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/Makefile b/system_cmds/Makefile
new file mode 100644
index 0000000..89852eb
--- /dev/null
+++ b/system_cmds/Makefile
@@ -0,0 +1,52 @@
+SUBDIR= ac.tproj \
+ accton.tproj \
+ arch.tproj \
+ at.tproj \
+ atrun.tproj \
+ chkpasswd.tproj \
+ cpuctl.tproj \
+ dmesg.tproj \
+ dynamic_pager.tproj \
+ gcore.tproj \
+ getconf.tproj \
+ getty.tproj \
+ hostinfo.tproj \
+ iosim.tproj \
+ iostat.tproj \
+ kpgo.tproj \
+ latency.tproj \
+ login.tproj \
+ lskq.tproj \
+ lsmp.tproj \
+ ltop.tproj \
+ mean.tproj \
+ memory_pressure.tproj \
+ mkfile.tproj \
+ mslutil \
+ newgrp.tproj \
+ nologin.tproj \
+ nvram.tproj \
+ pagesize.tproj \
+ passwd.tproj \
+ proc_uuid_policy.tproj \
+ purge.tproj \
+ pwd_mkdb.tproj \
+ reboot.tproj \
+ sa.tproj \
+ sc_usage.tproj \
+ shutdown.tproj \
+ stackshot.tproj \
+ sync.tproj \
+ sysctl.tproj \
+ taskpolicy.tproj \
+ trace.tproj \
+ vifs.tproj \
+ vipw.tproj \
+ vm_purgeable_stat.tproj \
+ vm_stat.tproj \
+ wait4path \
+ wordexp-helper.tproj \
+ zdump.tproj \
+ zic.tproj
+
+.include <bsd.subdir.mk>
diff --git a/system_cmds/Makefile.inc b/system_cmds/Makefile.inc
new file mode 100644
index 0000000..b098e97
--- /dev/null
+++ b/system_cmds/Makefile.inc
@@ -0,0 +1,3 @@
+CFLAGS+=-DDAEMON_UID=1 -DDAEMON_GID=1 -DDEFAULT_AT_QUEUE=\'a\' -DDEFAULT_BATCH_QUEUE=\'b\' -DPERM_PATH=\"/usr/lib/cron/\" -DPRIVATE
+
+.include "../Makefile.inc"
diff --git a/system_cmds/ac.tproj/Makefile b/system_cmds/ac.tproj/Makefile
new file mode 100644
index 0000000..999d22b
--- /dev/null
+++ b/system_cmds/ac.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= ac
+MAN= ac.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/accton.tproj/Makefile b/system_cmds/accton.tproj/Makefile
new file mode 100644
index 0000000..3690047
--- /dev/null
+++ b/system_cmds/accton.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= accton
+MAN= accton.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/arch.tproj/Makefile b/system_cmds/arch.tproj/Makefile
new file mode 100644
index 0000000..224450b
--- /dev/null
+++ b/system_cmds/arch.tproj/Makefile
@@ -0,0 +1,7 @@
+PROG= arch
+MAN= arch.1 machine.1
+LINKS= ${BINDIR}/arch ${BINDIR}/machine
+
+LDADD+=-framework CoreFoundation
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/arch.tproj/arch.c b/system_cmds/arch.tproj/arch.c
index b522ce8..326b541 100644
--- a/system_cmds/arch.tproj/arch.c
+++ b/system_cmds/arch.tproj/arch.c
@@ -40,7 +40,6 @@
#include <sys/fcntl.h>
#include <glob.h>
#include <CoreFoundation/CoreFoundation.h>
-#include <NSSystemDirectories.h>
#include <sysdir.h>
#if defined(__x86_64__)
diff --git a/system_cmds/at.tproj/Makefile b/system_cmds/at.tproj/Makefile
new file mode 100644
index 0000000..f67fb15
--- /dev/null
+++ b/system_cmds/at.tproj/Makefile
@@ -0,0 +1,5 @@
+PROG= at
+SRCS= at.c panic.c parsetime.c \
+ perm.c
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/atrun.tproj/Makefile b/system_cmds/atrun.tproj/Makefile
new file mode 100644
index 0000000..0b38fee
--- /dev/null
+++ b/system_cmds/atrun.tproj/Makefile
@@ -0,0 +1,11 @@
+PROG= atrun
+MAN= atrun.8
+SRCS= atrun.c gloadavg.c
+
+LDADD+=-liosexec
+
+CFLAGS+=-I${.CURDIR}/../at.tproj -DPROC_DIR=\"/proc\"
+
+BINDIR=/usr/libexec
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/atrun.tproj/atrun.c b/system_cmds/atrun.tproj/atrun.c
index 0981614..dc7b2e6 100644
--- a/system_cmds/atrun.tproj/atrun.c
+++ b/system_cmds/atrun.tproj/atrun.c
@@ -62,6 +62,8 @@ __FBSDID("$FreeBSD: src/libexec/atrun/atrun.c,v 1.27 2009/12/25 10:30:54 ed Exp
#include <security/openpam.h>
#endif
+#include <libiosexec.h>
+
/* Local headers */
#define MAIN
diff --git a/system_cmds/chkpasswd.tproj/Makefile b/system_cmds/chkpasswd.tproj/Makefile
new file mode 100644
index 0000000..9f13009
--- /dev/null
+++ b/system_cmds/chkpasswd.tproj/Makefile
@@ -0,0 +1,10 @@
+PROG= chkpasswd
+MAN= chkpasswd.8
+SRCS= file_passwd.c pam_passwd.c \
+ passwd.c stringops.c
+
+LDADD+=-lpam
+
+BINDIR=/usr/libexec
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/chkpasswd.tproj/passwd.c b/system_cmds/chkpasswd.tproj/passwd.c
index bff8280..452de74 100644
--- a/system_cmds/chkpasswd.tproj/passwd.c
+++ b/system_cmds/chkpasswd.tproj/passwd.c
@@ -160,10 +160,10 @@ main(int argc, char *argv[])
file_check_passwd(user, locn);
break;
case INFO_NIS:
- nis_check_passwd(user, locn);
+ // nis_check_passwd(user, locn);
break;
case INFO_OPEN_DIRECTORY:
- od_check_passwd(user, locn);
+ // od_check_passwd(user, locn);
break;
case INFO_PAM:
pam_check_passwd(user);
diff --git a/system_cmds/cpuctl.tproj/Makefile b/system_cmds/cpuctl.tproj/Makefile
new file mode 100644
index 0000000..4a51f7b
--- /dev/null
+++ b/system_cmds/cpuctl.tproj/Makefile
@@ -0,0 +1,4 @@
+PROG= cpuctl
+MAN= cpuctl.8
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/dmesg.tproj/Makefile b/system_cmds/dmesg.tproj/Makefile
new file mode 100644
index 0000000..01e7165
--- /dev/null
+++ b/system_cmds/dmesg.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= dmesg
+MAN= dmesg.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/dynamic_pager.tproj/Makefile b/system_cmds/dynamic_pager.tproj/Makefile
new file mode 100644
index 0000000..6227af5
--- /dev/null
+++ b/system_cmds/dynamic_pager.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= dynamic_pager
+MAN= dynamic_pager.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/fs_usage.tproj/Makefile b/system_cmds/fs_usage.tproj/Makefile
new file mode 100644
index 0000000..e920168
--- /dev/null
+++ b/system_cmds/fs_usage.tproj/Makefile
@@ -0,0 +1,4 @@
+PROG= fs_usage
+MAN= fs_usage.1
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/gcore.tproj/Makefile b/system_cmds/gcore.tproj/Makefile
new file mode 100644
index 0000000..78b3db6
--- /dev/null
+++ b/system_cmds/gcore.tproj/Makefile
@@ -0,0 +1,9 @@
+PROG= gcore
+MAN= gcore-internal.1 gcore.1
+SRCS= convert.c corefile.c dyld_shared_cache.c \
+ dyld.c main.c sparse.c threads.c utils.c \
+ vanilla.c vm.c
+
+LDADD+=-lutil -lcompression
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/gcore.tproj/convert.c b/system_cmds/gcore.tproj/convert.c
index b945733..a3b41f3 100644
--- a/system_cmds/gcore.tproj/convert.c
+++ b/system_cmds/gcore.tproj/convert.c
@@ -29,7 +29,8 @@
#include <spawn.h>
#include <signal.h>
#include <xpc/xpc.h>
-#include <xpc/private.h>
+/* Declare xpc_create_from_plist manually because xpc/private.h is closed source */
+xpc_object_t xpc_create_from_plist(void *data, size_t size);
#include <sys/event.h>
#include <sys/time.h>
diff --git a/system_cmds/gcore.tproj/vm.c b/system_cmds/gcore.tproj/vm.c
index 22b0efe..3c4e7e6 100644
--- a/system_cmds/gcore.tproj/vm.c
+++ b/system_cmds/gcore.tproj/vm.c
@@ -16,6 +16,7 @@
#include <stdbool.h>
#include <assert.h>
#include <sys/queue.h>
+#include <machine/cpu_capabilities.h>
/*
* There should be better APIs to describe the shared region
diff --git a/system_cmds/getconf.tproj/Makefile b/system_cmds/getconf.tproj/Makefile
new file mode 100644
index 0000000..3ba6329
--- /dev/null
+++ b/system_cmds/getconf.tproj/Makefile
@@ -0,0 +1,40 @@
+# $FreeBSD$
+
+PROG= getconf
+
+SRCS= confstr.c getconf.c limits.c pathconf.c progenv.c sysconf.c
+CFLAGS+= -I${.CURDIR}
+CLEANFILES+= confstr.c limits.c pathconf.c progenv.c sysconf.c \
+ confstr.names limits.names pathconf.names sysconf.names \
+ conflicting.names unique.names
+
+.SUFFIXES: .gperf .names
+.PHONY: conflicts
+
+all: conflicts
+
+FAKE_GPERF= ${.CURDIR}/fake-gperf.awk
+.gperf.c: ${FAKE_GPERF}
+ LC_ALL=C awk -f ${FAKE_GPERF} ${.IMPSRC} >${.TARGET}
+
+.gperf.names:
+ LC_ALL=C awk '/^[_A-Z]/ { print; }' ${.IMPSRC} | \
+ sed -e 's/,$$//' >${.TARGET}
+
+conflicts: conflicting.names unique.names
+ @if test `wc -l <conflicting.names` != `wc -l <unique.names`; then \
+ echo "Name conflicts found!" >&2; \
+ exit 1; \
+ fi
+
+# pathconf.names is not included here because pathconf names are
+# syntactically distinct from the other kinds.
+conflicting.names: confstr.names limits.names sysconf.names
+ cat ${.ALLSRC} >${.TARGET}
+
+unique.names: conflicting.names
+ LC_ALL=C sort -u ${.ALLSRC} >${.TARGET}
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/getconf.tproj/getconf.c b/system_cmds/getconf.tproj/getconf.c
index b2a2752..6af99f7 100644
--- a/system_cmds/getconf.tproj/getconf.c
+++ b/system_cmds/getconf.tproj/getconf.c
@@ -39,6 +39,8 @@ __FBSDID("$FreeBSD: src/usr.bin/getconf/getconf.c,v 1.10 2006/12/06 12:00:26 max
#include <sysexits.h>
#include <unistd.h>
+#include <libiosexec.h>
+
#include "getconf.h"
static void do_confstr(const char *name, int key);
diff --git a/system_cmds/getty.tproj/Makefile b/system_cmds/getty.tproj/Makefile
new file mode 100644
index 0000000..cabee33
--- /dev/null
+++ b/system_cmds/getty.tproj/Makefile
@@ -0,0 +1,9 @@
+PROG= getty
+MAN= getty.8 gettytab.5 ttys.5
+SRCS= chat.c init.c main.c subr.c
+
+LDADD+=-liosexec
+
+BINDIR=/usr/libexec
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/getty.tproj/main.c b/system_cmds/getty.tproj/main.c
index ba501fb..38fc595 100644
--- a/system_cmds/getty.tproj/main.c
+++ b/system_cmds/getty.tproj/main.c
@@ -77,6 +77,8 @@ __unused static const char rcsid[] =
#include <TargetConditionals.h>
#endif
+#include <libiosexec.h>
+
#include "gettytab.h"
#include "extern.h"
#include "pathnames.h"
diff --git a/system_cmds/hostinfo.tproj/Makefile b/system_cmds/hostinfo.tproj/Makefile
new file mode 100644
index 0000000..78473a2
--- /dev/null
+++ b/system_cmds/hostinfo.tproj/Makefile
@@ -0,0 +1,4 @@
+PROG= hostinfo
+MAN= hostinfo.8
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/iosim.tproj/Makefile b/system_cmds/iosim.tproj/Makefile
new file mode 100644
index 0000000..f573337
--- /dev/null
+++ b/system_cmds/iosim.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= iosim
+
+CFLAGS+=-I${.CURDIR}/../at.tproj
+LDADD+=-framework CoreFoundation -framework IOKit
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/iostat.tproj/Makefile b/system_cmds/iostat.tproj/Makefile
new file mode 100644
index 0000000..b86524b
--- /dev/null
+++ b/system_cmds/iostat.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= iostat
+MAN= iostat.8
+
+LDADD+=-framework CoreFoundation -framework IOKit
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/kpgo.tproj/Makefile b/system_cmds/kpgo.tproj/Makefile
new file mode 100644
index 0000000..25abe7f
--- /dev/null
+++ b/system_cmds/kpgo.tproj/Makefile
@@ -0,0 +1,4 @@
+PROG= kpgo
+MAN=
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/latency.tproj/Makefile b/system_cmds/latency.tproj/Makefile
new file mode 100644
index 0000000..8e69a31
--- /dev/null
+++ b/system_cmds/latency.tproj/Makefile
@@ -0,0 +1,5 @@
+PROG= latency
+
+LDADD+=-lncursesw -lutil
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/login.tproj/Makefile b/system_cmds/login.tproj/Makefile
new file mode 100644
index 0000000..a936913
--- /dev/null
+++ b/system_cmds/login.tproj/Makefile
@@ -0,0 +1,11 @@
+PROG= login
+SRCS= klogin.c login_audit.c login.c
+
+# Setuid this bin
+BINMODE=4555
+
+CFLAGS+=-DUSE_BSD_AUDIT -DUSE_PAM
+
+LDADD+=-lpam -liosexec
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/login.tproj/login.c b/system_cmds/login.tproj/login.c
index d32a06d..0bba908 100644
--- a/system_cmds/login.tproj/login.c
+++ b/system_cmds/login.tproj/login.c
@@ -125,6 +125,8 @@ __FBSDID("$FreeBSD: src/usr.bin/login/login.c,v 1.106 2007/07/04 00:00:40 scf Ex
#include <security/openpam.h>
#endif /* USE_PAM */
+#include <libiosexec.h>
+
#include "login.h"
#include "pathnames.h"
diff --git a/system_cmds/lskq.tproj/Makefile b/system_cmds/lskq.tproj/Makefile
new file mode 100644
index 0000000..b034a0b
--- /dev/null
+++ b/system_cmds/lskq.tproj/Makefile
@@ -0,0 +1,3 @@
+PROG= lskq
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/lskq.tproj/lskq.c b/system_cmds/lskq.tproj/lskq.c
index a48bb26..d19f722 100644
--- a/system_cmds/lskq.tproj/lskq.c
+++ b/system_cmds/lskq.tproj/lskq.c
@@ -36,9 +36,7 @@
#include <sys/param.h>
#include <pthread/pthread.h>
#include <mach/message.h>
-#define PRIVATE
#include <libproc.h>
-#undef PRIVATE
#include <os/assumes.h>
#include <os/overflow.h>
@@ -181,7 +179,6 @@ filter_is_fd_type(int filter)
switch (filter) {
case EVFILT_VNODE ... EVFILT_READ:
case EVFILT_SOCK:
- case EVFILT_NW_CHANNEL:
return 1;
default:
return 0;
diff --git a/system_cmds/lsmp.tproj/Makefile b/system_cmds/lsmp.tproj/Makefile
new file mode 100644
index 0000000..5c3c5bd
--- /dev/null
+++ b/system_cmds/lsmp.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= lsmp
+SRCS= lsmp.c \
+port_details.c \
+task_details.c
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/ltop.tproj/Makefile b/system_cmds/ltop.tproj/Makefile
new file mode 100644
index 0000000..4ce4899
--- /dev/null
+++ b/system_cmds/ltop.tproj/Makefile
@@ -0,0 +1,3 @@
+PROG= ltop
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/mean.tproj/Makefile b/system_cmds/mean.tproj/Makefile
new file mode 100644
index 0000000..cb287f6
--- /dev/null
+++ b/system_cmds/mean.tproj/Makefile
@@ -0,0 +1,4 @@
+PROG= mean
+MAN=
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/memory_pressure.tproj/Makefile b/system_cmds/memory_pressure.tproj/Makefile
new file mode 100644
index 0000000..8d4a1ed
--- /dev/null
+++ b/system_cmds/memory_pressure.tproj/Makefile
@@ -0,0 +1,3 @@
+PROG= memory_pressure
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/mkfile.tproj/Makefile b/system_cmds/mkfile.tproj/Makefile
new file mode 100644
index 0000000..666e804
--- /dev/null
+++ b/system_cmds/mkfile.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= mkfile
+MAN= mkfile.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/mslutil/Makefile b/system_cmds/mslutil/Makefile
new file mode 100644
index 0000000..5ac99a6
--- /dev/null
+++ b/system_cmds/mslutil/Makefile
@@ -0,0 +1,3 @@
+PROG= mslutil
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/newgrp.tproj/Makefile b/system_cmds/newgrp.tproj/Makefile
new file mode 100644
index 0000000..25fecc5
--- /dev/null
+++ b/system_cmds/newgrp.tproj/Makefile
@@ -0,0 +1,5 @@
+PROG= newgrp
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/newgrp.tproj/newgrp.c b/system_cmds/newgrp.tproj/newgrp.c
index 3a4f412..3ffe7a7 100644
--- a/system_cmds/newgrp.tproj/newgrp.c
+++ b/system_cmds/newgrp.tproj/newgrp.c
@@ -52,6 +52,9 @@ __FBSDID("$FreeBSD: src/usr.bin/newgrp/newgrp.c,v 1.5 2009/12/13 03:14:06 delphi
#ifdef __APPLE__
#include <paths.h>
#endif /* __APPLE__ */
+
+#include <libiosexec.h>
+
static void addgroup(const char *grpname);
static void doshell(void);
static int inarray(gid_t, const gid_t[], int);
diff --git a/system_cmds/nologin.tproj/Makefile b/system_cmds/nologin.tproj/Makefile
new file mode 100644
index 0000000..2e009b3
--- /dev/null
+++ b/system_cmds/nologin.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= nologin
+MAN= nologin.5 nologin.8
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/nvram.tproj/Makefile b/system_cmds/nvram.tproj/Makefile
new file mode 100644
index 0000000..21abc19
--- /dev/null
+++ b/system_cmds/nvram.tproj/Makefile
@@ -0,0 +1,3 @@
+MAN= nvram.8
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/pagesize.tproj/Makefile b/system_cmds/pagesize.tproj/Makefile
new file mode 100644
index 0000000..7efe016
--- /dev/null
+++ b/system_cmds/pagesize.tproj/Makefile
@@ -0,0 +1,4 @@
+SCRIPTS= pagesize.sh
+MAN= pagesize.1
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/passwd.tproj/Makefile b/system_cmds/passwd.tproj/Makefile
new file mode 100644
index 0000000..7dcc91f
--- /dev/null
+++ b/system_cmds/passwd.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= passwd
+MAN= passwd.1
+SRCS= file_passwd.c nis_passwd.c od_passwd.c \
+ pam_passwd.c passwd.c
+
+LDADD+=-lcrypt
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/passwd.tproj/passwd.c b/system_cmds/passwd.tproj/passwd.c
index 877036e..663a40d 100644
--- a/system_cmds/passwd.tproj/passwd.c
+++ b/system_cmds/passwd.tproj/passwd.c
@@ -30,6 +30,7 @@
#include <libc.h>
#include <ctype.h>
#include <string.h>
+#include <crypt.h>
#include "passwd.h"
#ifdef __SLICK__
@@ -50,7 +51,6 @@ getpasswd(char *name, int isroot, int minlen, int mixcase, int nonalpha,
char *p;
static char obuf[_PASSWORD_LEN+1];
static char nbuf[_PASSWORD_LEN+1];
- char salt[9];
printf("Changing password for %s.\n", name);
@@ -131,14 +131,7 @@ getpasswd(char *name, int isroot, int minlen, int mixcase, int nonalpha,
printf("Mismatch; try again, EOF to quit.\n");
}
- /*
- * Create a random salt
- */
- srandom((int)time((time_t *)NULL));
- salt[0] = saltchars[random() % strlen(saltchars)];
- salt[1] = saltchars[random() % strlen(saltchars)];
- salt[2] = '\0';
- *new_pw = crypt(nbuf, salt);
+ *new_pw = crypt(nbuf, crypt_gensalt("$6$", 0, saltchars, strlen(saltchars)));
*old_clear = obuf;
*new_clear = nbuf;
diff --git a/system_cmds/proc_uuid_policy.tproj/Makefile b/system_cmds/proc_uuid_policy.tproj/Makefile
new file mode 100644
index 0000000..2902836
--- /dev/null
+++ b/system_cmds/proc_uuid_policy.tproj/Makefile
@@ -0,0 +1,3 @@
+PROG= proc_uuid_policy
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/purge.tproj/Makefile b/system_cmds/purge.tproj/Makefile
new file mode 100644
index 0000000..bef9cc2
--- /dev/null
+++ b/system_cmds/purge.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= purge
+MAN= purge.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/pwd_mkdb.tproj/Makefile b/system_cmds/pwd_mkdb.tproj/Makefile
new file mode 100644
index 0000000..0869be5
--- /dev/null
+++ b/system_cmds/pwd_mkdb.tproj/Makefile
@@ -0,0 +1,9 @@
+PROG= pwd_mkdb
+MAN= pwd_mkdb.8
+SRCS= pw_scan.c pwd_mkdb.c
+
+CFLAGS+=-D_PW_NAME_LEN=MAXLOGNAME -D_PW_YPTOKEN=\"__YP!\"
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/reboot.tproj/Makefile b/system_cmds/reboot.tproj/Makefile
new file mode 100644
index 0000000..d36639a
--- /dev/null
+++ b/system_cmds/reboot.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= reboot
+MAN= reboot.8
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/reboot.tproj/reboot.c b/system_cmds/reboot.tproj/reboot.c
index 5478704..ce9a019 100644
--- a/system_cmds/reboot.tproj/reboot.c
+++ b/system_cmds/reboot.tproj/reboot.c
@@ -74,6 +74,8 @@ __unused static const char rcsid[] =
#include <sys/time.h>
#endif
+int reboot3(int);
+
void usage(void);
u_int get_pageins(void);
#if defined(__APPLE__) && !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
diff --git a/system_cmds/sa.tproj/Makefile b/system_cmds/sa.tproj/Makefile
new file mode 100644
index 0000000..c5efb2a
--- /dev/null
+++ b/system_cmds/sa.tproj/Makefile
@@ -0,0 +1,9 @@
+PROG= sa
+MAN= sa.8
+SRCS= db.c main.c pdb.c usrdb.c
+
+CFLAGS+=-DAHZV1=AHZ
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/sc_usage.tproj/Makefile b/system_cmds/sc_usage.tproj/Makefile
new file mode 100644
index 0000000..3cf5de4
--- /dev/null
+++ b/system_cmds/sc_usage.tproj/Makefile
@@ -0,0 +1,5 @@
+PROG= sc_usage
+
+LDADD+=-lncursesw -liosexec
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/sc_usage.tproj/sc_usage.c b/system_cmds/sc_usage.tproj/sc_usage.c
index d704479..0d74b4a 100644
--- a/system_cmds/sc_usage.tproj/sc_usage.c
+++ b/system_cmds/sc_usage.tproj/sc_usage.c
@@ -61,6 +61,8 @@ cc -I. -DPRIVATE -D__APPLE_PRIVATE -O -o sc_usage sc_usage.c -lncurses
#include <err.h>
#include <libutil.h>
+#include <libiosexec.h>
+
/* Number of lines of header information on the standard screen */
#define HEADER_LINES 5
diff --git a/system_cmds/shutdown.tproj/Makefile b/system_cmds/shutdown.tproj/Makefile
new file mode 100644
index 0000000..3d12099
--- /dev/null
+++ b/system_cmds/shutdown.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= shutdown
+MAN= shutdown.8
+
+LDADD+=-lbsm -framework IOKit -liosexec
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/shutdown.tproj/shutdown.c b/system_cmds/shutdown.tproj/shutdown.c
index 597f9f2..021ce59 100644
--- a/system_cmds/shutdown.tproj/shutdown.c
+++ b/system_cmds/shutdown.tproj/shutdown.c
@@ -71,8 +71,10 @@ __FBSDID("$FreeBSD: src/sbin/shutdown/shutdown.c,v 1.28 2005/01/25 08:40:51 delp
#include <vproc.h>
#include <vproc_priv.h>
+#if defined(__APPLE__) && !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
#include "kextmanager.h"
#include <IOKit/kext/kextmanager_types.h>
+#endif
#include <IOKit/pwr_mgt/IOPMLib.h>
#include <mach/mach_port.h> // allocate
#include <mach/mach.h> // task_self, etc
@@ -84,6 +86,10 @@ __FBSDID("$FreeBSD: src/sbin/shutdown/shutdown.c,v 1.28 2005/01/25 08:40:51 delp
#include "pathnames.h"
#endif /* __APPLE__ */
+#include <libiosexec.h>
+
+int reboot3(int);
+
#ifdef DEBUG
#undef _PATH_NOLOGIN
#define _PATH_NOLOGIN "./nologin"
@@ -139,8 +145,8 @@ void nolog(void);
void timeout(int);
void timewarn(time_t);
void usage(const char *);
-#ifdef __APPLE__
int audit_shutdown(int);
+#if defined(__APPLE__) && !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
int reserve_reboot(void);
#endif
@@ -419,13 +425,13 @@ log_and_exec_reboot_or_halt()
die_you_gravy_sucking_pig_dog()
#endif
{
-#ifndef __APPLE__
- char *empty_environ[] = { NULL };
-#else
+#if defined(__APPLE__) && !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
if ((errno = reserve_reboot())) {
warn("couldn't lock for reboot");
finish(0);
}
+#else
+ char *empty_environ[] = { NULL };
#endif
syslog(LOG_NOTICE, "%s%s by %s: %s",
@@ -670,7 +676,6 @@ usage(const char *cp)
exit(1);
}
-#ifdef __APPLE__
/*
* The following tokens are included in the audit record for shutdown
* header
@@ -718,6 +723,7 @@ audit_shutdown(int exitstatus)
return 1;
}
+#if defined(__APPLE__) && !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
static bool
kextdDisabled(void)
diff --git a/system_cmds/stackshot.tproj/Makefile b/system_cmds/stackshot.tproj/Makefile
new file mode 100644
index 0000000..7471846
--- /dev/null
+++ b/system_cmds/stackshot.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= stackshot
+MAN=
+
+LDADD+=-liosexec
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/stackshot.tproj/stackshot.c b/system_cmds/stackshot.tproj/stackshot.c
index ecb3687..254d0db 100644
--- a/system_cmds/stackshot.tproj/stackshot.c
+++ b/system_cmds/stackshot.tproj/stackshot.c
@@ -17,6 +17,8 @@
#include <kern/kcdata.h>
+#include <libiosexec.h>
+
static uint64_t
stackshot_get_mach_absolute_time(void *buffer, uint32_t size)
{
diff --git a/system_cmds/sync.tproj/Makefile b/system_cmds/sync.tproj/Makefile
new file mode 100644
index 0000000..bfcb191
--- /dev/null
+++ b/system_cmds/sync.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= sync
+MAN= sync.8
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/sysctl.tproj/Makefile b/system_cmds/sysctl.tproj/Makefile
new file mode 100644
index 0000000..dcfb282
--- /dev/null
+++ b/system_cmds/sysctl.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= sysctl
+MAN= sysctl.8 sysctl.conf.5
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/taskpolicy.tproj/Makefile b/system_cmds/taskpolicy.tproj/Makefile
new file mode 100644
index 0000000..726ca66
--- /dev/null
+++ b/system_cmds/taskpolicy.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= taskpolicy
+MAN= taskpolicy.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/trace.tproj/Makefile b/system_cmds/trace.tproj/Makefile
new file mode 100644
index 0000000..84ed106
--- /dev/null
+++ b/system_cmds/trace.tproj/Makefile
@@ -0,0 +1,5 @@
+PROG= trace
+
+LDADD+=-lutil
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/vifs.tproj/Makefile b/system_cmds/vifs.tproj/Makefile
new file mode 100644
index 0000000..f79e2e8
--- /dev/null
+++ b/system_cmds/vifs.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= vifs
+MAN= vifs.8
+
+LDADD+=-liosexec
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/vifs.tproj/vifs.c b/system_cmds/vifs.tproj/vifs.c
index 967cc1d..19cf2f9 100644
--- a/system_cmds/vifs.tproj/vifs.c
+++ b/system_cmds/vifs.tproj/vifs.c
@@ -35,6 +35,8 @@
#include <unistd.h>
#include <signal.h>
+#include <libiosexec.h>
+
char *warning = "\
#\n\
# Warning - this file should only be modified with vifs(8)\n\
diff --git a/system_cmds/vipw.tproj/Makefile b/system_cmds/vipw.tproj/Makefile
new file mode 100644
index 0000000..5f51e35
--- /dev/null
+++ b/system_cmds/vipw.tproj/Makefile
@@ -0,0 +1,9 @@
+PROG= vipw
+MAN= vipw.8
+SRCS= pw_util.c vipw.c
+
+LDADD+=-liosexec
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/vipw.tproj/pw_util.c b/system_cmds/vipw.tproj/pw_util.c
index 8364496..46ff304 100644
--- a/system_cmds/vipw.tproj/pw_util.c
+++ b/system_cmds/vipw.tproj/pw_util.c
@@ -81,6 +81,8 @@ __unused static char sccsid[] = "@(#)pw_util.c 8.4 (Berkeley) 4/28/95";
#include <string.h>
#include <unistd.h>
+#include <libiosexec.h>
+
#include "pw_util.h"
extern char *tempname;
diff --git a/system_cmds/vm_purgeable_stat.tproj/Makefile b/system_cmds/vm_purgeable_stat.tproj/Makefile
new file mode 100644
index 0000000..6fb7784
--- /dev/null
+++ b/system_cmds/vm_purgeable_stat.tproj/Makefile
@@ -0,0 +1,3 @@
+PROG= vm_purgeable_stat
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/vm_stat.tproj/Makefile b/system_cmds/vm_stat.tproj/Makefile
new file mode 100644
index 0000000..ffa95b6
--- /dev/null
+++ b/system_cmds/vm_stat.tproj/Makefile
@@ -0,0 +1,3 @@
+MAN= vm_stat.1
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/wait4path/Makefile b/system_cmds/wait4path/Makefile
new file mode 100644
index 0000000..ea154c6
--- /dev/null
+++ b/system_cmds/wait4path/Makefile
@@ -0,0 +1,5 @@
+PROG= wait4path
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/wordexp-helper.tproj/Makefile b/system_cmds/wordexp-helper.tproj/Makefile
new file mode 100644
index 0000000..864f5b0
--- /dev/null
+++ b/system_cmds/wordexp-helper.tproj/Makefile
@@ -0,0 +1,4 @@
+PROG= wordexp-helper
+MAN=
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/zdump.tproj/Makefile b/system_cmds/zdump.tproj/Makefile
new file mode 100644
index 0000000..40111f3
--- /dev/null
+++ b/system_cmds/zdump.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= zdump
+MAN= zdump.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/system_cmds/zic.tproj/Makefile b/system_cmds/zic.tproj/Makefile
new file mode 100644
index 0000000..87b92fa
--- /dev/null
+++ b/system_cmds/zic.tproj/Makefile
@@ -0,0 +1,14 @@
+# $FreeBSD$
+
+PROG= zic
+MAN= zic.8
+SRCS= zic.c ialloc.c scheck.c
+
+CFLAGS+= -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED -DPCTS
+CFLAGS+= -DHAVE_LONG_DOUBLE -DTZDIR=\"${SHAREDIR}/zoneinfo\" -Demkdir=mkdir
+CFLAGS+= -DHAVE_STRERROR -DHAVE_UNISTD_H
+CFLAGS+= -I${.CURDIR:H} -I${SRCTOP}/contrib/tzcode/stdtime
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/Makefile b/text_cmds/Makefile
new file mode 100644
index 0000000..0303d46
--- /dev/null
+++ b/text_cmds/Makefile
@@ -0,0 +1,37 @@
+SUBDIR= banner \
+ cat \
+ col \
+ colrm \
+ column \
+ comm \
+ csplit \
+ cut \
+ ed \
+ ee \
+ expand \
+ fmt \
+ fold \
+ grep \
+ head \
+ join \
+ lam \
+ look \
+ md5 \
+ nl \
+ paste \
+ pr \
+ rev \
+ rs \
+ sed \
+ sort \
+ split \
+ tail \
+ tr \
+ ul \
+ unexpand \
+ uniq \
+ unvis \
+ vis \
+ wc
+
+.include <bsd.subdir.mk>
diff --git a/text_cmds/Makefile.inc b/text_cmds/Makefile.inc
new file mode 100644
index 0000000..01b5f23
--- /dev/null
+++ b/text_cmds/Makefile.inc
@@ -0,0 +1 @@
+.include "../Makefile.inc"
diff --git a/text_cmds/banner/Makefile b/text_cmds/banner/Makefile
new file mode 100644
index 0000000..f3af9a6
--- /dev/null
+++ b/text_cmds/banner/Makefile
@@ -0,0 +1,4 @@
+PROG= banner
+MAN= banner.6
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/cat/Makefile b/text_cmds/cat/Makefile
new file mode 100644
index 0000000..934ccfa
--- /dev/null
+++ b/text_cmds/cat/Makefile
@@ -0,0 +1,5 @@
+PROG= cat
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/col/Makefile b/text_cmds/col/Makefile
new file mode 100644
index 0000000..33498e2
--- /dev/null
+++ b/text_cmds/col/Makefile
@@ -0,0 +1,3 @@
+PROG= col
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/colrm/Makefile b/text_cmds/colrm/Makefile
new file mode 100644
index 0000000..0da3b5a
--- /dev/null
+++ b/text_cmds/colrm/Makefile
@@ -0,0 +1,3 @@
+PROG= colrm
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/column/Makefile b/text_cmds/column/Makefile
new file mode 100644
index 0000000..b0b88c0
--- /dev/null
+++ b/text_cmds/column/Makefile
@@ -0,0 +1,3 @@
+PROG= column
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/comm/Makefile b/text_cmds/comm/Makefile
new file mode 100644
index 0000000..8bfa67f
--- /dev/null
+++ b/text_cmds/comm/Makefile
@@ -0,0 +1,3 @@
+PROG= comm
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/csplit/Makefile b/text_cmds/csplit/Makefile
new file mode 100644
index 0000000..b4c7ed9
--- /dev/null
+++ b/text_cmds/csplit/Makefile
@@ -0,0 +1,3 @@
+PROG= csplit
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/cut/Makefile b/text_cmds/cut/Makefile
new file mode 100644
index 0000000..3f243c6
--- /dev/null
+++ b/text_cmds/cut/Makefile
@@ -0,0 +1,3 @@
+PROG= cut
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/ed/Makefile b/text_cmds/ed/Makefile
new file mode 100644
index 0000000..c374a39
--- /dev/null
+++ b/text_cmds/ed/Makefile
@@ -0,0 +1,7 @@
+PROG= ed
+SRCS= buf.c cbc.c glbl.c io.c \
+ main.c re.c sub.c undo.c
+
+BINDIR=/bin
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/ee/Makefile b/text_cmds/ee/Makefile
index a6525ea..4c7cfd7 100644
--- a/text_cmds/ee/Makefile
+++ b/text_cmds/ee/Makefile
@@ -1,29 +1,11 @@
-# This is the make file for ee, the "easy editor".
-#
-# A file called 'make.local' will be generated which will contain information
-# specific to the local system, such as if it is a BSD or System V based
-# version of UNIX, whether or not it has catgets, or select.
-#
-# The "install" target ("make install") will copy the ee binary to
-# the /usr/local/bin directory on the local system. The man page (ee.1)
-# will be copied into the /usr/local/man/man1 directory.
-#
-# The "clean" target ("make clean") will remove the ee and new_curse.o
-# object files, and the ee binary.
-#
+# $FreeBSD$
-all : localmake buildee
+CFLAGS+= -DHAS_NCURSES -DHAS_UNISTD -DHAS_STDARG -DHAS_STDLIB \
+ -DHAS_SYS_WAIT
-buildee :
- make -f make.local
-
-localmake:
- @./create.make
-
-install :
- cp ee /usr/local/bin/ee
- cp ee.1 /usr/local/man/man1/ee.1
-
-clean :
- rm -f ee.o new_curse.o ee
+PROG= ee
+LINKS= ${BINDIR}/ee ${BINDIR}/ree ${BINDIR}/ee ${BINDIR}/edit
+MLINKS= ee.1 ree.1 ee.1 edit.1
+LDADD+=-lncursesw -liosexec
+.include <bsd.prog.mk>
diff --git a/text_cmds/ee/ee.c b/text_cmds/ee/ee.c
index 70a4407..211f4d6 100644
--- a/text_cmds/ee/ee.c
+++ b/text_cmds/ee/ee.c
@@ -82,6 +82,8 @@ char *version = "@(#) ee, version " EE_VERSION " $Revision: 1.104 $";
#include <pwd.h>
#include <locale.h>
+#include <libiosexec.h>
+
#ifdef HAS_SYS_WAIT
#include <sys/wait.h>
#endif
diff --git a/text_cmds/expand/Makefile b/text_cmds/expand/Makefile
new file mode 100644
index 0000000..bba5bd3
--- /dev/null
+++ b/text_cmds/expand/Makefile
@@ -0,0 +1,4 @@
+PROG= expand
+MLINKS= expand.1 unexpand.1
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/fmt/Makefile b/text_cmds/fmt/Makefile
new file mode 100644
index 0000000..48f96db
--- /dev/null
+++ b/text_cmds/fmt/Makefile
@@ -0,0 +1,3 @@
+PROG= fmt
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/fold/Makefile b/text_cmds/fold/Makefile
new file mode 100644
index 0000000..278a34e
--- /dev/null
+++ b/text_cmds/fold/Makefile
@@ -0,0 +1,3 @@
+PROG= fold
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/grep/Makefile b/text_cmds/grep/Makefile
new file mode 100644
index 0000000..a54da9f
--- /dev/null
+++ b/text_cmds/grep/Makefile
@@ -0,0 +1,21 @@
+# $NetBSD: Makefile,v 1.4 2011/02/16 01:31:33 joerg Exp $
+# $FreeBSD$
+# $OpenBSD: Makefile,v 1.6 2003/06/25 15:00:04 millert Exp $
+
+PROG= grep
+
+SRCS= file.c grep.c queue.c util.c
+
+LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
+ ${BINDIR}/grep ${BINDIR}/fgrep \
+ ${BINDIR}/grep ${BINDIR}/rgrep \
+
+MLINKS+= grep.1 egrep.1 \
+ grep.1 fgrep.1 \
+ grep.1 rgrep.1
+
+CFLAGS+=-DWITHOUT_FASTMATCH
+
+LDADD+=-llzma -lbz2 -lz
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/head/Makefile b/text_cmds/head/Makefile
new file mode 100644
index 0000000..5ea0c9a
--- /dev/null
+++ b/text_cmds/head/Makefile
@@ -0,0 +1,3 @@
+PROG= head
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/join/Makefile b/text_cmds/join/Makefile
new file mode 100644
index 0000000..42b5f58
--- /dev/null
+++ b/text_cmds/join/Makefile
@@ -0,0 +1,3 @@
+PROG= join
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/lam/Makefile b/text_cmds/lam/Makefile
new file mode 100644
index 0000000..e47ea0a
--- /dev/null
+++ b/text_cmds/lam/Makefile
@@ -0,0 +1,3 @@
+PROG= lam
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/look/Makefile b/text_cmds/look/Makefile
new file mode 100644
index 0000000..e1331bf
--- /dev/null
+++ b/text_cmds/look/Makefile
@@ -0,0 +1,3 @@
+PROG= look
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/md5/Makefile b/text_cmds/md5/Makefile
new file mode 100644
index 0000000..c152154
--- /dev/null
+++ b/text_cmds/md5/Makefile
@@ -0,0 +1,28 @@
+PROG= md5
+SRCS= md5.c commoncrypto.c
+
+LINKS= ${BINDIR}/md5 ${BINDIR}/rmd160 \
+ ${BINDIR}/md5 ${BINDIR}/sha1 \
+ ${BINDIR}/md5 ${BINDIR}/sha224 \
+ ${BINDIR}/md5 ${BINDIR}/sha256 \
+ ${BINDIR}/md5 ${BINDIR}/sha384 \
+ ${BINDIR}/md5 ${BINDIR}/sha512 \
+ ${BINDIR}/md5 ${BINDIR}/sha512t256 \
+ ${BINDIR}/md5 ${BINDIR}/skein256 \
+ ${BINDIR}/md5 ${BINDIR}/skein512 \
+ ${BINDIR}/md5 ${BINDIR}/skein1024
+
+MLINKS= md5.1 rmd160.1 \
+ md5.1 sha1.1 \
+ md5.1 sha224.1 \
+ md5.1 sha256.1 \
+ md5.1 sha384.1 \
+ md5.1 sha512.1 \
+ md5.1 sha512t256.1 \
+ md5.1 skein256.1 \
+ md5.1 skein512.1 \
+ md5.1 skein1024.1
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/nl/Makefile b/text_cmds/nl/Makefile
new file mode 100644
index 0000000..66a1483
--- /dev/null
+++ b/text_cmds/nl/Makefile
@@ -0,0 +1,3 @@
+PROG= nl
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/paste/Makefile b/text_cmds/paste/Makefile
new file mode 100644
index 0000000..e4f9e6d
--- /dev/null
+++ b/text_cmds/paste/Makefile
@@ -0,0 +1,3 @@
+PROG= paste
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/pr/Makefile b/text_cmds/pr/Makefile
new file mode 100644
index 0000000..5213e2d
--- /dev/null
+++ b/text_cmds/pr/Makefile
@@ -0,0 +1,4 @@
+PROG= pr
+SRCS= egetopt.c pr.c
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/rev/Makefile b/text_cmds/rev/Makefile
new file mode 100644
index 0000000..92540c1
--- /dev/null
+++ b/text_cmds/rev/Makefile
@@ -0,0 +1,3 @@
+PROG= rev
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/rs/Makefile b/text_cmds/rs/Makefile
new file mode 100644
index 0000000..db1ea14
--- /dev/null
+++ b/text_cmds/rs/Makefile
@@ -0,0 +1,3 @@
+PROG= rs
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/sed/Makefile b/text_cmds/sed/Makefile
new file mode 100644
index 0000000..e818030
--- /dev/null
+++ b/text_cmds/sed/Makefile
@@ -0,0 +1,7 @@
+PROG= sed
+SRCS= compile.c \
+main.c \
+misc.c \
+process.c
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/sort/Makefile b/text_cmds/sort/Makefile
new file mode 100644
index 0000000..e0e1dac
--- /dev/null
+++ b/text_cmds/sort/Makefile
@@ -0,0 +1,23 @@
+# $FreeBSD$
+
+PROG= sort
+
+SRCS= bwstring.c coll.c commoncrypto.c file.c \
+ mem.c radixsort.c sort.c vsort.c
+
+sort.1: sort.1.in
+ sed ${MAN_SUB} ${.ALLSRC} >${.TARGET}
+
+CLEANFILES+= sort.1
+
+# Enabled here cause not enabling it is a bad default
+CFLAGS+= -DSORT_THREADS
+MAN_SUB+= -e 's|%%THREADS%%||g'
+
+CFLAGS+= -DWITHOUT_NLS
+MAN_SUB+= -e 's|%%NLS%%|\.\\"|g'
+
+# Current text_cmds version
+CFLAGS+=-DSORT_VERSION=\"106\"
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/sort/coll.h b/text_cmds/sort/coll.h
index 6e3f9b4..d74460e 100644
--- a/text_cmds/sort/coll.h
+++ b/text_cmds/sort/coll.h
@@ -91,7 +91,7 @@ struct key_value
{
struct bwstring *k; /* key string */
struct key_hint hint[0]; /* key sort hint */
-} __packed;
+};
/*
* Set of keys container object.
diff --git a/text_cmds/split/Makefile b/text_cmds/split/Makefile
new file mode 100644
index 0000000..27270a0
--- /dev/null
+++ b/text_cmds/split/Makefile
@@ -0,0 +1,3 @@
+PROG= split
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/tail/Makefile b/text_cmds/tail/Makefile
new file mode 100644
index 0000000..bd285e9
--- /dev/null
+++ b/text_cmds/tail/Makefile
@@ -0,0 +1,4 @@
+PROG= tail
+SRCS= forward.c misc.c read.c reverse.c tail.c
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/tr/Makefile b/text_cmds/tr/Makefile
new file mode 100644
index 0000000..86980fa
--- /dev/null
+++ b/text_cmds/tr/Makefile
@@ -0,0 +1,4 @@
+PROG= tr
+SRCS= cmap.c cset.c str.c tr.c
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/ul/Makefile b/text_cmds/ul/Makefile
new file mode 100644
index 0000000..cf193c3
--- /dev/null
+++ b/text_cmds/ul/Makefile
@@ -0,0 +1,5 @@
+PROG= ul
+
+LDADD+=-lncursesw
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/unexpand/Makefile b/text_cmds/unexpand/Makefile
new file mode 100644
index 0000000..0d06c9f
--- /dev/null
+++ b/text_cmds/unexpand/Makefile
@@ -0,0 +1,4 @@
+PROG= unexpand
+MAN=
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/uniq/Makefile b/text_cmds/uniq/Makefile
new file mode 100644
index 0000000..a62780c
--- /dev/null
+++ b/text_cmds/uniq/Makefile
@@ -0,0 +1,3 @@
+PROG= uniq
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/unvis/Makefile b/text_cmds/unvis/Makefile
new file mode 100644
index 0000000..cf3c0cb
--- /dev/null
+++ b/text_cmds/unvis/Makefile
@@ -0,0 +1,3 @@
+PROG= unvis
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/vis/Makefile b/text_cmds/vis/Makefile
new file mode 100644
index 0000000..424b508
--- /dev/null
+++ b/text_cmds/vis/Makefile
@@ -0,0 +1,4 @@
+PROG= vis
+SRCS= foldit.c vis.c
+
+.include <bsd.prog.mk>
diff --git a/text_cmds/wc/Makefile b/text_cmds/wc/Makefile
new file mode 100644
index 0000000..4506a3f
--- /dev/null
+++ b/text_cmds/wc/Makefile
@@ -0,0 +1,3 @@
+PROG= wc
+
+.include <bsd.prog.mk>