]> Zhao Yanbai Git Server - minix.git/commitdiff
Include directory reorg and makefile updates.
authorArun Thomas <arun@minix3.org>
Mon, 8 Mar 2010 11:04:59 +0000 (11:04 +0000)
committerArun Thomas <arun@minix3.org>
Mon, 8 Mar 2010 11:04:59 +0000 (11:04 +0000)
-Convert the include directory over to using bsdmake
 syntax
-Update/add mkfiles
-Modify install(1) so that it can create symlinks
-Update makefiles to use new install(1) options
-Rename /usr/include/ibm to /usr/include/i386
-Create /usr/include/machine symlink to arch header files
-Move vm_i386.h to its new home in the /usr/include/i386
-Update source files to #include the header files at their
 new homes.
-Add new gnu-includes target for building GCC headers

90 files changed:
Makefile
boot/boot.c
boot/bootimage.c
commands/aal/Makefile
commands/ash/Makefile
commands/cawf/Makefile
commands/elvis/Makefile
commands/i386/Makefile
commands/ibm/Makefile
commands/ibm/atnormalize.c
commands/ibm/autopart.c
commands/ibm/fdisk.c
commands/ibm/format.c
commands/ibm/part.c
commands/ibm/partition.c
commands/ibm/repartition.c
commands/reboot/Makefile
commands/scripts/Makefile
commands/sh/Makefile
commands/simple/Makefile
commands/simple/devsize.c
commands/simple/install.c
commands/simple/writeisofs.c
commands/urlget/Makefile
commands/yap/Makefile
docs/UPDATING
drivers/amddev/amddev.c
drivers/at_wini/at_wini.c
drivers/atl2/atl2.c
drivers/audio/es1370/es1370.c
drivers/audio/es1371/es1371.c
drivers/bios_wini/bios_wini.c
drivers/dec21140A/dec21140A.c
drivers/dp8390/dp8390.c
drivers/dp8390/rtl8029.c
drivers/dpeth/dp.h
drivers/drivers.h
drivers/e1000/e1000.c
drivers/e1000/e1000.h
drivers/floppy/floppy.c
drivers/fxp/fxp.c
drivers/lance/lance.c
drivers/libdriver/drvlib.h
drivers/memory/memory.c
drivers/orinoco/orinoco.c
drivers/pci/pci.c
drivers/readclock/readclock.c
drivers/rtl8139/rtl8139.h
drivers/rtl8169/rtl8169.c
drivers/ti1225/ti1225.c
etc/mk/minix.inc.mk [new file with mode: 0644]
etc/mk/minix.kinc.mk [new file with mode: 0644]
etc/mk/minix.klinks.mk [new file with mode: 0644]
etc/mk/minix.own.mk
etc/mk/minix.prog.mk
etc/mtree/minix.tree
include/Makefile
include/arch/Makefile [new file with mode: 0644]
include/arch/i386/Makefile [new file with mode: 0644]
include/arch/i386/bios.h [moved from include/ibm/bios.h with 100% similarity]
include/arch/i386/cmos.h [moved from include/ibm/cmos.h with 100% similarity]
include/arch/i386/cpu.h [moved from include/ibm/cpu.h with 100% similarity]
include/arch/i386/diskparm.h [moved from include/ibm/diskparm.h with 100% similarity]
include/arch/i386/int86.h [moved from include/ibm/int86.h with 100% similarity]
include/arch/i386/interrupt.h [moved from include/ibm/interrupt.h with 100% similarity]
include/arch/i386/memory.h [moved from include/ibm/memory.h with 100% similarity]
include/arch/i386/partition.h [moved from include/ibm/partition.h with 100% similarity]
include/arch/i386/pci.h [moved from include/ibm/pci.h with 100% similarity]
include/arch/i386/ports.h [moved from include/ibm/ports.h with 100% similarity]
include/arch/i386/vm.h [moved from include/sys/vm_i386.h with 99% similarity]
include/minix/type.h
include/sys/Makefile [new file with mode: 0644]
kernel/arch/i386/clock.c
kernel/arch/i386/do_int86.c
kernel/arch/i386/i8259.c
kernel/arch/i386/include/archconst.h
kernel/arch/i386/klib386.S
kernel/arch/i386/memory.c
kernel/arch/i386/mpx386.S
kernel/arch/i386/system.c
kernel/system/do_sigreturn.c
kernel/type.h
lib/csu/i386/crtso.S
lib/libc/arch/i386/misc/_cpufeature.c
man/man1/install.1
servers/ipc/inc.h
servers/is/dmp_kernel.c
servers/vm/i386/memory.h
servers/vm/i386/pagefaults.h
servers/vm/i386/pagetable.h

index 3f4ed1a12753acb2be9e31c69555b53762e11882..f129f1375481f1210b16df47b5d646de880efded 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,13 +8,15 @@ usage:
        @echo "Root privileges are required for some actions." 
        @echo "" 
        @echo "Usage:" 
-       @echo " make world      # Compile everything (libraries & commands)" 
-       @echo " make includes   # Install include files from src/" 
-       @echo " make libraries  # Compile and install libraries" 
-       @echo " make commands   # Compile all, commands, but don't install"
-       @echo " make install    # Compile and install commands" 
-       @echo " make depend     # Generate required .depend files" 
-       @echo " make clean      # Remove all compiler results" 
+       @echo " make world         # Compile everything (libraries & commands)"
+       @echo " make includes      # Install include files from src/"
+       @echo " make libraries     # Compile and install libraries"
+       @echo " make commands      # Compile all, commands, but don't install"
+       @echo " make install       # Compile and install commands"
+       @echo " make depend        # Generate required .depend files"
+       @echo " make gnu-includes  # Install include files for GCC"
+       @echo " make gnu-libraries # Compile and install libraries for GCC"
+       @echo " make clean         # Remove all compiler results"
        @echo "" 
        @echo "Run 'make' in tools/ to create a new MINIX configuration." 
        @echo "" 
