From 2a8fabf4ad76c830446c295d8583a7ef068aaaa6 Mon Sep 17 00:00:00 2001 From: Arun Thomas Date: Mon, 8 Mar 2010 11:04:59 +0000 Subject: [PATCH] Include directory reorg and makefile updates. -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 --- Makefile | 22 ++++-- boot/boot.c | 4 +- boot/bootimage.c | 2 +- commands/aal/Makefile | 2 +- commands/ash/Makefile | 6 +- commands/cawf/Makefile | 4 +- commands/elvis/Makefile | 2 +- commands/i386/Makefile | 2 +- commands/ibm/Makefile | 6 +- commands/ibm/atnormalize.c | 2 +- commands/ibm/autopart.c | 2 +- commands/ibm/fdisk.c | 2 +- commands/ibm/format.c | 2 +- commands/ibm/part.c | 2 +- commands/ibm/partition.c | 2 +- commands/ibm/repartition.c | 2 +- commands/reboot/Makefile | 4 +- commands/scripts/Makefile | 14 ++-- commands/sh/Makefile | 4 +- commands/simple/Makefile | 52 ++++++------- commands/simple/devsize.c | 2 +- commands/simple/install.c | 50 ++++++++++-- commands/simple/writeisofs.c | 2 +- commands/urlget/Makefile | 2 +- commands/yap/Makefile | 2 +- docs/UPDATING | 6 ++ drivers/amddev/amddev.c | 4 +- drivers/at_wini/at_wini.c | 2 +- drivers/atl2/atl2.c | 2 +- drivers/audio/es1370/es1370.c | 2 +- drivers/audio/es1371/es1371.c | 2 +- drivers/bios_wini/bios_wini.c | 2 +- drivers/dec21140A/dec21140A.c | 2 +- drivers/dp8390/dp8390.c | 2 +- drivers/dp8390/rtl8029.c | 2 +- drivers/dpeth/dp.h | 2 +- drivers/drivers.h | 6 +- drivers/e1000/e1000.c | 2 +- drivers/e1000/e1000.h | 2 +- drivers/floppy/floppy.c | 2 +- drivers/fxp/fxp.c | 2 +- drivers/lance/lance.c | 2 +- drivers/libdriver/drvlib.h | 2 +- drivers/memory/memory.c | 2 +- drivers/orinoco/orinoco.c | 4 +- drivers/pci/pci.c | 4 +- drivers/readclock/readclock.c | 2 +- drivers/rtl8139/rtl8139.h | 2 +- drivers/rtl8169/rtl8169.c | 2 +- drivers/ti1225/ti1225.c | 4 +- etc/mk/minix.inc.mk | 57 ++++++++++++++ etc/mk/minix.kinc.mk | 93 +++++++++++++++++++++++ etc/mk/minix.klinks.mk | 69 +++++++++++++++++ etc/mk/minix.own.mk | 4 +- etc/mk/minix.prog.mk | 2 +- etc/mtree/minix.tree | 6 ++ include/Makefile | 54 +++++++++---- include/arch/Makefile | 7 ++ include/arch/i386/Makefile | 6 ++ include/{ibm => arch/i386}/bios.h | 0 include/{ibm => arch/i386}/cmos.h | 0 include/{ibm => arch/i386}/cpu.h | 0 include/{ibm => arch/i386}/diskparm.h | 0 include/{ibm => arch/i386}/int86.h | 0 include/{ibm => arch/i386}/interrupt.h | 0 include/{ibm => arch/i386}/memory.h | 0 include/{ibm => arch/i386}/partition.h | 0 include/{ibm => arch/i386}/pci.h | 0 include/{ibm => arch/i386}/ports.h | 0 include/{sys/vm_i386.h => arch/i386/vm.h} | 2 +- include/minix/type.h | 2 +- include/sys/Makefile | 14 ++++ kernel/arch/i386/clock.c | 2 +- kernel/arch/i386/do_int86.c | 2 +- kernel/arch/i386/i8259.c | 2 +- kernel/arch/i386/include/archconst.h | 4 +- kernel/arch/i386/klib386.S | 2 +- kernel/arch/i386/memory.c | 2 +- kernel/arch/i386/mpx386.S | 4 +- kernel/arch/i386/system.c | 4 +- kernel/system/do_sigreturn.c | 2 +- kernel/type.h | 2 +- lib/csu/i386/crtso.S | 2 +- lib/libc/arch/i386/misc/_cpufeature.c | 2 +- man/man1/install.1 | 19 ++++- servers/ipc/inc.h | 2 +- servers/is/dmp_kernel.c | 2 +- servers/vm/i386/memory.h | 2 +- servers/vm/i386/pagefaults.h | 2 +- servers/vm/i386/pagetable.h | 2 +- 90 files changed, 485 insertions(+), 152 deletions(-) create mode 100644 etc/mk/minix.inc.mk create mode 100644 etc/mk/minix.kinc.mk create mode 100644 etc/mk/minix.klinks.mk create mode 100644 include/arch/Makefile create mode 100644 include/arch/i386/Makefile rename include/{ibm => arch/i386}/bios.h (100%) rename include/{ibm => arch/i386}/cmos.h (100%) rename include/{ibm => arch/i386}/cpu.h (100%) rename include/{ibm => arch/i386}/diskparm.h (100%) rename include/{ibm => arch/i386}/int86.h (100%) rename include/{ibm => arch/i386}/interrupt.h (100%) rename include/{ibm => arch/i386}/memory.h (100%) rename include/{ibm => arch/i386}/partition.h (100%) rename include/{ibm => arch/i386}/pci.h (100%) rename include/{ibm => arch/i386}/ports.h (100%) rename include/{sys/vm_i386.h => arch/i386/vm.h} (99%) create mode 100644 include/sys/Makefile diff --git a/Makefile b/Makefile index 3f4ed1a12..f129f1375 100644 --- 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 diff --git a/boot/boot.c b/boot/boot.c index d86e8ca35..3b3497eea 100644 --- a/boot/boot.c +++ b/boot/boot.c @@ -17,8 +17,8 @@ char version[]= "2.20"; #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/boot/bootimage.c b/boot/bootimage.c index 4562d8ffa..250cfd6df 100644 --- a/boot/bootimage.c +++ b/boot/bootimage.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "rawfs.h" #include "image.h" #include "boot.h" diff --git a/commands/aal/Makefile b/commands/aal/Makefile index a432ddd5c..0931a021c 100644 --- a/commands/aal/Makefile +++ b/commands/aal/Makefile @@ -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 h $? $@ archiver.o: print.o: diff --git a/commands/ash/Makefile b/commands/ash/Makefile index f77087641..71768f9f7 100644 --- a/commands/ash/Makefile +++ b/commands/ash/Makefile @@ -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 h $> $@ /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 diff --git a/commands/cawf/Makefile b/commands/cawf/Makefile index cf7bd9343..02ef6bcdf 100644 --- a/commands/cawf/Makefile +++ b/commands/cawf/Makefile @@ -74,13 +74,13 @@ install: \ install -cs -o bin bsfilt $@ /usr/bin/colcrt: /usr/bin/bsfilt - install -l /usr/bin/bsfilt $@ + install -l h /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 h /usr/bin/cawf $@ /usr/lib/cawf: install -d -o bin /usr/lib/cawf diff --git a/commands/elvis/Makefile b/commands/elvis/Makefile index a0118c2cc..602d327c8 100644 --- a/commands/elvis/Makefile +++ b/commands/elvis/Makefile @@ -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 diff --git a/commands/i386/Makefile b/commands/i386/Makefile index a391d8869..39020233f 100644 --- a/commands/i386/Makefile +++ b/commands/i386/Makefile @@ -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 h $? $@ /usr/lib/descr: acd.descr install $? $@ diff --git a/commands/ibm/Makefile b/commands/ibm/Makefile index 26f9b10a9..c873d7596 100644 --- a/commands/ibm/Makefile +++ b/commands/ibm/Makefile @@ -117,7 +117,7 @@ install: \ install -cs -o bin $? $@ /usr/bin/dosdir /usr/bin/doswrite: /usr/bin/dosread - install -l $? $@ + install -l h $? $@ /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 diff --git a/commands/ibm/atnormalize.c b/commands/ibm/atnormalize.c index f27dd14c4..707b3272f 100644 --- a/commands/ibm/atnormalize.c +++ b/commands/ibm/atnormalize.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/commands/ibm/autopart.c b/commands/ibm/autopart.c index a168b43c2..bbf656334 100644 --- a/commands/ibm/autopart.c +++ b/commands/ibm/autopart.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/commands/ibm/fdisk.c b/commands/ibm/fdisk.c index ad5bfd599..8e5fe53c6 100644 --- a/commands/ibm/fdisk.c +++ b/commands/ibm/fdisk.c @@ -34,7 +34,7 @@ */ #include -#include +#include #include #include #include diff --git a/commands/ibm/format.c b/commands/ibm/format.c index 3b20dfca2..40f63c205 100644 --- a/commands/ibm/format.c +++ b/commands/ibm/format.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include /* Constants. */ diff --git a/commands/ibm/part.c b/commands/ibm/part.c index 5c584fb0d..9646899bb 100644 --- a/commands/ibm/part.c +++ b/commands/ibm/part.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include /* True if a partition is an extended partition. */ diff --git a/commands/ibm/partition.c b/commands/ibm/partition.c index efb71e80e..095a4af8f 100644 --- a/commands/ibm/partition.c +++ b/commands/ibm/partition.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/commands/ibm/repartition.c b/commands/ibm/repartition.c index ea8c3beec..463bdd584 100644 --- a/commands/ibm/repartition.c +++ b/commands/ibm/repartition.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/commands/reboot/Makefile b/commands/reboot/Makefile index 74f2e2061..d10a98733 100644 --- a/commands/reboot/Makefile +++ b/commands/reboot/Makefile @@ -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 h $? $@ /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 h $? $@ clean: rm -f *.o a.out core $(PROGRAMS) diff --git a/commands/scripts/Makefile b/commands/scripts/Makefile index 6a676e8f7..21d94abf2 100644 --- a/commands/scripts/Makefile +++ b/commands/scripts/Makefile @@ -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 h $? $@ /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 h $? $@ /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 h $? $@ /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 h $? $@ /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 h $? $@ /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 h $? $@ diff --git a/commands/sh/Makefile b/commands/sh/Makefile index 88bddfd02..90ecd7031 100644 --- a/commands/sh/Makefile +++ b/commands/sh/Makefile @@ -18,10 +18,10 @@ install: /usr/bin/msh install -cs -o bin $? $@ #/usr/bin/sh: /usr/bin/msh -# install -l $? $@ +# install -l h $? $@ # #/bin/sh: /usr/bin/msh -# install -lcs $? $@ +# install -l h -cs $? $@ $(OBJ): sh.h diff --git a/commands/simple/Makefile b/commands/simple/Makefile index df2e3defd..9ed7c2c79 100644 --- a/commands/simple/Makefile +++ b/commands/simple/Makefile @@ -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 h $> $@ /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 h $> $@ /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 h $> $@ /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 h $> $@ /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 h $> $@ /bin/ln /bin/mv /bin/rm: /bin/cp - install -l $> $@ + install -l h $> $@ /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 h $> $@ /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 h $> $@ /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 h $> $@ /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 h $> $@ /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 h $> $@ /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 h $> $@ /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 h $> $@ /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 h $> $@ /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 h $> $@ /usr/bin/uue: uue install -cs -o bin $> $@ /usr/bin/uuencode: /usr/bin/uue - install -l $> $@ + install -l h $> $@ /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 diff --git a/commands/simple/devsize.c b/commands/simple/devsize.c index f184d5297..250dda055 100644 --- a/commands/simple/devsize.c +++ b/commands/simple/devsize.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/commands/simple/install.c b/commands/simple/install.c index a6d638dd2..ab9ac2d1a 100644 --- a/commands/simple/install.c +++ b/commands/simple/install.c @@ -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; diff --git a/commands/simple/writeisofs.c b/commands/simple/writeisofs.c index c0816aeee..426f57e7e 100644 --- a/commands/simple/writeisofs.c +++ b/commands/simple/writeisofs.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include diff --git a/commands/urlget/Makefile b/commands/urlget/Makefile index ec9f87ba9..c8cb04449 100644 --- a/commands/urlget/Makefile +++ b/commands/urlget/Makefile @@ -31,6 +31,6 @@ $(BINDIR)/$(PROG): $(PROG) install -c $? $@ $(BINDIR)/$(LINK1) $(BINDIR)/$(LINK2): $(BINDIR)/$(PROG) - install -l $? $@ + install -l h $? $@ $(OBJS): net.h diff --git a/commands/yap/Makefile b/commands/yap/Makefile index e61eca3a6..14adf3baa 100644 --- a/commands/yap/Makefile +++ b/commands/yap/Makefile @@ -77,7 +77,7 @@ $(BINDIR)/yap: yap install -cs -o bin yap $@ $(BINDIR)/more: $(BINDIR)/yap - install -l $? $@ + install -l h $? $@ clean: rm -f yap $(OFILES) a.out core *.bak diff --git a/docs/UPDATING b/docs/UPDATING index 40dbef8d4..8c4755cb5 100644 --- a/docs/UPDATING +++ b/docs/UPDATING @@ -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: diff --git a/drivers/amddev/amddev.c b/drivers/amddev/amddev.c index 7716dcac6..fa2f65c68 100644 --- a/drivers/amddev/amddev.c +++ b/drivers/amddev/amddev.c @@ -15,14 +15,14 @@ Driver for the AMD Device Exclusion Vector (DEV) #include #include #include -#include +#include #include #include #include #include #include #include -#include +#include /* Offsets from capability pointer */ #define DEV_OP 4 /* Selects control/status register to access */ diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index 723f2b436..e168642ce 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include /* Variables. */ diff --git a/drivers/atl2/atl2.c b/drivers/atl2/atl2.c index 48cf7b505..cd41be48d 100644 --- a/drivers/atl2/atl2.c +++ b/drivers/atl2/atl2.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/audio/es1370/es1370.c b/drivers/audio/es1370/es1370.c index a463fe335..aacfad3fe 100644 --- a/drivers/audio/es1370/es1370.c +++ b/drivers/audio/es1370/es1370.c @@ -15,7 +15,7 @@ * based on ES1371 driver by Laurens Bronwasser */ -#include +#include #include "../framework/audio_fw.h" #include "es1370.h" diff --git a/drivers/audio/es1371/es1371.c b/drivers/audio/es1371/es1371.c index 5e7afc440..63dbda91c 100644 --- a/drivers/audio/es1371/es1371.c +++ b/drivers/audio/es1371/es1371.c @@ -20,7 +20,7 @@ * by Laurens Bronwasser */ -#include +#include #include "../framework/audio_fw.h" #include "es1371.h" diff --git a/drivers/bios_wini/bios_wini.c b/drivers/bios_wini/bios_wini.c index 84f0572ae..be34a68a9 100644 --- a/drivers/bios_wini/bios_wini.c +++ b/drivers/bios_wini/bios_wini.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #define ME "BIOS_WINI" diff --git a/drivers/dec21140A/dec21140A.c b/drivers/dec21140A/dec21140A.c index 99481e310..40c19876e 100644 --- a/drivers/dec21140A/dec21140A.c +++ b/drivers/dec21140A/dec21140A.c @@ -12,7 +12,7 @@ #include "../drivers.h" #include -#include +#include #include #include #include diff --git a/drivers/dp8390/dp8390.c b/drivers/dp8390/dp8390.c index 6f2b6e495..7e65e741a 100644 --- a/drivers/dp8390/dp8390.c +++ b/drivers/dp8390/dp8390.c @@ -60,7 +60,7 @@ #include #include #include -#include +#include #include "assert.h" #include "local.h" diff --git a/drivers/dp8390/rtl8029.c b/drivers/dp8390/rtl8029.c index 4bd6f76e0..f519868d5 100644 --- a/drivers/dp8390/rtl8029.c +++ b/drivers/dp8390/rtl8029.c @@ -12,7 +12,7 @@ Created: April 2000 by Philip Homburg #include #include #include -#include +#include #include "assert.h" diff --git a/drivers/dpeth/dp.h b/drivers/dpeth/dp.h index a18f9240c..75a7d0299 100644 --- a/drivers/dpeth/dp.h +++ b/drivers/dpeth/dp.h @@ -224,7 +224,7 @@ void dp_next_iovec(iovec_dat_s_t * iovp); /* devio.c */ #if defined USE_IOPL -#include +#include #else unsigned int inb(unsigned short int); unsigned int inw(unsigned short int); diff --git a/drivers/drivers.h b/drivers/drivers.h index d4b6e6baf..8da9f5260 100644 --- a/drivers/drivers.h +++ b/drivers/drivers.h @@ -23,9 +23,9 @@ #include #include -#include /* IRQ vectors and miscellaneous ports */ -#include /* BIOS index numbers */ -#include /* Well-known ports */ +#include /* IRQ vectors and miscellaneous ports */ +#include /* BIOS index numbers */ +#include /* Well-known ports */ #include #include diff --git a/drivers/e1000/e1000.c b/drivers/e1000/e1000.c index 6570c234e..cd14b4d90 100644 --- a/drivers/e1000/e1000.c +++ b/drivers/e1000/e1000.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/e1000/e1000.h b/drivers/e1000/e1000.h index bf4da4b6d..81ca44521 100644 --- a/drivers/e1000/e1000.h +++ b/drivers/e1000/e1000.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include "e1000_hw.h" diff --git a/drivers/floppy/floppy.c b/drivers/floppy/floppy.c index fcf8e5d87..9e0d1d49e 100644 --- a/drivers/floppy/floppy.c +++ b/drivers/floppy/floppy.c @@ -24,7 +24,7 @@ #include "floppy.h" #include -#include +#include #include #include #include diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index 7499279a0..59430bb5b 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/lance/lance.c b/drivers/lance/lance.c index a6ef17d91..9b12b2d7f 100644 --- a/drivers/lance/lance.c +++ b/drivers/lance/lance.c @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include "lance.h" diff --git a/drivers/libdriver/drvlib.h b/drivers/libdriver/drvlib.h index 1986cab05..013eca857 100644 --- a/drivers/libdriver/drvlib.h +++ b/drivers/libdriver/drvlib.h @@ -2,7 +2,7 @@ * 7 Dec 1995 */ -#include +#include _PROTOTYPE( void partition, (struct driver *dr, int device, int style, int atapi) ); diff --git a/drivers/memory/memory.c b/drivers/memory/memory.c index 0f7d40210..3edf77907 100644 --- a/drivers/memory/memory.c +++ b/drivers/memory/memory.c @@ -25,7 +25,7 @@ #include "../../kernel/config.h" #include "../../kernel/type.h" -#include +#include #include "local.h" diff --git a/drivers/orinoco/orinoco.c b/drivers/orinoco/orinoco.c index b230d8bcf..c57a3dfb5 100644 --- a/drivers/orinoco/orinoco.c +++ b/drivers/orinoco/orinoco.c @@ -59,7 +59,7 @@ #include #include #include -#include +#include #include #include #include "../../kernel/const.h" @@ -89,7 +89,7 @@ static timer_t or_watchdog; #include #include #include -#include +#include #include #include #include diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 38cb1489e..3ac5bcd7a 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -10,8 +10,8 @@ Created: Jan 2000 by Philip Homburg #include "../drivers.h" #include -#include -#include +#include +#include #include #include diff --git a/drivers/readclock/readclock.c b/drivers/readclock/readclock.c index 35709edc1..140aca50d 100644 --- a/drivers/readclock/readclock.c +++ b/drivers/readclock/readclock.c @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include int nflag = 0; /* Tell what, but don't do it. */ diff --git a/drivers/rtl8139/rtl8139.h b/drivers/rtl8139/rtl8139.h index 218be4b5c..d7076ee56 100644 --- a/drivers/rtl8139/rtl8139.h +++ b/drivers/rtl8139/rtl8139.h @@ -21,7 +21,7 @@ Created: Aug 2003 by Philip Homburg #include #include #include -#include +#include #include #include diff --git a/drivers/rtl8169/rtl8169.c b/drivers/rtl8169/rtl8169.c index 26d5fc5c9..deacc912a 100644 --- a/drivers/rtl8169/rtl8169.c +++ b/drivers/rtl8169/rtl8169.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/ti1225/ti1225.c b/drivers/ti1225/ti1225.c index b48e8de74..4f50e3014 100644 --- a/drivers/ti1225/ti1225.c +++ b/drivers/ti1225/ti1225.c @@ -5,8 +5,8 @@ Created: Dec 2005 by Philip Homburg */ #include "../drivers.h" -#include -#include +#include +#include #include "ti1225.h" #include "i82365.h" diff --git a/etc/mk/minix.inc.mk b/etc/mk/minix.inc.mk new file mode 100644 index 000000000..c0fffaf2b --- /dev/null +++ b/etc/mk/minix.inc.mk @@ -0,0 +1,57 @@ +# $NetBSD: bsd.inc.mk,v 1.32 2006/03/16 18:43:34 jwise Exp $ + +.include + +##### 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 index 000000000..08224df38 --- /dev/null +++ b/etc/mk/minix.kinc.mk @@ -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 + +##### 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 +.include diff --git a/etc/mk/minix.klinks.mk b/etc/mk/minix.klinks.mk new file mode 100644 index 000000000..2e3c5e7c0 --- /dev/null +++ b/etc/mk/minix.klinks.mk @@ -0,0 +1,69 @@ +# $NetBSD: bsd.klinks.mk,v 1.6 2009/11/27 13:50:29 pooka Exp $ +# + +.include + +##### 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 diff --git a/etc/mk/minix.own.mk b/etc/mk/minix.own.mk index a0e912ac3..41f501891 100644 --- a/etc/mk/minix.own.mk +++ b/etc/mk/minix.own.mk @@ -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 diff --git a/etc/mk/minix.prog.mk b/etc/mk/minix.prog.mk index 31c744601..fa9026899 100644 --- a/etc/mk/minix.prog.mk +++ b/etc/mk/minix.prog.mk @@ -358,7 +358,7 @@ LINKSGRP?= ${BINGRP} LINKSMODE?= ${BINMODE} .include .include -# .include +.include .include .include .include diff --git a/etc/mtree/minix.tree b/etc/mtree/minix.tree index 888dbe594..80cfb533f 100644 --- a/etc/mtree/minix.tree +++ b/etc/mtree/minix.tree @@ -20,6 +20,12 @@ 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 diff --git a/include/Makefile b/include/Makefile index 5f71fc981..ee3459413 100644 --- a/include/Makefile +++ b/include/Makefile @@ -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 -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 +.include diff --git a/include/arch/Makefile b/include/arch/Makefile new file mode 100644 index 000000000..0dd0ef5b7 --- /dev/null +++ b/include/arch/Makefile @@ -0,0 +1,7 @@ +.include + +SUBDIR= ${ARCH} + +INCSYMLINKS= ${MACHINE} /usr/include/machine + +.include diff --git a/include/arch/i386/Makefile b/include/arch/i386/Makefile new file mode 100644 index 000000000..5e3b1bbae --- /dev/null +++ b/include/arch/i386/Makefile @@ -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 diff --git a/include/ibm/bios.h b/include/arch/i386/bios.h similarity index 100% rename from include/ibm/bios.h rename to include/arch/i386/bios.h diff --git a/include/ibm/cmos.h b/include/arch/i386/cmos.h similarity index 100% rename from include/ibm/cmos.h rename to include/arch/i386/cmos.h diff --git a/include/ibm/cpu.h b/include/arch/i386/cpu.h similarity index 100% rename from include/ibm/cpu.h rename to include/arch/i386/cpu.h diff --git a/include/ibm/diskparm.h b/include/arch/i386/diskparm.h similarity index 100% rename from include/ibm/diskparm.h rename to include/arch/i386/diskparm.h diff --git a/include/ibm/int86.h b/include/arch/i386/int86.h similarity index 100% rename from include/ibm/int86.h rename to include/arch/i386/int86.h diff --git a/include/ibm/interrupt.h b/include/arch/i386/interrupt.h similarity index 100% rename from include/ibm/interrupt.h rename to include/arch/i386/interrupt.h diff --git a/include/ibm/memory.h b/include/arch/i386/memory.h similarity index 100% rename from include/ibm/memory.h rename to include/arch/i386/memory.h diff --git a/include/ibm/partition.h b/include/arch/i386/partition.h similarity index 100% rename from include/ibm/partition.h rename to include/arch/i386/partition.h diff --git a/include/ibm/pci.h b/include/arch/i386/pci.h similarity index 100% rename from include/ibm/pci.h rename to include/arch/i386/pci.h diff --git a/include/ibm/ports.h b/include/arch/i386/ports.h similarity index 100% rename from include/ibm/ports.h rename to include/arch/i386/ports.h diff --git a/include/sys/vm_i386.h b/include/arch/i386/vm.h similarity index 99% rename from include/sys/vm_i386.h rename to include/arch/i386/vm.h index 0124db54f..ef0ff79d5 100644 --- a/include/sys/vm_i386.h +++ b/include/arch/i386/vm.h @@ -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 diff --git a/include/minix/type.h b/include/minix/type.h index 4503cddb4..508c48dc4 100644 --- a/include/minix/type.h +++ b/include/minix/type.h @@ -179,7 +179,7 @@ struct kmessages { }; #include -#include +#include /* 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 index 000000000..08e8f0ad7 --- /dev/null +++ b/include/sys/Makefile @@ -0,0 +1,14 @@ +.include + +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 diff --git a/kernel/arch/i386/clock.c b/kernel/arch/i386/clock.c index f5a728143..220d55550 100644 --- a/kernel/arch/i386/clock.c +++ b/kernel/arch/i386/clock.c @@ -1,7 +1,7 @@ /* i386-specific clock functions. */ -#include +#include #include #include "../../kernel.h" diff --git a/kernel/arch/i386/do_int86.c b/kernel/arch/i386/do_int86.c index b65307059..d8f4d830b 100644 --- a/kernel/arch/i386/do_int86.c +++ b/kernel/arch/i386/do_int86.c @@ -8,7 +8,7 @@ #include "../../system.h" #include #include -#include +#include #include "proto.h" diff --git a/kernel/arch/i386/i8259.c b/kernel/arch/i386/i8259.c index afab1e213..13e6a867f 100644 --- a/kernel/arch/i386/i8259.c +++ b/kernel/arch/i386/i8259.c @@ -9,7 +9,7 @@ #include "../../proc.h" #include "proto.h" #include -#include +#include #define ICW1_AT 0x11 /* edge triggered, cascade, need ICW4 */ #define ICW1_PC 0x13 /* edge triggered, no cascade, need ICW4 */ diff --git a/kernel/arch/i386/include/archconst.h b/kernel/arch/i386/include/archconst.h index 62fc54084..3411845f2 100644 --- a/kernel/arch/i386/include/archconst.h +++ b/kernel/arch/i386/include/archconst.h @@ -2,8 +2,8 @@ #ifndef _I386_ACONST_H #define _I386_ACONST_H 1 -#include -#include +#include +#include #define NR_REMOTE_SEGS 3 /* # remote memory regions (variable) */ diff --git a/kernel/arch/i386/klib386.S b/kernel/arch/i386/klib386.S index 93b8a8f57..dd94d6a58 100644 --- a/kernel/arch/i386/klib386.S +++ b/kernel/arch/i386/klib386.S @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include "../../const.h" #include "sconst.h" diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index 742539502..dc05c8c78 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -9,7 +9,7 @@ #include #include -#include +#include #include "proto.h" #include "../../proto.h" diff --git a/kernel/arch/i386/mpx386.S b/kernel/arch/i386/mpx386.S index d5809252e..d58c5d8e0 100644 --- a/kernel/arch/i386/mpx386.S +++ b/kernel/arch/i386/mpx386.S @@ -46,7 +46,7 @@ /* sections */ -#include +#include #ifdef __ACK__ .text @@ -67,7 +67,7 @@ begbss: #include #include #include -#include +#include #include #include "../../const.h" #include "../../proc.h" diff --git a/kernel/arch/i386/system.c b/kernel/arch/i386/system.c index b05d00fea..0b57abd70 100644 --- a/kernel/arch/i386/system.c +++ b/kernel/arch/i386/system.c @@ -5,8 +5,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/kernel/system/do_sigreturn.c b/kernel/system/do_sigreturn.c index a0c751d6e..fe083635e 100644 --- a/kernel/system/do_sigreturn.c +++ b/kernel/system/do_sigreturn.c @@ -9,7 +9,7 @@ #include "../system.h" #include -#include +#include #include #if USE_SIGRETURN diff --git a/kernel/type.h b/kernel/type.h index d9e80519b..dfd29788f 100644 --- a/kernel/type.h +++ b/kernel/type.h @@ -2,7 +2,7 @@ #define TYPE_H #include -#include +#include typedef _PROTOTYPE( void task_t, (void) ); diff --git a/lib/csu/i386/crtso.S b/lib/csu/i386/crtso.S index 193853294..4bc54928c 100644 --- a/lib/csu/i386/crtso.S +++ b/lib/csu/i386/crtso.S @@ -6,7 +6,7 @@ /* simplistic. We simply check for some magic value, but there is no other */ /* way. */ -#include +#include .globl begtext, begdata, begbss diff --git a/lib/libc/arch/i386/misc/_cpufeature.c b/lib/libc/arch/i386/misc/_cpufeature.c index 90f48166d..8de5cc2ba 100644 --- a/lib/libc/arch/i386/misc/_cpufeature.c +++ b/lib/libc/arch/i386/misc/_cpufeature.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include int _cpufeature(int cpufeature) { diff --git a/man/man1/install.1 b/man/man1/install.1 index d76356f78..386b8a053 100644 --- a/man/man1/install.1 +++ b/man/man1/install.1 @@ -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 diff --git a/servers/ipc/inc.h b/servers/ipc/inc.h index f47202e41..38138a411 100644 --- a/servers/ipc/inc.h +++ b/servers/ipc/inc.h @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include diff --git a/servers/is/dmp_kernel.c b/servers/is/dmp_kernel.c index cf1fae81e..b0abd65bc 100644 --- a/servers/is/dmp_kernel.c +++ b/servers/is/dmp_kernel.c @@ -2,7 +2,7 @@ #include "inc.h" #include -#include +#include #include #include #include diff --git a/servers/vm/i386/memory.h b/servers/vm/i386/memory.h index 05af779f7..ee129b9ab 100644 --- a/servers/vm/i386/memory.h +++ b/servers/vm/i386/memory.h @@ -1,4 +1,4 @@ -#include +#include /* As visible from the user space process, where is the top of the * stack (first non-stack byte), when in paged mode? diff --git a/servers/vm/i386/pagefaults.h b/servers/vm/i386/pagefaults.h index d9aab9deb..4cdc9a61a 100644 --- a/servers/vm/i386/pagefaults.h +++ b/servers/vm/i386/pagefaults.h @@ -2,7 +2,7 @@ #ifndef _PAGEFAULTS_H #define _PAGEFAULTS_H 1 -#include +#include #define PFERR_NOPAGE(e) (!((e) & I386_VM_PFE_P)) #define PFERR_PROT(e) (((e) & I386_VM_PFE_P)) diff --git a/servers/vm/i386/pagetable.h b/servers/vm/i386/pagetable.h index 42fb7d7e6..4d17e798b 100644 --- a/servers/vm/i386/pagetable.h +++ b/servers/vm/i386/pagetable.h @@ -3,7 +3,7 @@ #define _PAGETABLE_H 1 #include -#include +#include #include "../vm.h" -- 2.44.0