diff --git a/common/include/Makefile.inc b/common/include/Makefile.inc new file mode 100644 index 000000000..d61058512 --- /dev/null +++ b/common/include/Makefile.inc @@ -0,0 +1,14 @@ +.include + +.PATH: ${MINIXSRCDIR}/common/include + +INCS+= minix/ansi.h minix/bitmap.h minix/callnr.h minix/com.h \ + minix/compiler.h minix/config.h minix/const.h minix/debug.h \ + minix/devio.h minix/ds.h minix/endpoint.h minix/gcov.h \ + minix/ioctl.h minix/ipc.h minix/ipcconst.h minix/keymap.h \ + minix/limits.h minix/minlib.h minix/portio.h minix/priv.h \ + minix/profile.h minix/rs.h minix/safecopies.h minix/sef.h \ + minix/spin.h minix/sys_config.h minix/sysinfo.h minix/syslib.h \ + minix/sysutil.h minix/timers.h minix/type.h minix/vm.h + + diff --git a/common/include/Makefile.termios.inc b/common/include/Makefile.termios.inc new file mode 100644 index 000000000..6346869e8 --- /dev/null +++ b/common/include/Makefile.termios.inc @@ -0,0 +1,6 @@ +.include + +.PATH: ${MINIXSRCDIR}/common/include + +INCS+= termios.h + diff --git a/common/include/arch/i386/Makefile.inc b/common/include/arch/i386/Makefile.inc new file mode 100644 index 000000000..0f20ddb2d --- /dev/null +++ b/common/include/arch/i386/Makefile.inc @@ -0,0 +1,8 @@ +.include +.PATH: ${MINIXSRCDIR}/common/include/arch/i386 + +INCS+= archtypes.h bios.h cmos.h cpu.h diskparm.h fpu.h int86.h \ + interrupt.h memory.h partition.h \ + pci.h pci_amd.h pci_intel.h pci_sis.h pci_via.h \ + ports.h stackframe.h vm.h elf.h + diff --git a/include/arch/i386/archtypes.h b/common/include/arch/i386/archtypes.h similarity index 100% rename from include/arch/i386/archtypes.h rename to common/include/arch/i386/archtypes.h diff --git a/include/arch/i386/bios.h b/common/include/arch/i386/bios.h similarity index 100% rename from include/arch/i386/bios.h rename to common/include/arch/i386/bios.h diff --git a/include/arch/i386/cmos.h b/common/include/arch/i386/cmos.h similarity index 100% rename from include/arch/i386/cmos.h rename to common/include/arch/i386/cmos.h diff --git a/include/arch/i386/cpu.h b/common/include/arch/i386/cpu.h similarity index 100% rename from include/arch/i386/cpu.h rename to common/include/arch/i386/cpu.h diff --git a/include/arch/i386/diskparm.h b/common/include/arch/i386/diskparm.h similarity index 100% rename from include/arch/i386/diskparm.h rename to common/include/arch/i386/diskparm.h diff --git a/include/arch/i386/elf.h b/common/include/arch/i386/elf.h similarity index 100% rename from include/arch/i386/elf.h rename to common/include/arch/i386/elf.h diff --git a/include/arch/i386/fpu.h b/common/include/arch/i386/fpu.h similarity index 100% rename from include/arch/i386/fpu.h rename to common/include/arch/i386/fpu.h diff --git a/include/arch/i386/int86.h b/common/include/arch/i386/int86.h similarity index 100% rename from include/arch/i386/int86.h rename to common/include/arch/i386/int86.h diff --git a/include/arch/i386/interrupt.h b/common/include/arch/i386/interrupt.h similarity index 100% rename from include/arch/i386/interrupt.h rename to common/include/arch/i386/interrupt.h diff --git a/include/arch/i386/memory.h b/common/include/arch/i386/memory.h similarity index 100% rename from include/arch/i386/memory.h rename to common/include/arch/i386/memory.h diff --git a/include/arch/i386/partition.h b/common/include/arch/i386/partition.h similarity index 100% rename from include/arch/i386/partition.h rename to common/include/arch/i386/partition.h diff --git a/include/arch/i386/pci.h b/common/include/arch/i386/pci.h similarity index 100% rename from include/arch/i386/pci.h rename to common/include/arch/i386/pci.h diff --git a/include/arch/i386/pci_amd.h b/common/include/arch/i386/pci_amd.h similarity index 100% rename from include/arch/i386/pci_amd.h rename to common/include/arch/i386/pci_amd.h diff --git a/include/arch/i386/pci_intel.h b/common/include/arch/i386/pci_intel.h similarity index 100% rename from include/arch/i386/pci_intel.h rename to common/include/arch/i386/pci_intel.h diff --git a/include/arch/i386/pci_sis.h b/common/include/arch/i386/pci_sis.h similarity index 100% rename from include/arch/i386/pci_sis.h rename to common/include/arch/i386/pci_sis.h diff --git a/include/arch/i386/pci_via.h b/common/include/arch/i386/pci_via.h similarity index 100% rename from include/arch/i386/pci_via.h rename to common/include/arch/i386/pci_via.h diff --git a/include/arch/i386/ports.h b/common/include/arch/i386/ports.h similarity index 100% rename from include/arch/i386/ports.h rename to common/include/arch/i386/ports.h diff --git a/include/arch/i386/stackframe.h b/common/include/arch/i386/stackframe.h similarity index 100% rename from include/arch/i386/stackframe.h rename to common/include/arch/i386/stackframe.h diff --git a/include/arch/i386/vm.h b/common/include/arch/i386/vm.h similarity index 100% rename from include/arch/i386/vm.h rename to common/include/arch/i386/vm.h diff --git a/include/minix/ansi.h b/common/include/minix/ansi.h similarity index 100% rename from include/minix/ansi.h rename to common/include/minix/ansi.h diff --git a/include/minix/bitmap.h b/common/include/minix/bitmap.h similarity index 100% rename from include/minix/bitmap.h rename to common/include/minix/bitmap.h diff --git a/include/minix/callnr.h b/common/include/minix/callnr.h similarity index 100% rename from include/minix/callnr.h rename to common/include/minix/callnr.h diff --git a/include/minix/com.h b/common/include/minix/com.h similarity index 100% rename from include/minix/com.h rename to common/include/minix/com.h diff --git a/include/minix/compiler.h b/common/include/minix/compiler.h similarity index 100% rename from include/minix/compiler.h rename to common/include/minix/compiler.h diff --git a/include/minix/config.h b/common/include/minix/config.h similarity index 100% rename from include/minix/config.h rename to common/include/minix/config.h diff --git a/include/minix/const.h b/common/include/minix/const.h similarity index 100% rename from include/minix/const.h rename to common/include/minix/const.h diff --git a/include/minix/debug.h b/common/include/minix/debug.h similarity index 100% rename from include/minix/debug.h rename to common/include/minix/debug.h diff --git a/include/minix/devio.h b/common/include/minix/devio.h similarity index 100% rename from include/minix/devio.h rename to common/include/minix/devio.h diff --git a/include/minix/ds.h b/common/include/minix/ds.h similarity index 100% rename from include/minix/ds.h rename to common/include/minix/ds.h diff --git a/include/minix/endpoint.h b/common/include/minix/endpoint.h similarity index 100% rename from include/minix/endpoint.h rename to common/include/minix/endpoint.h diff --git a/include/minix/gcov.h b/common/include/minix/gcov.h similarity index 100% rename from include/minix/gcov.h rename to common/include/minix/gcov.h diff --git a/include/minix/ioctl.h b/common/include/minix/ioctl.h similarity index 100% rename from include/minix/ioctl.h rename to common/include/minix/ioctl.h diff --git a/include/minix/ipc.h b/common/include/minix/ipc.h similarity index 100% rename from include/minix/ipc.h rename to common/include/minix/ipc.h diff --git a/include/minix/ipcconst.h b/common/include/minix/ipcconst.h similarity index 100% rename from include/minix/ipcconst.h rename to common/include/minix/ipcconst.h diff --git a/include/minix/keymap.h b/common/include/minix/keymap.h similarity index 100% rename from include/minix/keymap.h rename to common/include/minix/keymap.h diff --git a/include/minix/limits.h b/common/include/minix/limits.h similarity index 100% rename from include/minix/limits.h rename to common/include/minix/limits.h diff --git a/include/minix/minlib.h b/common/include/minix/minlib.h similarity index 100% rename from include/minix/minlib.h rename to common/include/minix/minlib.h diff --git a/include/minix/portio.h b/common/include/minix/portio.h similarity index 100% rename from include/minix/portio.h rename to common/include/minix/portio.h diff --git a/include/minix/priv.h b/common/include/minix/priv.h similarity index 100% rename from include/minix/priv.h rename to common/include/minix/priv.h diff --git a/include/minix/profile.h b/common/include/minix/profile.h similarity index 100% rename from include/minix/profile.h rename to common/include/minix/profile.h diff --git a/include/minix/rs.h b/common/include/minix/rs.h similarity index 100% rename from include/minix/rs.h rename to common/include/minix/rs.h diff --git a/include/minix/safecopies.h b/common/include/minix/safecopies.h similarity index 100% rename from include/minix/safecopies.h rename to common/include/minix/safecopies.h diff --git a/include/minix/sef.h b/common/include/minix/sef.h similarity index 100% rename from include/minix/sef.h rename to common/include/minix/sef.h diff --git a/include/minix/spin.h b/common/include/minix/spin.h similarity index 100% rename from include/minix/spin.h rename to common/include/minix/spin.h diff --git a/include/minix/sys_config.h b/common/include/minix/sys_config.h similarity index 100% rename from include/minix/sys_config.h rename to common/include/minix/sys_config.h diff --git a/include/minix/sysinfo.h b/common/include/minix/sysinfo.h similarity index 100% rename from include/minix/sysinfo.h rename to common/include/minix/sysinfo.h diff --git a/include/minix/syslib.h b/common/include/minix/syslib.h similarity index 100% rename from include/minix/syslib.h rename to common/include/minix/syslib.h diff --git a/include/minix/sysutil.h b/common/include/minix/sysutil.h similarity index 100% rename from include/minix/sysutil.h rename to common/include/minix/sysutil.h diff --git a/include/minix/timers.h b/common/include/minix/timers.h similarity index 100% rename from include/minix/timers.h rename to common/include/minix/timers.h diff --git a/include/minix/type.h b/common/include/minix/type.h similarity index 100% rename from include/minix/type.h rename to common/include/minix/type.h diff --git a/include/minix/vm.h b/common/include/minix/vm.h similarity index 100% rename from include/minix/vm.h rename to common/include/minix/vm.h diff --git a/common/include/sys/Makefile.inc b/common/include/sys/Makefile.inc new file mode 100644 index 000000000..780636f52 --- /dev/null +++ b/common/include/sys/Makefile.inc @@ -0,0 +1,7 @@ +.include + +.PATH: ${MINIXSRCDIR}/common/include/sys + +INCS+= ioc_cmos.h ioc_file.h ioc_scsi.h ioc_tape.h \ + ioc_disk.h ioc_memory.h ioc_sound.h ioc_tty.h + diff --git a/common/include/sys/Makefile.mount.inc b/common/include/sys/Makefile.mount.inc new file mode 100644 index 000000000..5d7e34c4b --- /dev/null +++ b/common/include/sys/Makefile.mount.inc @@ -0,0 +1,5 @@ +.include + +.PATH: ${MINIXSRCDIR}/common/include/sys + +INCS+= mount.h diff --git a/include/sys/ioc_cmos.h b/common/include/sys/ioc_cmos.h similarity index 100% rename from include/sys/ioc_cmos.h rename to common/include/sys/ioc_cmos.h diff --git a/include/sys/ioc_disk.h b/common/include/sys/ioc_disk.h similarity index 100% rename from include/sys/ioc_disk.h rename to common/include/sys/ioc_disk.h diff --git a/include/sys/ioc_file.h b/common/include/sys/ioc_file.h similarity index 100% rename from include/sys/ioc_file.h rename to common/include/sys/ioc_file.h diff --git a/include/sys/ioc_memory.h b/common/include/sys/ioc_memory.h similarity index 100% rename from include/sys/ioc_memory.h rename to common/include/sys/ioc_memory.h diff --git a/include/sys/ioc_scsi.h b/common/include/sys/ioc_scsi.h similarity index 100% rename from include/sys/ioc_scsi.h rename to common/include/sys/ioc_scsi.h diff --git a/include/sys/ioc_sound.h b/common/include/sys/ioc_sound.h similarity index 100% rename from include/sys/ioc_sound.h rename to common/include/sys/ioc_sound.h diff --git a/include/sys/ioc_tape.h b/common/include/sys/ioc_tape.h similarity index 100% rename from include/sys/ioc_tape.h rename to common/include/sys/ioc_tape.h diff --git a/include/sys/ioc_tty.h b/common/include/sys/ioc_tty.h similarity index 100% rename from include/sys/ioc_tty.h rename to common/include/sys/ioc_tty.h diff --git a/include/sys/mount.h b/common/include/sys/mount.h similarity index 100% rename from include/sys/mount.h rename to common/include/sys/mount.h diff --git a/include/termios.h b/common/include/termios.h similarity index 100% rename from include/termios.h rename to common/include/termios.h diff --git a/include/Makefile b/include/Makefile index f38e4e8e6..1a808df3d 100644 --- a/include/Makefile +++ b/include/Makefile @@ -7,29 +7,26 @@ INCS= alloca.h a.out.h ar.h assert.h configfile.h ctype.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 stdbool.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 \ + syslog.h tar.h termcap.h time.h timers.h tools.h \ ttyent.h ucontext.h unistd.h utime.h utmp.h wchar.h wctype.h \ hgfs.h tzfile.h util.h fetch.h mpool.h ndbm.h db.h poll.h resolv.h \ memory.h paths.h libexec.h complex.h INCS+= arpa/inet.h arpa/nameser.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 \ +INCS+= minix/a.out.h minix/cdrom.h minix/cpufeature.h \ + minix/crtso.h minix/dirent.h \ minix/dir.h minix/dl_eth.h minix/dmap.h minix/driver.h \ - minix/limits.h \ minix/acpi.h \ - minix/drivers.h minix/drvlib.h minix/ds.h minix/endpoint.h \ - minix/fslib.h minix/ioctl.h minix/ipc.h minix/ipcconst.h \ - minix/keymap.h minix/minlib.h minix/mq.h minix/mthread.h \ + minix/drivers.h minix/drvlib.h \ + minix/fslib.h \ + minix/mq.h minix/mthread.h \ minix/netdriver.h minix/partition.h \ - minix/portio.h minix/priv.h minix/procfs.h minix/profile.h \ + minix/procfs.h \ minix/queryparam.h \ - minix/rs.h minix/safecopies.h minix/sched.h minix/sef.h minix/sound.h \ - minix/spin.h minix/sys_config.h minix/sysinfo.h minix/syslib.h \ - minix/sysutil.h minix/timers.h minix/tty.h minix/type.h minix/types.h \ - minix/u64.h minix/vfsif.h minix/vm.h minix/vtreefs.h minix/gcov.h \ - minix/compiler.h minix/compiler-ack.h minix/sha2.h minix/sha1.h minix/md5.h \ - minix/audio_fw.h minix/hash.h minix/input.h minix/ansi.h + minix/sched.h minix/sound.h \ + minix/tty.h minix/types.h \ + minix/u64.h minix/vfsif.h minix/vtreefs.h \ + minix/compiler-ack.h minix/sha2.h minix/sha1.h minix/md5.h \ + minix/audio_fw.h minix/hash.h minix/input.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 \ @@ -47,6 +44,9 @@ INCS+= netinet/if_ether.h netinet/in.h netinet/tcp.h INCSDIR= /usr/include +.include "../common/include/Makefile.inc" +.include "../common/include/Makefile.termios.inc" + SUBDIR= sys arch .include diff --git a/include/arch/i386/Makefile b/include/arch/i386/Makefile index 53a487c11..a5d660cfe 100644 --- a/include/arch/i386/Makefile +++ b/include/arch/i386/Makefile @@ -1,8 +1,7 @@ INCSDIR= /usr/include/i386 -INCS= archtypes.h bios.h cmos.h cpu.h diskparm.h fpu.h int86.h \ - interrupt.h mcontext.h memory.h partition.h \ - pci.h pci_amd.h pci_intel.h pci_sis.h pci_via.h \ - ports.h stackframe.h vm.h asm.h _align.h param.h elf.h +INCS+= _align.h asm.h mcontext.h param.h + +.include "../../../common/include/arch/i386/Makefile.inc" .include diff --git a/include/sys/Makefile b/include/sys/Makefile index 365dea16c..57d69588e 100644 --- a/include/sys/Makefile +++ b/include/sys/Makefile @@ -2,9 +2,8 @@ INCSDIR= /usr/include/sys -INCS= asynchio.h dir.h file.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 \ +INCS= asynchio.h dir.h file.h \ + ioctl.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 statfs.h statvfs.h stat.h svrctl.h timeb.h \ @@ -12,4 +11,7 @@ INCS= asynchio.h dir.h file.h ioc_cmos.h ioc_disk.h \ utsname.h video.h vm.h wait.h cdefs.h null.h poll.h \ elf32.h elf64.h elf_common.h elf_generic.h +.include "../../common/include/sys/Makefile.inc" +.include "../../common/include/sys/Makefile.mount.inc" + .include diff --git a/kernel/Makefile b/kernel/Makefile index d737ea937..1df57137e 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -56,7 +56,7 @@ extracted-mfield.h: extract-mfield.sh ../lib/libc/other/*.c ../lib/libc/posix/*. ${_MKTARGET_CREATE} cd ${.CURDIR} ; sh extract-mfield.sh > ${.OBJDIR}/extracted-mfield.h -extracted-mtype.h: extract-mtype.sh ../include/minix/com.h +extracted-mtype.h: extract-mtype.sh ../common/include/minix/com.h ${_MKTARGET_CREATE} cd ${.CURDIR} ; sh extract-mtype.sh > ${.OBJDIR}/extracted-mtype.h diff --git a/kernel/extract-mtype.sh b/kernel/extract-mtype.sh index 3322ad83c..47507f616 100644 --- a/kernel/extract-mtype.sh +++ b/kernel/extract-mtype.sh @@ -4,12 +4,12 @@ set -e # grep message type constants and make them into a .h file ( - cat ../include/minix/callnr.h | \ + cat ../common/include/minix/callnr.h | \ tr -s ' \t' ' ' | \ sed 's/^# /#/' | \ egrep '^#define [A-Z_][A-Z0-9_]* [0-9]+' | grep -v NCALLS - cat ../include/minix/com.h | \ + cat ../common/include/minix/com.h | \ tr -s ' \t' ' ' | \ sed 's/^# /#/' | \ egrep '^#define [A-Z_][A-Z0-9_]* \( ?([A-Z0-9_]+_BASE|KERNEL_CALL) ?\+[A-Za-z0-9_ +]+\)'