@@ -33,11 +35,15 @@ mkfiles:
        cp etc/mk/*.mk /etc/mk/
 
 includes:
-       cd include && $(MAKE) install gcc
+       cd include && $(MAKE) includes
 
 libraries:
        cd lib && sh ack_build.sh obj depend all install
 
+MKHEADERS411=/usr/gnu/libexec/gcc/i386-pc-minix/4.1.1/install-tools/mkheaders
+gnu-includes: includes
+       SHELL=/bin/sh; if [ -f $(MKHEADERS411) ] ; then sh -e $(MKHEADERS411) ; fi
+
 gnu-libraries:
        cd lib && sh gnu_build.sh obj depend all install
 
index d86e8ca356b07add2df4dcaf52918051d11db6fa..3b3497eeaf8a076357b21f711df6fd88ea01f7d8 100644 (file)
@@ -17,8 +17,8 @@ char version[]=               "2.20";
 #include <limits.h>
 #include <string.h>
 #include <errno.h>
-#include <ibm/partition.h>
-#include <ibm/bios.h>
+#include <machine/partition.h>
+#include <machine/bios.h>
 #include <minix/config.h>
 #include <minix/type.h>
 #include <minix/dmap.h>
index 4562d8ffa208c3341f0db5ea3ccf6c904f9a0f5a..250cfd6df5c26f288b796e44a109e2d4b9dea4ba 100644 (file)
@@ -22,7 +22,7 @@
 #include <sys/video.h>
 #include <kernel/const.h>
 #include <kernel/type.h>
-#include <ibm/partition.h>
+#include <machine/partition.h>
 #include "rawfs.h"
 #include "image.h"
 #include "boot.h"
index a432ddd5c9de9a0574318e5f114abf74bfc9ac9d..0931a021c7fb8f9f0b1e33b9ac6e3ca86cbecde0 100644 (file)
@@ -33,7 +33,7 @@ install:      /usr/bin/aal /usr/bin/ar
        install -cs -o bin aal $@
 
 /usr/bin/ar:   /usr/bin/aal
-       install -l $? $@
+       install -l $? $@
 
 archiver.o:
 print.o:
index f77087641f10424216fc76a6f6cd8b5d36aa9513..71768f9f7f493f87724351593e369c84ac0db0f8 100644 (file)
@@ -58,13 +58,13 @@ install:    /usr/bin/ash /usr/bin/sh /bin/sh /bin/bigsh
        install -cs -o bin $> $@
 
 /usr/bin/sh:   /usr/bin/ash
-       install -l $> $@
+       install -l $> $@
 
 /bin/sh:       /usr/bin/ash
-       install -lcs $> $@
+       install -l h -cs $> $@
 
 /bin/bigsh:    /usr/bin/ash
-       install -S 6600k -lcs $> $@
+       install -S 6600k -l h -cs $> $@
 
 clean:
        rm -f $(CLEANFILES) sh core
index cf7bd9343d9ed87ce43b607991d5d4e10a93b29d..02ef6bcdf3408117786b8f346f761176ce1daa22 100644 (file)
@@ -74,13 +74,13 @@ install:    \
        install -cs -o bin bsfilt $@
 
 /usr/bin/colcrt:       /usr/bin/bsfilt
-       install -l /usr/bin/bsfilt $@
+       install -l /usr/bin/bsfilt $@
 
 /usr/bin/cawf: cawf
        install -cs -o bin cawf $@
 
 /usr/bin/nroff:        /usr/bin/cawf
-       install -l /usr/bin/cawf $@
+       install -l /usr/bin/cawf $@
 
 /usr/lib/cawf: 
        install -d -o bin /usr/lib/cawf
index a0118c2ccfaf48b729b7209330f0a219d8b43cc5..602d327c8257b6ff34dd7637b016009d12620f2e 100644 (file)
@@ -73,7 +73,7 @@ install:      /usr/bin/elvis \
 
 /usr/bin/vi:   /usr/bin/elvis
        if [ ! -x $@ ]; \
-       then    install -l $? $@ ;      \
+       then    install -l h $? $@ ;    \
        fi
 
 /usr/bin/ctags:        ctags
index a391d88691c06f7fa2f67c1dad5b9861be18e273..39020233f57bfdd88374da1da66b4955f65b3fd5 100644 (file)
@@ -18,7 +18,7 @@ install::     /usr/bin/acd /usr/bin/cc /usr/bin/m2 /usr/bin/pc \
        install -cs -o bin $? $@
 
 /usr/bin/cc /usr/bin/m2 /usr/bin/pc:   /usr/bin/acd
-       install -l $? $@
+       install -l $? $@
 
 /usr/lib/descr:        acd.descr
        install $? $@
index 26f9b10a98f66ff56f30c48ff5935c5700de2d21..c873d75962eff036a46f652b0cfecabb00c015f6 100644 (file)
@@ -117,7 +117,7 @@ install:    \
        install -cs -o bin $? $@
 
 /usr/bin/dosdir /usr/bin/doswrite:     /usr/bin/dosread
-       install -l $? $@
+       install -l $? $@
 
 /usr/bin/fdisk:        fdisk
        install -cs -o bin $? $@
@@ -135,7 +135,7 @@ install:    \
        install -cs -o bin $? $@
 
 /usr/bin/autopart:     autopart
-       install -lcs $? $@
+       install -l h -cs $? $@
 
 /usr/bin/part: part
        install -cs -o bin $? $@
@@ -162,7 +162,7 @@ install:    \
        install -cs -o bin $? $@
 
 /bin/loadkeys: /usr/bin/loadkeys
-       install -lcs $? $@
+       install -l h -cs $? $@
 
 clean:
        rm -rf $(ALL) a.out core
index f27dd14c49009671c68494627505ca79adb3f184..707b3272f80202f292ac08e06d5566d6282c5216 100644 (file)
@@ -20,7 +20,7 @@
 #include <minix/const.h>
 #include <minix/partition.h>
 #include <minix/u64.h>
-#include <ibm/partition.h>
+#include <machine/partition.h>
 #include <termios.h>
 #include <stdarg.h>
 
index a168b43c251a402d3db62ad8fd710c5a68655416..bbf6563341fee094e1757790127e4bd1de3770b4 100644 (file)
@@ -31,7 +31,7 @@
 #include <minix/u64.h>
 #include <minix/com.h>
 #include <minix/sysinfo.h>
-#include <ibm/partition.h>
+#include <machine/partition.h>
 #include <termios.h>
 #include <stdarg.h>
 
index ad5bfd59921f8e4f88d4864619d1fc266cbe01d0..8e5fe53c608dde3450adfdfd9d6c72e219f5a57c 100644 (file)
@@ -34,7 +34,7 @@
 */
 
 #include <sys/types.h>
-#include <ibm/partition.h>
+#include <machine/partition.h>
 #include <minix/partition.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
index 3b20dfca275f991103670a0bcc659195e742c506..40f63c2058af04922acf4068e29351160dd1ece2 100644 (file)
@@ -12,7 +12,7 @@
 #include <time.h>
 #include <errno.h>
 #include <limits.h>
-#include <ibm/diskparm.h>
+#include <machine/diskparm.h>
 #include <minix/minlib.h>
 
 /* Constants. */
index 5c584fb0dace40cf0763d72540f9a02b18f96810..9646899bb8abf9422c901a80345e8c4dcddb729f 100644 (file)
@@ -24,7 +24,7 @@
 #include <minix/const.h>
 #include <minix/partition.h>
 #include <minix/u64.h>
-#include <ibm/partition.h>
+#include <machine/partition.h>
 #include <termios.h>
 
 /* True if a partition is an extended partition. */
index efb71e80ecc2c0fd7b03690c3e033f72c2bcd90a..095a4af8f3fe3761786f74d21acd5ca1aea6b194 100644 (file)
@@ -11,7 +11,7 @@
 #include <minix/const.h>
 #include <minix/partition.h>
 #include <minix/u64.h>
-#include <ibm/partition.h>
+#include <machine/partition.h>
 #include <sys/stat.h>
 #include <string.h>
 #include <errno.h>
index ea8c3beecfeacefc0b722756bc21ac5c99a60d4c..463bdd584aa6dbbf253b316f211ba4f4dead53b5 100644 (file)
@@ -12,7 +12,7 @@
 #include <minix/const.h>
 #include <minix/partition.h>
 #include <minix/u64.h>
-#include <ibm/partition.h>
+#include <machine/partition.h>
 #include <sys/stat.h>
 #include <string.h>
 #include <errno.h>
index 74f2e20617ca440388a052870401d1d6e15199be..d10a987337052e0d9cfb30fc5f801809d5cdeeae 100644 (file)
@@ -28,7 +28,7 @@ install:      /usr/bin/halt /usr/bin/reboot /usr/bin/shutdown \
        install -cs -o root -g operator -m 744 $? $@
 
 /usr/bin/reboot:       /usr/bin/halt
-       install -l $? $@
+       install -l $? $@
 
 /usr/bin/shutdown:     shutdown
        install -cs -o root -g operator -m 4754 $? $@
@@ -37,7 +37,7 @@ install:      /usr/bin/halt /usr/bin/reboot /usr/bin/shutdown \
        install -cs -o root -g operator -m 744 $? $@
 
 /bin/reboot:   /bin/halt
-       install -l $? $@
+       install -l $? $@
 
 clean:
        rm -f *.o a.out core $(PROGRAMS)
index 6a676e8f7482e3b3e9851d2b9e971e1deecdbbe0..21d94abf2f2e9aadb3e56b1057a774612dfd70d0 100644 (file)
@@ -81,7 +81,7 @@ clean:
        install -m 755 -c -o bin $? $@
 
 /usr/bin/U:    /usr/bin/M
-       install -m 755 -l $? $@
+       install -m 755 -l $? $@
 
 /usr/bin/MAKEDEV:      MAKEDEV.sh
        install -m 755 -c -o bin $? $@
@@ -104,7 +104,7 @@ clean:
 /usr/bin/[ /usr/bin/command /usr/bin/echo /usr/bin/expr /usr/bin/false \
 /usr/bin/getopts /usr/bin/read /usr/bin/test /usr/bin/true /usr/bin/umask \
 /usr/bin/wait: /usr/bin/cd
-       install -m 755 -l $? $@
+       install -m 755 -l $? $@
 
 /usr/bin/easypack:     easypack.sh
        install -m 755 -c -o bin $? $@
@@ -116,7 +116,7 @@ clean:
        install -m 755 -c -o bin $? $@
 
 /usr/bin/clr:  /usr/bin/clear
-       install -m 755 -l $? $@
+       install -m 755 -l $? $@
 
 /usr/bin/makewhatis:   makewhatis.sh
        install -m 755 -c -o bin $? $@
@@ -173,7 +173,7 @@ clean:
        install -m 755 -c -o bin $? $@
 
 /usr/bin/apropos:      /usr/bin/whatis
-       install -m 755 -l $? $@
+       install -m 755 -l $? $@
 
 /usr/bin/whereis:      whereis.sh
        install -m 755 -c -o bin $? $@
@@ -182,11 +182,11 @@ clean:
        install -m 755 -c -o bin $? $@
 
 /bin/U:        /bin/M
-       install -m 755 -l $? $@
+       install -m 755 -l $? $@
 
 /bin/cd:       /usr/bin/cd
-       install -m 755 -lc $? $@
+       install -m 755 -l h -c $? $@
 
 /bin/[ /bin/command /bin/echo /bin/expr /bin/false /bin/getopts \
 /bin/read /bin/test /bin/true /bin/umask /bin/wait:    /bin/cd
-       install -m 755 -l $? $@
+       install -m 755 -l $? $@
index 88bddfd026f8619b898fb85fddee02504fdabc18..90ecd7031bc2ceb8ee8b6ce6c0336d8d9aeca203 100644 (file)
@@ -18,10 +18,10 @@ install:    /usr/bin/msh
        install -cs -o bin $? $@
 
 #/usr/bin/sh:  /usr/bin/msh
-#      install -l $? $@
+#      install -l $? $@
 #
 #/bin/sh:      /usr/bin/msh
-#      install -lcs $? $@
+#      install -l h -cs $? $@
 
 $(OBJ):        sh.h
 
index df2e3defd3e4af71eac89d34f5636192a1179d8e..9ed7c2c79b5803f725383bd6503f7988824d858f 100644 (file)
@@ -28,7 +28,7 @@ CC    = exec cc
 #                                      strip symbol table (-s)
 #
 # /bin/cat:    /usr/bin/cat
-#      install -lcs $< $@      install '/bin/cat' by linking (if possible)
+#      install -l h -cs $< $@  install '/bin/cat' by linking (if possible)
 #                              or copying (otherwise)
 #
 # Some of the binaries are installed under more than one name.  The extra
@@ -1120,7 +1120,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/del_route:    /usr/bin/add_route
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/arp:  arp
        install -cs -o root -m 4755 $> $@
@@ -1132,7 +1132,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/restore:      /usr/bin/backup
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/badblocks:    badblocks
        install -cs -o bin $> $@
@@ -1174,7 +1174,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/chgrp:        /usr/bin/chown
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/ci:   ci
        install -cs -o bin $> $@
@@ -1198,7 +1198,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/uncompress /usr/bin/zcat:     /usr/bin/compress
-       install -l $> $@
+       install -l $> $@
 
 /bin/cp:       cp
        install -cs -o bin $> $@
@@ -1208,10 +1208,10 @@ install:        \
 
 /usr/bin/clone /usr/bin/cpdir \
 /usr/bin/ln /usr/bin/mv /usr/bin/rm:   /usr/bin/cp
-       install -l $> $@
+       install -l $> $@
 
 /bin/ln /bin/mv /bin/rm:       /bin/cp
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/crc:  crc
        install -cs -o bin $> $@
@@ -1304,7 +1304,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/egrep:        /usr/bin/grep
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/head: head
        install -cs -o bin $> $@
@@ -1352,7 +1352,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/isodir /usr/bin/isoinfo:      /usr/bin/isoread
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/join: join
        install -cs -o bin $> $@
@@ -1364,7 +1364,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/uptime:       /usr/bin/last
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/leave:        leave
        install -cs -o bin $> $@
@@ -1451,7 +1451,7 @@ install:  \
        install -cs -o root -m 4755 $> $@
 
 /usr/bin/chfn /usr/bin/chsh:   /usr/bin/passwd
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/paste:        paste
        install -cs -o bin $> $@
@@ -1475,7 +1475,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/printenv:     /usr/bin/env
-       install -ls -o bin /usr/bin/env /usr/bin/printenv
+       install -l h -s -o bin /usr/bin/env /usr/bin/printenv
 
 /usr/bin/printroot:    printroot
        install -cs -o bin $> $@
@@ -1508,7 +1508,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/readlink:     /usr/bin/stat
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/readfs:       readfs
        install -cs -o bin $> $@
@@ -1523,7 +1523,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/rput: /usr/bin/rget
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/rlogin:       rlogin
        install -cs -o bin $> $@
@@ -1562,7 +1562,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/fstat:        /usr/bin/stat
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/strings:      strings
        install -cs -o bin $> $@
@@ -1652,7 +1652,7 @@ install:  \
        install -cs -o bin $> $@
 
 /usr/bin/arch: /usr/bin/uname
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/unexpand:     unexpand
        install -cs -o bin $> $@
@@ -1667,13 +1667,13 @@ install:        \
        install -cs -o bin $> $@
 
 /usr/bin/uudecode:     /usr/bin/uud
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/uue:  uue
        install -cs -o bin $> $@
 
 /usr/bin/uuencode:     /usr/bin/uue
-       install -l $> $@
+       install -l $> $@
 
 /usr/bin/vol:  vol
        install -cs -o bin $> $@
@@ -1703,28 +1703,28 @@ install:        \
        install -cs -o bin $> $@
 
 /bin/cat:      /usr/bin/cat
-       install -lcs $> $@
+       install -l h -cs $> $@
 
 /bin/fsck:     /usr/bin/fsck
-       install -lcs $> $@
+       install -l h -cs $> $@
 
 /bin/intr:     /usr/bin/intr
-       install -lcs $> $@
+       install -l h -cs $> $@
 
 /bin/mount:    /usr/bin/mount
-       install -lcs $> $@
+       install -l h -cs $> $@
 
 /bin/printroot:        /usr/bin/printroot
-       install -lcs $> $@
+       install -l h -cs $> $@
 
 /bin/pwd:      /usr/bin/pwd
-       install -lcs $> $@
+       install -l h -cs $> $@
 
 /bin/sync:     /usr/bin/sync
-       install -lcs $> $@
+       install -l h -cs $> $@
 
 /bin/umount:   /usr/bin/umount
-       install -lcs $> $@
+       install -l h -cs $> $@
 
 clean:
        rm -rf $(ALL) a.out core
index f184d52971cd11320617592a936405a720a44ab0..250dda05522260cd75827d52b3b48c403793a047 100644 (file)
@@ -6,7 +6,7 @@
 #include <sys/types.h>
 #include <sys/dir.h>
 #include <sys/stat.h>
-#include <ibm/partition.h>
+#include <machine/partition.h>
 #include <minix/partition.h>
 #include <minix/u64.h>
 #include <sys/ioc_disk.h>
index a6d638dd25e4fc64c1b0ab806c15ced3a7e02e17..ab9ac2d1a8d19f2d8b51f193ed49384b8bb6c894 100644 (file)
@@ -57,7 +57,7 @@ void deallocate(void *mem)
        if (mem != nil) free(mem);
 }
 
-int lflag= 0;          /* Make a hard link if possible. */
+int lflag= 0;          /* Make a link if possible. */
 int cflag= 0;          /* Copy if you can't link, otherwise symlink. */
 int dflag= 0;          /* Create a directory. */
 int pflag= 0;          /* Preserve timestamps. */
@@ -65,6 +65,9 @@ int strip= 0;         /* Strip the copy. */
 char **compress= nil;  /* Compress utility to make a compressed executable. */
 char *zcat= nil;       /* Line one to decompress. */
 
+int make_hardlink = 0; /* Make a hard link */
+int make_symlink = 0;  /* Make a symbolic link */
+
 long stack= -1;                /* Amount of heap + stack. */
 int wordpow= 1;                /* Must be multiplied with wordsize ** wordpow */
                        /* So 8kb for an 8086 and 16kb for the rest. */
@@ -238,16 +241,16 @@ void copylink(char *source, char *dest, int mode, int owner, int group)
        if (owner == -1) owner= sst.st_uid;
        if (group == -1) group= sst.st_gid;
 
-       if (!S_ISREG(sst.st_mode)) {
+       if (!make_symlink && !S_ISREG(sst.st_mode)) {
                fprintf(stderr, "install: %s is not a regular file\n", source);
                excode= 1;
                return;
        }
-       r= stat(dest, &dst);
+       r= lstat(dest, &dst);
        if (r < 0) {
                if (errno != ENOENT) { report(dest); return; }
        } else {
-               if (!S_ISREG(dst.st_mode)) {
+               if (!make_symlink && !S_ISREG(dst.st_mode)) {
                        fprintf(stderr, "install: %s is not a regular file\n",
                                                                        dest);
                        excode= 1;
@@ -267,14 +270,24 @@ void copylink(char *source, char *dest, int mode, int owner, int group)
                }
        }
 
-       if (lflag && !same) {
+       if (lflag) {
                /* Try to link the files. */
 
                if (r >= 0 && unlink(dest) < 0) {
                        report(dest); return;
                }
 
-               if (link(source, dest) >= 0) {
+                if (make_hardlink) {
+                   r = link(source, dest);
+                }
+                else if (make_symlink) {
+                   r = symlink(source, dest);
+                } else {
+                   fprintf(stderr,
+                           "install: must specify hardlink or symlink\n");
+                }
+
+               if (r >= 0) {
                        docopy= 0;
                } else {
                        if (!cflag || errno != EXDEV) {
@@ -382,6 +395,9 @@ void copylink(char *source, char *dest, int mode, int owner, int group)
                }
        }
 
+        /* Don't modify metadata if symlink target doesn't exist */
+        if (make_symlink && stat(dest, &dst) < 0) return;
+
        if (stat(dest, &dst) < 0) { report(dest); return; }
 
        if ((dst.st_mode & 07777) != mode) {
@@ -455,7 +471,6 @@ void main(int argc, char **argv)
 
                while (*p != 0) {
                        switch (*p++) {
-                       case 'l':       lflag= 1;       break;
                        case 'c':       cflag= 1;       break;
                        case 's':       strip= 1;       break;
                        case 'd':       dflag= 1;       break;
@@ -526,6 +541,25 @@ void main(int argc, char **argv)
                                }
                                p= "";
                                break;
+                       case 'l':
+                                lflag= 1;
+                               if (*p == 0) {
+                                       if (i == argc) usage();
+                                       p= argv[i++];
+                                       if (*p == 0) usage();
+                               }
+                                switch(*p) {
+                                   case 'h':
+                                      make_hardlink = 1;
+                                      break;
+                                   case 's':
+                                      make_symlink = 1;
+                                      break;
+                                   default:
+                                      break;
+                                }
+                               p= "";
+                              break;
                        case 'S':
                                if (*p == 0) {
                                        if (i == argc) usage();
@@ -582,7 +616,7 @@ void main(int argc, char **argv)
                if ((argc - i) < 1) usage();
                if ((lflag || cflag) && (argc - i) == 1) usage();
 
-               if (stat(argv[argc-1], &st) >= 0 && S_ISDIR(st.st_mode)) {
+               if (lstat(argv[argc-1], &st) >= 0 && S_ISDIR(st.st_mode)) {
                        /* install file ... dir */
                        char *target= nil;
                        char *base;
index c0816aeee22385c69f3cf774ae68b8759c3db8d8..426f57e7ebaa7e2732d210c096fe0f35a1005186 100644 (file)
@@ -10,7 +10,7 @@
 #include <unistd.h>
 #include <dirent.h>
 #include <ctype.h>
-#include <ibm/partition.h>
+#include <machine/partition.h>
 
 #include <sys/stat.h>
 
index ec9f87ba9a09fb377ea16ef05bb5b222ec00a524..c8cb04449e25bab0f3baf2ea226ca660b0377ae0 100644 (file)
@@ -31,6 +31,6 @@ $(BINDIR)/$(PROG):    $(PROG)
        install -c $? $@
 
 $(BINDIR)/$(LINK1) $(BINDIR)/$(LINK2): $(BINDIR)/$(PROG)
-       install -l $? $@
+       install -l $? $@
 
 $(OBJS):       net.h
index e61eca3a6611676391a12de4a2ebaba16f56dd80..14adf3baa5ff05aab7763bb0d1ff1ccbc9e67ff8 100644 (file)
@@ -77,7 +77,7 @@ $(BINDIR)/yap:        yap
                install -cs -o bin yap $@
 
 $(BINDIR)/more:        $(BINDIR)/yap
-               install -l $? $@
+               install -l $? $@
 
 clean:
                rm -f yap $(OFILES) a.out core *.bak
index 40dbef8d48e4fe609566cc1fe6bf2ac1f1c870bf..8c4755cb5e1d81406266694af17a339db21a425a 100644 (file)
@@ -1,3 +1,9 @@
+20100308:
+        Include directory reorganization:
+        # mv /usr/include/ibm /usr/include/i386
+        # ln -s /usr/include/i386 /usr/include/machine
+        Install(1) updates:
+        # cd commands/simple && make /bin/install
 20100303:
         Gas2ack updates: Run 'make install' in commands/i386/gas2ack
 20100215:
index 7716dcac6e33b832980be4343561592efbb59b7b..fa2f65c68e0e18c9bd4bee3b7fc3f6e013ca9e39 100644 (file)
@@ -15,14 +15,14 @@ Driver for the AMD Device Exclusion Vector (DEV)
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/vm_i386.h>
+#include <machine/vm.h>
 #include <minix/com.h>
 #include <minix/const.h>
 #include <minix/ipc.h>
 #include <minix/syslib.h>
 #include <minix/sysutil.h>
 #include <minix/endpoint.h>
-#include <ibm/pci.h>
+#include <machine/pci.h>
 
 /* Offsets from capability pointer */
 #define DEV_OP         4       /* Selects control/status register to access */
index 723f2b4369fb63fd242bea553e9b2950695dff91..e168642cee0e7f69665d0a8e9b46ccf55749719b 100644 (file)
@@ -20,7 +20,7 @@
 #include <minix/type.h>
 #include <minix/endpoint.h>
 #include <sys/ioc_disk.h>
-#include <ibm/pci.h>
+#include <machine/pci.h>
 #include <sys/mman.h>
 
 /* Variables. */
index 48cf7b50524bbb81a4efb3348fd7b357d707d67b..cd41be48d1099534bb37bb78aa6c72f6bd507edf 100644 (file)
@@ -10,7 +10,7 @@
 #include <sys/mman.h>
 #include <minix/ds.h>
 #include <minix/vm.h>
-#include <ibm/pci.h>
+#include <machine/pci.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
 #include <assert.h>
index a463fe335c2dc97442f0adffee8ce330af1271db..aacfad3fe9841bb94158cc52b20ccfda4333ff25 100644 (file)
@@ -15,7 +15,7 @@
  * based on ES1371 driver by Laurens Bronwasser
  */
 
-#include <ibm/pci.h>
+#include <machine/pci.h>
 
 #include "../framework/audio_fw.h"
 #include "es1370.h"
index 5e7afc4406ec307b5fce3cc5c22422d6549250cd..63dbda91ced144552b714b19fddc717b929b5c17 100644 (file)
@@ -20,7 +20,7 @@
  * by Laurens Bronwasser
  */
 
-#include <ibm/pci.h>
+#include <machine/pci.h>
 
 #include "../framework/audio_fw.h"
 #include "es1371.h"
index 84f0572aed3b0437d228e3b64f535f5ec942db3c..be34a68a98bada05321642f69889a3e4f4d71fbf 100644 (file)
@@ -26,7 +26,7 @@
 #include <minix/sysutil.h>
 #include <minix/safecopies.h>
 #include <sys/ioc_disk.h>
-#include <ibm/int86.h>
+#include <machine/int86.h>
 #include <assert.h>
 
 #define ME "BIOS_WINI"
index 99481e310fcbccbf18c9860ee7ecc8921c6483b4..40c19876e820de938535e72ec80fc8c7d4d6950a 100644 (file)
@@ -12,7 +12,7 @@
 #include "../drivers.h"
 
 #include <assert.h>
-#include <ibm/pci.h>
+#include <machine/pci.h>
 #include <minix/syslib.h>
 #include <minix/endpoint.h>
 #include <minix/com.h>
index 6f2b6e495a2e01b0c09398ba41b6694ee5bf66ff..7e65e741ae5525fb99b8393266660d1377be3268 100644 (file)
@@ -60,7 +60,7 @@
 #include <net/hton.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
-#include <sys/vm_i386.h>
+#include <machine/vm.h>
 #include "assert.h"
 
 #include "local.h"
index 4bd6f76e0162ae1fc3c6703e5bec92af19e8713f..f519868d5e42b5bbe90ef932999e18a3e1c1a8f9 100644 (file)
@@ -12,7 +12,7 @@ Created:      April 2000 by Philip Homburg <philip@f-mnx.phicoh.com>
 #include <sys/types.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
-#include <ibm/pci.h>
+#include <machine/pci.h>
 
 #include "assert.h"
 
index a18f9240c721a7d1bbd18a5c96133aeb8a6fb016..75a7d0299e8929b470e1ace393b6aac6dfac3800 100644 (file)
@@ -224,7 +224,7 @@ void dp_next_iovec(iovec_dat_s_t * iovp);
 
 /* devio.c */
 #if defined USE_IOPL
-#include <ibm/portio.h>
+#include <machine/portio.h>
 #else
 unsigned int inb(unsigned short int);
 unsigned int inw(unsigned short int);
index d4b6e6bafa330985e3826c30f58e85e74d7b3744..8da9f526064083ba7752f422be830a3c43282e04 100644 (file)
@@ -23,9 +23,9 @@
 #include <minix/sysutil.h>
 #include <minix/bitmap.h>
 
-#include <ibm/interrupt.h>     /* IRQ vectors and miscellaneous ports */
-#include <ibm/bios.h>          /* BIOS index numbers */
-#include <ibm/ports.h>         /* Well-known ports */
+#include <machine/interrupt.h> /* IRQ vectors and miscellaneous ports */
+#include <machine/bios.h>              /* BIOS index numbers */
+#include <machine/ports.h>             /* Well-known ports */
 
 #include <string.h>
 #include <signal.h>
index 6570c234e48d244edec382114a492f1fa213e28d..cd14b4d9086712e918b4596a96c167f193e8282b 100644 (file)
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
-#include <ibm/pci.h>
+#include <machine/pci.h>
 #include <minix/ds.h>
 #include <minix/vm.h>
 #include <timers.h>
index bf4da4b6d338239110a1a18de16aa37270a810ef..81ca445212a508bfa4cfe69b31f4a71fb99896b6 100644 (file)
@@ -23,7 +23,7 @@
 #include <net/hton.h> 
 #include <net/gen/ether.h> 
 #include <net/gen/eth_io.h> 
-#include <ibm/pci.h> 
+#include <machine/pci.h>
 #include <minix/ds.h> 
 #include "e1000_hw.h"
 
index fcf8e5d87c67e4e84ad1712329ad5bffaeb91f85..9e0d1d49e2d2b5f734414969a8c40fe85a043762 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "floppy.h"
 #include <timers.h>
-#include <ibm/diskparm.h>
+#include <machine/diskparm.h>
 #include <minix/sysutil.h>
 #include <minix/syslib.h>
 #include <minix/endpoint.h>
index 7499279a0c2c60f54a26c0e12411d7abe1c09d75..59430bb5bb2a5f0096c72db65475fca0dc9181dc 100644 (file)
@@ -58,7 +58,7 @@
 #include <net/hton.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
-#include <ibm/pci.h>
+#include <machine/pci.h>
 #include <minix/ds.h>
 #include <minix/endpoint.h>
 
index a6ef17d91e4f07b982b529d92c7fb9119e659584..9b12b2d7f813bb270d2b0d4ab785f4aefd17c443 100644 (file)
@@ -49,7 +49,7 @@
 
 #include <minix/syslib.h>
 #include <minix/endpoint.h>
-#include <ibm/pci.h>
+#include <machine/pci.h>
 #include <minix/ds.h>
 
 #include "lance.h"
index 1986cab0534b86c05cfaabd054bf277987bccd0e..013eca8572dda107924bfda99dd1b3186928f2a6 100644 (file)
@@ -2,7 +2,7 @@
  *                                                             7 Dec 1995
  */
 
-#include <ibm/partition.h>
+#include <machine/partition.h>
 
 _PROTOTYPE( void partition, (struct driver *dr, int device, int style, int atapi) );
 
index 0f7d402108b61b503a7b3b05dd8319a51ba7e618..3edf779077e83bd46594c04d7e9054506a6ad715 100644 (file)
@@ -25,7 +25,7 @@
 #include "../../kernel/config.h"
 #include "../../kernel/type.h"
 
-#include <sys/vm_i386.h>
+#include <machine/vm.h>
 
 #include "local.h"
 
index b230d8bcf725d65017198fc23e7603e095367054..c57a3dfb58ddc6e5208d7d85e0cd049c57cf009e 100644 (file)
@@ -59,7 +59,7 @@
 #include       <minix/type.h>
 #include       <minix/sysutil.h>
 #include       <timers.h>
-#include       <ibm/pci.h>
+#include       <machine/pci.h>
 #include       <minix/ds.h>
 #include       <minix/endpoint.h>
 #include       "../../kernel/const.h"
@@ -89,7 +89,7 @@ static timer_t or_watchdog;
 #include       <net/hton.h>
 #include       <net/gen/ether.h>
 #include       <net/gen/eth_io.h>
-#include       <sys/vm_i386.h>
+#include       <machine/vm.h>
 #include       <sys/types.h>
 #include       <unistd.h>
 #include       <errno.h>
index 38cb1489ea39bd962be0538c7f24262ec2ebc855..3ac5bcd7a52ecf2c22f09034f2b26ea7852b4d32 100644 (file)
@@ -10,8 +10,8 @@ Created:      Jan 2000 by Philip Homburg <philip@cs.vu.nl>
 
 #include "../drivers.h"
 #include <assert.h>
-#include <ibm/pci.h>
-#include <sys/vm_i386.h>
+#include <machine/pci.h>
+#include <machine/vm.h>
 #include <minix/com.h>
 #include <minix/syslib.h>
 
index 35709edc141e6391cca4c457df24f271d6ac25fa..140aca50d6c77d89183fb82de5beed016018ecbb 100644 (file)
@@ -51,7 +51,7 @@
 #include <minix/syslib.h>
 #include <minix/sysutil.h>
 #include <minix/com.h>
-#include <ibm/cmos.h>
+#include <machine/cmos.h>
 #include <sys/svrctl.h>
 
 int nflag = 0;         /* Tell what, but don't do it. */
index 218be4b5cb36383ba696fc9ff1b1f7039f23abc3..d7076ee569e36d703c0998722ad9a72ab364a43d 100644 (file)
@@ -21,7 +21,7 @@ Created:      Aug 2003 by Philip Homburg <philip@cs.vu.nl>
 #include <net/hton.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
-#include <ibm/pci.h>
+#include <machine/pci.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
index 26d5fc5c96f3f13e68895eafb19846a41def0e57..deacc912afda7188116b93df62cb207ef5d8a863 100644 (file)
@@ -21,7 +21,7 @@
 #include <net/hton.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
-#include <ibm/pci.h>
+#include <machine/pci.h>
 
 #include <sys/types.h>
 #include <assert.h>
index b48e8de74d1ab1d8699ffb5265378c1ce96efc80..4f50e3014272459aed1a4e03322e3e4d3fe393fc 100644 (file)
@@ -5,8 +5,8 @@ Created:        Dec 2005 by Philip Homburg
 */
 
 #include "../drivers.h"
-#include <ibm/pci.h>
-#include <sys/vm_i386.h>
+#include <machine/pci.h>
+#include <machine/vm.h>
 
 #include "ti1225.h"
 #include "i82365.h"
diff --git a/etc/mk/minix.inc.mk b/etc/mk/minix.inc.mk
new file mode 100644 (file)
index 0000000..c0fffaf
--- /dev/null
@@ -0,0 +1,57 @@
+#      $NetBSD: bsd.inc.mk,v 1.32 2006/03/16 18:43:34 jwise Exp $
+
+.include <minix.init.mk>
+
+##### Basic targets
+includes:      ${INCS} incinstall inclinkinstall
+
+##### Default values
+INCSYMLINKS?=
+
+##### Install rules
+incinstall::   # ensure existence
+.PHONY:                incinstall
+
+# -c is forced on here, in order to preserve modtimes for "make depend"
+__incinstall: .USE
+       @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
+           (${_MKSHMSG_INSTALL} ${.TARGET}; \
+            ${_MKSHECHO} "${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \
+               -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}" && \
+            ${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \
+               -m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
+
+.for F in ${INCS:O:u}
+_FDIR:=                ${INCSDIR_${F:C,/,_,g}:U${INCSDIR}}     # dir override
+_FNAME:=       ${INCSNAME_${F:C,/,_,g}:U${INCSNAME:U${F}}} # name override
+_F:=           ${DESTDIR}${_FDIR}/${_FNAME}            # installed path
+
+.if ${MKUPDATE} == "no"
+${_F}!         ${F} __incinstall                       # install rule
+.else
+${_F}:         ${F} __incinstall                       # install rule
+.endif
+
+incinstall::   ${_F}
+.PRECIOUS:     ${_F}                                   # keep if install fails
+.endfor
+
+.undef _FDIR
+.undef _FNAME
+.undef _F
+
+inclinkinstall:        .PHONY
+.if !empty(INCSYMLINKS)
+       @(set ${INCSYMLINKS}; \
+        while test $$# -ge 2; do \
+               l=$$1; shift; \
+               t=${DESTDIR}$$1; shift; \
+               if  ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
+                   [ "$$l" = "$$ttarg" ]; then \
+                       continue ; \
+               fi ; \
+               ${_MKSHMSG_INSTALL} $$t; \
+               ${_MKSHECHO} ${INSTALL_SYMLINK} $$l $$t; \
+               ${INSTALL_SYMLINK} $$l $$t; \
+        done; )
+.endif
diff --git a/etc/mk/minix.kinc.mk b/etc/mk/minix.kinc.mk
new file mode 100644 (file)
index 0000000..08224df
--- /dev/null
@@ -0,0 +1,93 @@
+#      $NetBSD: bsd.kinc.mk,v 1.36 2006/03/16 18:43:34 jwise Exp $
+
+# Variables:
+#
+# INCSDIR      Directory to install includes into (and/or make, and/or
+#              symlink, depending on what's going on).
+#
+# INCS         Headers to install.
+#
+# DEPINCS      Headers to install which are built dynamically.
+#
+# SUBDIR       Subdirectories to enter
+#
+# INCSYMLINKS  Symlinks to make (unconditionally), a la bsd.links.mk.
+#              Note that the original bits will be 'rm -rf'd rather than
+#              just 'rm -f'd, to make the right thing happen with include
+#              directories.
+#
+
+.include <minix.init.mk>
+
+##### Basic targets
+.PRECIOUS:     ${DESTDIR}${INCSDIR}
+includes:      ${DESTDIR}${INCSDIR} .WAIT ${INCS} incinstall
+
+##### Install rules
+incinstall::   # ensure existence
+.PHONY:                incinstall
+
+# make sure the directory is OK, and install includes.
+
+${DESTDIR}${INCSDIR}: .EXEC
+       @if [ ! -d ${.TARGET} ] || [ -h ${.TARGET} ] ; then \
+               ${_MKSHMSG_CREATE} ${.TARGET}; \
+               /bin/rm -rf ${.TARGET}; \
+               ${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} -m 755 \
+                       ${.TARGET}; \
+               ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} -m 755 \
+                       ${.TARGET}; \
+       fi
+
+# -c is forced on here, in order to preserve modtimes for "make depend"
+__incinstall: .USE
+       @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
+           (${_MKSHMSG_INSTALL} ${.TARGET}; \
+            ${_MKSHECHO} "${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \
+               -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}" && \
+            ${INSTALL_FILE} -c -o ${BINOWN} -g ${BINGRP} \
+               -m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
+
+.for F in ${INCS:O:u} ${DEPINCS:O:u}
+_F:=           ${DESTDIR}${INCSDIR}/${F}               # installed path
+
+.if ${MKUPDATE} == "no"
+${_F}!         ${F} __incinstall                       # install rule
+.else
+${_F}:         ${F} __incinstall                       # install rule
+.endif
+
+incinstall::   ${_F}
+.PRECIOUS:     ${_F}                                   # keep if install fails
+.endfor
+
+.undef _F
+
+.if defined(INCSYMLINKS) && !empty(INCSYMLINKS)
+incinstall::
+# XXX: Minix can't handle stat -qf
+#      @(set ${INCSYMLINKS}; \
+#       while test $$# -ge 2; do \
+#              l=$$1; shift; \
+#              t=${DESTDIR}$$1; shift; \
+#              if  ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
+#                  [ "$$l" = "$$ttarg" ]; then \
+#                      continue ; \
+#              fi ; \
+#              ${_MKSHMSG_INSTALL} $$t; \
+#              ${_MKSHECHO} ${INSTALL_SYMLINK} $$l $$t; \
+#              ${INSTALL_SYMLINK} $$l $$t; \
+#       done; )
+       @(set ${INCSYMLINKS}; \
+        while test $$# -ge 2; do \
+               l=$$1; shift; \
+               t=${DESTDIR}$$1; shift; \
+               ${_MKSHMSG_INSTALL} $$t; \
+               ${_MKSHECHO} ${INSTALL_SYMLINK} $$l $$t; \
+               ${INSTALL_SYMLINK} $$l $$t; \
+        done; )
+.endif
+
+##### Pull in related .mk logic
+.include <minix.subdir.mk>
+.include <minix.sys.mk>
diff --git a/etc/mk/minix.klinks.mk b/etc/mk/minix.klinks.mk
new file mode 100644 (file)
index 0000000..2e3c5e7
--- /dev/null
@@ -0,0 +1,69 @@
+#      $NetBSD: bsd.klinks.mk,v 1.6 2009/11/27 13:50:29 pooka Exp $
+#
+
+.include <minix.own.mk>
+
+##### Default values
+.if !defined(S)
+.if defined(NETBSDSRCDIR)
+S=     ${NETBSDSRCDIR}/sys
+.elif defined(BSDSRCDIR)
+S=     ${BSDSRCDIR}/sys
+.else
+S=     /sys
+.endif
+.endif
+
+CLEANFILES+=   machine ${MACHINE_CPU}
+.if ${MACHINE} == "sun2" || ${MACHINE} == "sun3"
+CLEANFILES+=   sun68k
+.elif ${MACHINE} == "sparc64"
+CLEANFILES+=   sparc
+.elif ${MACHINE} == "i386"
+CLEANFILES+=   x86
+.elif ${MACHINE} == "amd64"
+CLEANFILES+=   x86
+.endif
+
+.if defined(XEN_BUILD) || ${MACHINE} == "xen"
+CLEANFILES+=   xen xen-ma/machine # xen-ma
+CPPFLAGS+=     -I${.OBJDIR}/xen-ma
+.if ${MACHINE_CPU} == "i386"
+CLEANFILES+=   x86
+.endif
+.endif
+
+# XXX.  This should be done a better way.  It's @'d to reduce visual spew.
+# XXX   .BEGIN is used to make sure the links are done before anything else.
+.if !make(obj) && !make(clean) && !make(cleandir)
+.BEGIN:
+       @rm -f machine && \
+           ln -s $S/arch/${MACHINE}/include machine
+       @rm -f ${MACHINE_CPU} && \
+           ln -s $S/arch/${MACHINE_CPU}/include ${MACHINE_CPU}
+# XXX. it gets worse..
+.if ${MACHINE} == "sun2" || ${MACHINE} == "sun3"
+       @rm -f sun68k && \
+           ln -s $S/arch/sun68k/include sun68k
+.endif
+.if ${MACHINE} == "sparc64"
+       @rm -f sparc && \
+           ln -s $S/arch/sparc/include sparc
+.endif
+.if ${MACHINE} == "amd64"
+       @rm -f x86 && \
+           ln -s $S/arch/x86/include x86
+       @rm -f i386 && \
+           ln -s $S/arch/i386/include i386
+.endif
+.if ${MACHINE_CPU} == "i386"
+       @rm -f x86 && \
+           ln -s $S/arch/x86/include x86
+.endif
+.if defined(XEN_BUILD) || ${MACHINE} == "xen"
+       @rm -f xen && \
+           ln -s $S/arch/xen/include xen
+       @rm -rf xen-ma && mkdir xen-ma && \
+           ln -s ../${XEN_BUILD:U${MACHINE_ARCH}} xen-ma/machine
+.endif
+.endif
index a0e912ac32d9ab328a248c3adf625d143cbcbf50..41f5018911476b67ba257cf1b5ebed21dde15463 100644 (file)
@@ -769,9 +769,7 @@ PRESERVE?=  -p
 .endif
 #XXX: Not supported by MINIX install
 #RENAME?=      -r
-#XXX: MINIX install only supports hard link
-#HRDLINK?=     -l h
-HRDLINK?=      -l
+HRDLINK?=      -l h
 SYMLINK?=      -l s
 
 METALOG?=      ${DESTDIR}/METALOG
index 31c7446012b3d05fb10c2592dae80ee7b17e04b5..fa90268992ba560041ebf09ef9d96727bfde04b3 100644 (file)
@@ -358,7 +358,7 @@ LINKSGRP?= ${BINGRP}
 LINKSMODE?= ${BINMODE}
 .include <minix.man.mk>
 .include <minix.files.mk>
-.include <minix.inc.mk>
+.include <minix.inc.mk>
 .include <minix.links.mk>
 .include <minix.sys.mk>
 .include <minix.dep.mk>
index 888dbe59439d479df9ee3ce28e8d8b34f7d9cf33..80cfb533f9c365a5350b2caa0ab0e831304679d3 100644 (file)
 755 root    operator /usr/etc
 755 root    operator /home
 755 bin     operator /usr/include
+755 bin     operator /usr/include/arpa
+755 bin     operator /usr/include/minix
+755 bin     operator /usr/include/net
+755 bin     operator /usr/include/net/gen
+755 bin     operator /usr/include/netinet
+755 bin     operator /usr/include/sys
 755 root    operator /usr/lib
 755 root    operator /usr/lib/advent
 755 root    operator /usr/lib/cawf
index 5f71fc981755869e660483a45617c2dfded64e68..ee34594135d4f5caf4344beeaa9e5fcea790c9af 100644 (file)
@@ -1,19 +1,45 @@
+# Doing a make includes builds /usr/include
 
-INC=/usr/include
-MKHEADERS343=/usr/gnu//libexec/gcc/i386-pc-minix/3.4.3/install-tools/mkheaders
-MKHEADERS411=/usr/gnu//libexec/gcc/i386-pc-minix/4.1.1/install-tools/mkheaders
+INCS=  alloca.h ansi.h a.out.h ar.h assert.h configfile.h ctype.h \
+       curses.h dirent.h env.h err.h errno.h fcntl.h fenv.h \
+       float.h fnmatch.h fts.h getopt.h glob.h grp.h ifaddrs.h \
+       inttypes.h libgen.h lib.h libutil.h limits.h locale.h \
+       mathconst.h math.h midiparser.h netdb.h pwd.h regex.h \
+       regexp.h setjmp.h sgtty.h signal.h stdarg.h stddef.h \
+       stdint.h stdio.h stdlib.h string.h strings.h sysexits.h \
+       syslog.h tar.h termcap.h termios.h time.h timers.h tools.h \
+       ttyent.h unistd.h utime.h utmp.h
+INCS+= arpa/inet.h
+INCS+= minix/a.out.h minix/bitmap.h minix/callnr.h minix/cdrom.h \
+       minix/com.h minix/config.h minix/const.h minix/cpufeature.h \
+       minix/crtso.h minix/debug.h minix/devio.h minix/dirent.h \
+       minix/dir.h minix/dl_eth.h minix/dmap.h minix/ds.h \
+       minix/endpoint.h minix/fslib.h minix/ioctl.h minix/ipc.h \
+       minix/keymap.h minix/minlib.h minix/mq.h minix/partition.h \
+       minix/paths.h minix/portio.h minix/profile.h \
+       minix/queryparam.h minix/rs.h minix/safecopies.h \
+       minix/sef.h minix/sound.h minix/sys_config.h \
+       minix/sysinfo.h minix/syslib.h minix/sysutil.h minix/tty.h \
+       minix/type.h minix/types.h minix/u64.h minix/vfsif.h \
+       minix/vm.h
+INCS+= net/hton.h net/if.h net/ioctl.h net/netlib.h
+INCS+= net/gen/arp_io.h net/gen/dhcp.h net/gen/ether.h \
+       net/gen/eth_hdr.h net/gen/eth_io.h net/gen/icmp.h \
+       net/gen/icmp_hdr.h net/gen/if_ether.h net/gen/inet.h \
+       net/gen/in.h net/gen/ip_hdr.h net/gen/ip_io.h \
+       net/gen/nameser.h net/gen/netdb.h net/gen/oneCsum.h \
+       net/gen/psip_hdr.h net/gen/psip_io.h net/gen/resolv.h \
+       net/gen/rip.h net/gen/route.h net/gen/socket.h \
+       net/gen/tcp.h net/gen/tcp_hdr.h net/gen/tcp_io.h \
+       net/gen/udp.h net/gen/udp_hdr.h net/gen/udp_io.h \
+       net/gen/vjhc.h
+INCS+= netinet/if_ether.h netinet/in.h netinet/tcp.h
 
-all::
+.include <minix.own.mk>
 
-clean::
+INCSDIR=        /usr/include
 
-install::
-       -rm -rf $(INC)
-       mkdir -p $(INC)
-       cpdir . $(INC)
-       @chown -R bin $(INC)
-       @rm -f $(INC)/Makefile
+SUBDIR=                sys arch
 
-gcc: install
-       SHELL=/bin/sh; if [ -f $(MKHEADERS343) ] ; then sh -e $(MKHEADERS343) ; fi
-       SHELL=/bin/sh; if [ -f $(MKHEADERS411) ] ; then sh -e $(MKHEADERS411) ; fi
+.include <minix.prog.mk>
+.include <minix.subdir.mk>
diff --git a/include/arch/Makefile b/include/arch/Makefile
new file mode 100644 (file)
index 0000000..0dd0ef5
--- /dev/null
@@ -0,0 +1,7 @@
+.include <minix.own.mk>
+
+SUBDIR= ${ARCH}
+
+INCSYMLINKS= ${MACHINE} /usr/include/machine
+
+.include <minix.kinc.mk>
diff --git a/include/arch/i386/Makefile b/include/arch/i386/Makefile
new file mode 100644 (file)
index 0000000..5e3b1bb
--- /dev/null
@@ -0,0 +1,6 @@
+INCSDIR= /usr/include/i386
+
+INCS=  bios.h cmos.h cpu.h diskparm.h int86.h interrupt.h memory.h \
+       partition.h pci.h ports.h vm.h
+
+.include <minix.kinc.mk>
similarity index 100%
rename from include/ibm/bios.h
rename to include/arch/i386/bios.h
similarity index 100%
rename from include/ibm/cmos.h
rename to include/arch/i386/cmos.h
similarity index 100%
rename from include/ibm/cpu.h
rename to include/arch/i386/cpu.h
similarity index 100%
rename from include/ibm/pci.h
rename to include/arch/i386/pci.h
similarity index 99%
rename from include/sys/vm_i386.h
rename to include/arch/i386/vm.h
index 0124db54fa7d24c0a3158f17a137b0373d872708..ef0ff79d578cd8a51924a95c0e740939b48323ae 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __SYS_VM_386_H__
 #define __SYS_VM_386_H__
 /*
-sys/vm_i386.h
+i386/vm.h
 */
 
 #define I386_PAGE_SIZE         4096
index 4503cddb4dbaa3bf3963ef7401dad13489e423e8..508c48dc458c575e0b3df771a5bad1bf86d1a825 100644 (file)
@@ -179,7 +179,7 @@ struct kmessages {
 };
 
 #include <minix/config.h>
-#include <ibm/interrupt.h>
+#include <machine/interrupt.h>
 
 /* randomness struct: random sources after interrupts: */
 #define RANDOM_SOURCES                 NR_IRQ_VECTORS
diff --git a/include/sys/Makefile b/include/sys/Makefile
new file mode 100644 (file)
index 0000000..08e8f0a
--- /dev/null
@@ -0,0 +1,14 @@
+.include <minix.sys.mk>
+
+INCSDIR=        /usr/include/sys
+
+INCS=  asynchio.h dir.h file.h fpu.h ioc_cmos.h ioc_disk.h \
+       ioc_file.h ioc_memory.h ioc_scsi.h ioc_sound.h ioc_tape.h \
+       ioctl.h ioc_tty.h ipc.h jmp_buf.h kbdio.h mman.h \
+       mount.h mtio.h param.h ptrace.h queue.h resource.h \
+       select.h sem.h shm.h sigcontext.h signal.h socket.h \
+       soundcard.h stackframe.h statfs.h stat.h svrctl.h timeb.h \
+       time.h times.h types.h uio.h un.h utsname.h video.h vm.h \
+       wait.h
+
+.include <minix.kinc.mk>
index f5a7281439cd1a6eb7e4c8abe3295f3755a12acc..220d555509610b2729d9d7ed28ed11d0fecdddb8 100644 (file)
@@ -1,7 +1,7 @@
 
 /* i386-specific clock functions. */
 
-#include <ibm/ports.h>
+#include <machine/ports.h>
 #include <minix/portio.h>
 
 #include "../../kernel.h"
index b65307059b9d0c31466f0dccd06514203590ccbf..d8f4d830b10cbf0ec0fe8074dff3524a292e5554 100644 (file)
@@ -8,7 +8,7 @@
 #include "../../system.h"
 #include <minix/type.h>
 #include <minix/endpoint.h>
-#include <ibm/int86.h>
+#include <machine/int86.h>
 
 #include "proto.h"
 
index afab1e213be001b8015ec14cf82cd555d8421145..13e6a867f8dfc8634cd6f385b494633244e10df2 100644 (file)
@@ -9,7 +9,7 @@
 #include "../../proc.h"
 #include "proto.h"
 #include <minix/portio.h>
-#include <ibm/cpu.h>
+#include <machine/cpu.h>
 
 #define ICW1_AT         0x11   /* edge triggered, cascade, need ICW4 */
 #define ICW1_PC         0x13   /* edge triggered, no cascade, need ICW4 */
index 62fc5408482dc361463c40e48dbeb6e709aadf27..3411845f2eab4c84540f1990b41848e9e62de093 100644 (file)
@@ -2,8 +2,8 @@
 #ifndef _I386_ACONST_H
 #define _I386_ACONST_H 1
 
-#include <ibm/interrupt.h>
-#include <ibm/memory.h>
+#include <machine/interrupt.h>
+#include <machine/memory.h>
 
 #define NR_REMOTE_SEGS     3    /* # remote memory regions (variable) */
 
index 93b8a8f571bdbf6be59d54d86c6d253e0c4debfc..dd94d6a5871d622626617132e00db0679c62fe8a 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <minix/config.h>
 #include <minix/const.h>
-#include <ibm/interrupt.h>
+#include <machine/interrupt.h>
 #include <archconst.h>
 #include "../../const.h"
 #include "sconst.h"
index 742539502af56cb6e1cca57b1ff8c15d5150c98c..dc05c8c78512917a07ab62f2610c8e4dd721b99a 100644 (file)
@@ -9,7 +9,7 @@
 #include <minix/cpufeature.h>
 #include <string.h>
 
-#include <sys/vm_i386.h>
+#include <machine/vm.h>
 
 #include "proto.h"
 #include "../../proto.h"
index d5809252ebb6cb1d693697aee468e435b11c649f..d58c5d8e0b4d0d101a571d289b7c8b4ea6701dd1 100644 (file)
@@ -46,7 +46,7 @@
 
 /* sections */
 
-#include <sys/vm_i386.h>
+#include <machine/vm.h>
 
 #ifdef __ACK__
 .text
@@ -67,7 +67,7 @@ begbss:
 #include <minix/config.h>
 #include <minix/const.h>
 #include <minix/com.h>
-#include <ibm/interrupt.h>
+#include <machine/interrupt.h>
 #include <archconst.h>
 #include "../../const.h"
 #include "../../proc.h"
index b05d00feaf0c20051f5bad0306d9ff2574e368ec..0b57abd70a6a2883f8c631277af222c9af570d0e 100644 (file)
@@ -5,8 +5,8 @@
 #include <unistd.h>
 #include <ctype.h>
 #include <string.h>
-#include <ibm/cmos.h>
-#include <ibm/bios.h>
+#include <machine/cmos.h>
+#include <machine/bios.h>
 #include <minix/portio.h>
 #include <minix/cpufeature.h>
 #include <a.out.h>
index a0c751d6e0066dd4e4775ac8a2c4d27d81340ac8..fe083635ef4eb4c457c298a36c5c43b652cbcc25 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "../system.h"
 #include <string.h>
-#include <ibm/cpu.h>
+#include <machine/cpu.h>
 #include <sys/sigcontext.h>
 
 #if USE_SIGRETURN 
index d9e80519b3edde8bf06ab00dc16fcd889d626a9a..dfd29788fbed3c738ecb1e979f83a155bff1bb10 100644 (file)
@@ -2,7 +2,7 @@
 #define TYPE_H
 
 #include <minix/com.h>
-#include <ibm/interrupt.h>
+#include <machine/interrupt.h>
 
 typedef _PROTOTYPE( void task_t, (void) );
 
index 1938532940a56d5f6c41fb173f8f89c00f9e701f..4bc54928cd32a218c246b0dfa99b9b80248f8616 100644 (file)
@@ -6,7 +6,7 @@
 /* simplistic.  We simply check for some magic value, but there is no other */
 /* way. */
 
-#include <sys/vm_i386.h>
+#include <machine/vm.h>
 
 
 .globl begtext, begdata, begbss
index 90f48166db30900667790071330437f96be4964f..8de5cc2ba60a335dc7ba79e281daa44a66cd7a43 100644 (file)
@@ -2,7 +2,7 @@
 #include <stdint.h>
 #include <minix/minlib.h>
 #include <minix/cpufeature.h>
-#include <sys/vm_i386.h>
+#include <machine/vm.h>
 
 int _cpufeature(int cpufeature)
 {
index d76356f78c87260ec1ada0991bd4b0b3e13d422e..386b8a053a09dfceb0587de4e053d84994031e8d 100644 (file)
@@ -5,7 +5,9 @@ install \- install files
 .in +5
 .ti -5
 .B install
-.RB [ \-lcpsz\fIN\fP "] [" \-o
+.RB [ \-cpsz\fIN\fP "] [" \-l
+.IR linktype ]
+.RB [ \-o
 .IR owner ]
 .RB [ \-g
 .IR group ]
@@ -18,7 +20,9 @@ install \- install files
 .br
 .ti -5
 .B install
-.RB [ \-lcpsz\fIN\fP "] [" \-o
+.RB [ \-cpsz\fIN\fP "] [" \-l
+.IR linktype ]
+.RB [ \-o
 .IR owner ]
 .RB [ \-g
 .IR group ]
@@ -68,10 +72,17 @@ if they are linked.  So copy the file if you change it in a way that makes
 it read-only.  You would otherwise not be able to compile a command again.
 .SH OPTIONS
 .TP
-.B \-l
+.BI \-l " linktype"
 Link the destination to the source file instead of copying it.  This is done
 to either save space on a file system with both the source and the bin
-directories on it, or to install synonyms to a command.
+directories on it, or to install synonyms to a command. The
+.I linktype
+argument can either be
+.I h
+(hard)
+or
+.I s
+(symbolic).
 .TP
 .B \-c
 Copy the source file to its proper place.  This option is the default if
index f47202e41f8c47fb4924ee980376e826933f1d10..38138a4115cfdff695ba116d4ed09f8ee55600bd 100644 (file)
@@ -16,7 +16,7 @@
 #include <sys/shm.h>
 #include <sys/sem.h>
 #include <sys/mman.h>
-#include <sys/vm_i386.h>
+#include <machine/vm.h>
 #include <sys/vm.h>
 
 #include <time.h>
index cf1fae81edd844d2e36f43138fd0a07cd6eb83c4..b0abd65bc61fb94f4cc0e5ef36275abda03e8147 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "inc.h"
 #include <timers.h>
-#include <ibm/interrupt.h>
+#include <machine/interrupt.h>
 #include <minix/endpoint.h>
 #include <minix/sysutil.h>
 #include <minix/sys_config.h>
index 05af779f77187b30aa44cfdc71be0d8f12c58708..ee129b9abe05d66afce39ce2d87f27be4d4519fa 100644 (file)
@@ -1,4 +1,4 @@
-#include <sys/vm_i386.h>
+#include <machine/vm.h>
 
 /* As visible from the user space process, where is the top of the
  * stack (first non-stack byte), when in paged mode?
index d9aab9debbec40afa29d6bc0f16141ae4ff40702..4cdc9a61abddb671cf39064c40e6e721781f38d7 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef _PAGEFAULTS_H
 #define _PAGEFAULTS_H 1
 
-#include <sys/vm_i386.h>
+#include <machine/vm.h>
 
 #define PFERR_NOPAGE(e)        (!((e) & I386_VM_PFE_P))
 #define PFERR_PROT(e)  (((e) & I386_VM_PFE_P))
index 42fb7d7e62efa0178e231415dbc7b6e82fdd422d..4d17e798b4a5fbdffae8f0700d7706a99c74fae5 100644 (file)
@@ -3,7 +3,7 @@
 #define _PAGETABLE_H 1
 
 #include <stdint.h>
-#include <sys/vm_i386.h>
+#include <machine/vm.h>
 
 #include "../vm.h"