]> Zhao Yanbai Git Server - minix.git/commitdiff
Convert drivers/ and servers/ over to bsdmake
authorArun Thomas <arun@minix3.org>
Mon, 22 Mar 2010 21:25:22 +0000 (21:25 +0000)
committerArun Thomas <arun@minix3.org>
Mon, 22 Mar 2010 21:25:22 +0000 (21:25 +0000)
-Move libdriver to lib/
-Install all boot image services on filesystem to aid restartability

182 files changed:
Makefile
commands/pax/Makefile
drivers/Makefile
drivers/amddev/Makefile
drivers/at_wini/Makefile
drivers/at_wini/at_wini.h
drivers/atl2/Makefile
drivers/atl2/atl2.c
drivers/audio/Makefile
drivers/audio/Makefile.inc [new file with mode: 0644]
drivers/audio/README
drivers/audio/common/Makefile [new file with mode: 0644]
drivers/audio/common/audio_fw.c [moved from drivers/audio/framework/audio_fw.c with 100% similarity]
drivers/audio/common/audio_fw.h [moved from drivers/audio/framework/audio_fw.h with 99% similarity]
drivers/audio/common/liveupdate.c [moved from drivers/audio/framework/liveupdate.c with 100% similarity]
drivers/audio/es1370/AC97.h [moved from drivers/audio/AC97.h with 100% similarity]
drivers/audio/es1370/Makefile
drivers/audio/es1370/ak4531.h
drivers/audio/es1370/es1370.c
drivers/audio/es1370/es1370.h
drivers/audio/es1370/pci_helper.c
drivers/audio/es1371/Makefile
drivers/audio/es1371/es1371.c
drivers/audio/es1371/es1371.h
drivers/audio/es1371/pci_helper.c
drivers/audio/es1371/wait.c
drivers/audio/framework/Makefile [deleted file]
drivers/audio/sb16/Makefile
drivers/audio/sb16/sb16.h
drivers/bios_wini/Makefile
drivers/bios_wini/bios_wini.c
drivers/dec21140A/Makefile
drivers/dec21140A/dec21140A.c
drivers/dp8390/3c503.c
drivers/dp8390/Makefile
drivers/dp8390/dp8390.c
drivers/dp8390/ne2000.c
drivers/dp8390/rtl8029.c
drivers/dp8390/wdeth.c
drivers/dpeth/3c501.c
drivers/dpeth/3c503.c
drivers/dpeth/3c509.c
drivers/dpeth/8390.c
drivers/dpeth/Makefile
drivers/dpeth/devio.c
drivers/dpeth/dp.c
drivers/dpeth/ne.c
drivers/dpeth/netbuff.c
drivers/dpeth/wd.c
drivers/e1000/Makefile
drivers/e1000/e1000.c
drivers/e1000/e1000.h
drivers/filter/Makefile
drivers/floppy/Makefile
drivers/floppy/floppy.h
drivers/fxp/Makefile
drivers/fxp/fxp.c
drivers/fxp/mii.c
drivers/hello/Makefile
drivers/hello/hello.c
drivers/lance/Makefile
drivers/lance/lance.c
drivers/libdriver/Makefile [deleted file]
drivers/log/Makefile
drivers/log/log.h
drivers/memory/Makefile
drivers/memory/imgrd_s.s [deleted file]
drivers/memory/memory_driver/Makefile [new file with mode: 0644]
drivers/memory/memory_driver/imgrd.c [moved from drivers/memory/imgrd.c with 84% similarity]
drivers/memory/memory_driver/local.h [moved from drivers/memory/local.h with 100% similarity]
drivers/memory/memory_driver/memory.c [moved from drivers/memory/memory.c with 98% similarity]
drivers/memory/ramdisk/Makefile
drivers/orinoco/Makefile
drivers/orinoco/hermes.h
drivers/orinoco/orinoco.c
drivers/pci/Makefile
drivers/pci/main.c
drivers/pci/pci.c
drivers/pci/pci_table.c
drivers/printer/Makefile
drivers/printer/liveupdate.c
drivers/printer/printer.c
drivers/random/Makefile
drivers/random/main.c
drivers/random/random.c
drivers/readclock/Makefile
drivers/rtl8139/Makefile
drivers/rtl8139/rtl8139.h
drivers/rtl8169/Makefile
drivers/rtl8169/rtl8169.c
drivers/sb16/Makefile
drivers/sb16/Makefile.inc [new file with mode: 0644]
drivers/sb16/common/Makefile [new file with mode: 0644]
drivers/sb16/common/sb16.c [moved from drivers/sb16/sb16.c with 100% similarity]
drivers/sb16/common/sb16.h [moved from drivers/sb16/sb16.h with 99% similarity]
drivers/sb16/dsp/Makefile [new file with mode: 0644]
drivers/sb16/dsp/sb16_dsp.c [moved from drivers/sb16/sb16_dsp.c with 100% similarity]
drivers/sb16/dsp/sb16_dsp_liveupdate.c [moved from drivers/sb16/sb16_dsp_liveupdate.c with 100% similarity]
drivers/sb16/mixer/Makefile [new file with mode: 0644]
drivers/sb16/mixer/sb16_mixer.c [moved from drivers/sb16/sb16_mixer.c with 100% similarity]
drivers/ti1225/Makefile
drivers/ti1225/ti1225.c
drivers/tty/Makefile
drivers/tty/console.c
drivers/tty/keyboard.c
drivers/tty/keymaps/Makefile
drivers/tty/keymaps/Makefile.inc [new file with mode: 0644]
drivers/tty/pty.c
drivers/tty/rs232.c
drivers/tty/tty.c
etc/mk/minix.lib.mk
etc/mk/minix.own.mk
etc/mk/minix.prog.mk
etc/mk/minix.sys.mk
etc/mk/sys.mk
include/Makefile
include/minix/driver.h [moved from drivers/libdriver/driver.h with 100% similarity]
include/minix/drivers.h [moved from drivers/drivers.h with 90% similarity]
include/minix/drvlib.h [moved from drivers/libdriver/drvlib.h with 100% similarity]
lib/Makefile
lib/libdriver/Makefile [new file with mode: 0644]
lib/libdriver/driver.c [moved from drivers/libdriver/driver.c with 99% similarity]
lib/libdriver/drvlib.c [moved from drivers/libdriver/drvlib.c with 99% similarity]
lib/libdriver/mq.c [moved from drivers/libdriver/mq.c with 100% similarity]
servers/Makefile
servers/ds/Makefile
servers/hgfs/Makefile
servers/hgfs/Makefile.inc [new file with mode: 0644]
servers/hgfs/hgfs_server/Makefile [new file with mode: 0644]
servers/hgfs/hgfs_server/const.h [moved from servers/hgfs/const.h with 100% similarity]
servers/hgfs/hgfs_server/dentry.c [moved from servers/hgfs/dentry.c with 100% similarity]
servers/hgfs/hgfs_server/glo.h [moved from servers/hgfs/glo.h with 100% similarity]
servers/hgfs/hgfs_server/handle.c [moved from servers/hgfs/handle.c with 100% similarity]
servers/hgfs/hgfs_server/inc.h [moved from servers/hgfs/inc.h with 96% similarity]
servers/hgfs/hgfs_server/inode.c [moved from servers/hgfs/inode.c with 100% similarity]
servers/hgfs/hgfs_server/inode.h [moved from servers/hgfs/inode.h with 100% similarity]
servers/hgfs/hgfs_server/link.c [moved from servers/hgfs/link.c with 100% similarity]
servers/hgfs/hgfs_server/lookup.c [moved from servers/hgfs/lookup.c with 100% similarity]
servers/hgfs/hgfs_server/main.c [moved from servers/hgfs/main.c with 100% similarity]
servers/hgfs/hgfs_server/misc.c [moved from servers/hgfs/misc.c with 100% similarity]
servers/hgfs/hgfs_server/mount.c [moved from servers/hgfs/mount.c with 100% similarity]
servers/hgfs/hgfs_server/name.c [moved from servers/hgfs/name.c with 100% similarity]
servers/hgfs/hgfs_server/optset.c [moved from servers/hgfs/optset.c with 100% similarity]
servers/hgfs/hgfs_server/optset.h [moved from servers/hgfs/optset.h with 100% similarity]
servers/hgfs/hgfs_server/path.c [moved from servers/hgfs/path.c with 100% similarity]
servers/hgfs/hgfs_server/proto.h [moved from servers/hgfs/proto.h with 100% similarity]
servers/hgfs/hgfs_server/read.c [moved from servers/hgfs/read.c with 100% similarity]
servers/hgfs/hgfs_server/stat.c [moved from servers/hgfs/stat.c with 100% similarity]
servers/hgfs/hgfs_server/table.c [moved from servers/hgfs/table.c with 100% similarity]
servers/hgfs/hgfs_server/type.h [moved from servers/hgfs/type.h with 100% similarity]
servers/hgfs/hgfs_server/util.c [moved from servers/hgfs/util.c with 100% similarity]
servers/hgfs/hgfs_server/verify.c [moved from servers/hgfs/verify.c with 100% similarity]
servers/hgfs/hgfs_server/write.c [moved from servers/hgfs/write.c with 100% similarity]
servers/hgfs/libhgfs/Makefile
servers/hgfs/libhgfs/backdoor.S
servers/inet/Makefile
servers/inet/qp.c
servers/inet/queryparam.c [moved from servers/inet/minix3/queryparam.c with 99% similarity]
servers/inet/queryparam.h [moved from servers/inet/minix3/queryparam.h with 100% similarity]
servers/init/Makefile
servers/ipc/Makefile
servers/is/Makefile
servers/iso9660fs/Makefile
servers/mfs/Makefile
servers/pfs/Makefile
servers/pm/Makefile
servers/rs/Makefile
servers/rs/service/Makefile [new file with mode: 0644]
servers/rs/service/service.c [moved from servers/rs/service.c with 100% similarity]
servers/vfs/Makefile
servers/vm/Makefile
servers/vm/arch/i386/arch_pagefaults.c [moved from servers/vm/i386/arch_pagefaults.c with 92% similarity]
servers/vm/arch/i386/arch_vmproc.h [moved from servers/vm/i386/arch_vmproc.h with 100% similarity]
servers/vm/arch/i386/memory.h [moved from servers/vm/i386/memory.h with 100% similarity]
servers/vm/arch/i386/pagefaults.h [moved from servers/vm/i386/pagefaults.h with 100% similarity]
servers/vm/arch/i386/pagetable.c [moved from servers/vm/i386/pagetable.c with 99% similarity]
servers/vm/arch/i386/pagetable.h [moved from servers/vm/i386/pagetable.h with 98% similarity]
servers/vm/arch/i386/util.S [new file with mode: 0644]
servers/vm/arch/i386/vm.c [moved from servers/vm/i386/vm.c with 98% similarity]
servers/vm/i386/Makefile [deleted file]
servers/vm/i386/util.s [deleted file]
tools/Makefile

index 1e9699b5e41b3ed39d2e163e97c8e059896c99d1..a036544b511d2b044ab37535965a406ddd8fd5a3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -54,8 +54,6 @@ commands:
 
 depend::
        mkdep kernel
-       mkdep servers
-       mkdep drivers
        cd kernel && $(MAKE) $@
        cd servers && $(MAKE) $@
        cd drivers && $(MAKE) $@
@@ -68,6 +66,7 @@ all::
        cd commands && $(MAKE) all
        cd tools && $(MAKE) all
        cd servers && $(MAKE) all
+       cd drivers && $(MAKE) all
 
 install::
        cd boot && $(MAKE) all install
@@ -75,6 +74,7 @@ install::
        cd commands && $(MAKE) all install
        cd tools && $(MAKE) all install
        cd servers && $(MAKE) all install
+       cd drivers && $(MAKE) all install
 
 clean::
        cd boot && $(MAKE) clean
index 255f70e1502be7ec65e97510eb4202bf2064e966..7a7c2ad2c709999491f45fd3a20ce734df8a1add 100644 (file)
@@ -37,6 +37,5 @@ LINKS+= ${BINDIR}/pax ${BINDIR}/tar
 LINKS+= ${BINDIR}/pax ${BINDIR}/cpio
 
 CFLAGS+= -O -D_POSIX_SOURCE -DNET2_STAT=1 -D_MINIX=1
-LDFLAGS+= -i
 
 .include <minix.prog.mk>
index b72054051556f027c1729ed0f3b1b0ea86de3609..fdcd2dce9cca690d34e625298760c66bcb786ec8 100644 (file)
@@ -1,54 +1,15 @@
 # Makefile for all device drivers.
 #
-MAKE = exec make -$(MAKEFLAGS)
 
-usage:
-       @echo "" >&2
-       @echo "Makefile for all device drivers." >&2
-       @echo "Usage:" >&2
-       @echo " make build    # Compile all device drivers locally" >&2
-       @echo " make image    # Compile drivers in boot image" >&2
-       @echo " make clean    # Remove local compiler results" >&2
-       @echo " make install  # Install drivers to /etc/drivers/" >&2
-       @echo "                 (requires root privileges)" >&2
-       @echo "" >&2
+.include <minix.own.mk>
 
-build: all
-all install depend clean:
-       cd ./libdriver && $(MAKE) $@
-       cd ./tty && $(MAKE) $@
-       cd ./amddev && $(MAKE) $@
-       cd ./at_wini && $(MAKE) $@
-       cd ./audio && $(MAKE) $@
-       cd ./floppy && $(MAKE) $@
-       cd ./printer && $(MAKE) $@
-       cd ./rtl8139 && $(MAKE) $@
-       cd ./rtl8169 && $(MAKE) $@
-       cd ./orinoco && $(MAKE) $@
-       cd ./fxp && $(MAKE) $@
-       cd ./e1000 && $(MAKE) $@
-       cd ./dpeth && $(MAKE) $@
-       cd ./atl2 && $(MAKE) $@
-       cd ./log && $(MAKE) $@
-       cd ./bios_wini && $(MAKE) $@
-       cd ./filter && $(MAKE) $@
-       cd ./hello && $(MAKE) $@
-       cd ./random && $(MAKE) $@
-       cd ./readclock && $(MAKE) $@
-       cd ./dp8390 && $(MAKE) $@
-       cd ./sb16 && $(MAKE) $@
-       cd ./lance && $(MAKE) $@
-       cd ./dec21140A && $(MAKE) $@
-       cd ./pci && $(MAKE) $@
-       cd ./ti1225 && $(MAKE) $@
-       cd ./memory && $(MAKE) $@       # Must be last for ramdisk image
+# memory driver must be last for ramdisk image
+SUBDIR=        amddev atl2 at_wini audio bios_wini dec21140A dp8390 dpeth \
+       e1000 filter floppy fxp hello lance log orinoco pci printer \
+       random readclock rtl8139 rtl8169 sb16 ti1225 tty \
+       .WAIT memory
 
-image:
-       cd ./libdriver && $(MAKE) build
-       cd ./tty && $(MAKE) build
-       cd ./at_wini && $(MAKE) build
-       cd ./floppy && $(MAKE) build
-       cd ./bios_wini && $(MAKE) build
-       cd ./log && $(MAKE) build
-       cd ./pci && $(MAKE) build
-       cd ./memory && $(MAKE) build    # Must be last for ramdisk image
+# memory driver must be last for ramdisk image
+IMAGE_SUBDIR=  at_wini bios_wini floppy log tty pci .WAIT memory
+
+.include <minix.subdir.mk>
index 7a10e61567786677472e1a68516de25ebb71ef46..6ea1e8c27f82a4a3094bec5abecaeb94edbaab1e 100644 (file)
@@ -1,30 +1,12 @@
 # Makefile for AMD's DEV
-DRIVER = amddev
+PROG=  amddev
+SRCS=  amddev.c
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = $(CPROFILE)
-LDFLAGS = -i 
-LIBS = -lsys 
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-OBJ = amddev.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 320k $(DRIVER)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f *.o *.bak $(DRIVER)
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index b8494e1dc66a496ac924d8569bbb3337f4aacd87..e7a0e64b858dcab3dd1ca15288b9c8b038b2bce8 100644 (file)
@@ -1,41 +1,12 @@
 # Makefile for the AT disk driver (AT_WINI)
-DRIVER = at_wini
+PROG=  at_wini
+SRCS=  at_wini.c liveupdate.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
-p = ../libpci
+DPADD+=        ${LIBDRIVER} ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -ldriver -lsys -ltimers
 
-# programs, flags, etc.
-MAKE = exec make
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i -L../libdriver
-LIBS = -ldriver -lsys -ltimers 
-
-OBJ = at_wini.o liveupdate.o
-
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 32k $(DRIVER)
-
-# install with other drivers
-install:       /sbin/$(DRIVER)
-/sbin/$(DRIVER):       $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(DRIVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
+MAN=
 
+BINDIR?= /sbin
 
+.include <minix.prog.mk>
index 4f7fbd8eaf27348fc7a59e75566297f4992f2919..8654f9781c2645555fb5305d2c400705584b9222 100644 (file)
@@ -1,6 +1,6 @@
-#include "../drivers.h"
-#include "../libdriver/driver.h"
-#include "../libdriver/drvlib.h"
+#include <minix/drivers.h>
+#include <minix/driver.h>
+#include <minix/drvlib.h>
 
 #define VERBOSE                   0    /* display identify messages during boot */
 #define ENABLE_ATAPI      1    /* add ATAPI cd-rom support to driver */
index f3f392874d61ec059993c844f14bf6f254138a14..94b3b208ea1bc25a2a379e48400986c41ecadfc8 100644 (file)
@@ -1,36 +1,12 @@
 # Makefile for the Attansic/Atheros L2 ethernet driver (ATL2)
-DRIVER = atl2
+PROG=  atl2
+SRCS=  atl2.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-# programs, flags, etc.
-MAKE = exec make
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i
-LIBS = -lsys
+MAN=
 
-OBJ = atl2.o
+BINDIR?= /usr/sbin
 
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(DRIVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+.include <minix.prog.mk>
index 8e8f6f2d442b81f8e36e7b0bb6010aca12b0843b..3190117e3ea78fb4cf1fb8bfb9a9194c7b2c6d8f 100644 (file)
@@ -4,7 +4,7 @@
  * heavily on the official Linux driver; this driver is based heavily on both.
  */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <sys/mman.h>
 #include <minix/ds.h>
index 8e2b62e2c2aee3d446772d143fc059d12c69467f..2b765b0c63dd7238ef75d894c25e618bd2387179 100644 (file)
@@ -1,9 +1,7 @@
 # Makefile for all audio drivers.
-MAKE = exec make -$(MAKEFLAGS)
 
-build: all
+.include <minix.own.mk>
 
-all install depend clean:
-       cd ./es1370 && $(MAKE) $@
-       cd ./es1371 && $(MAKE) $@
+SUBDIR=        common .WAIT es1370 es1371 sb16
 
+.include <minix.subdir.mk>
diff --git a/drivers/audio/Makefile.inc b/drivers/audio/Makefile.inc
new file mode 100644 (file)
index 0000000..8bc08c9
--- /dev/null
@@ -0,0 +1,13 @@
+.include <minix.own.mk>
+
+LIBCOMMON != cd ${.CURDIR}/../common && ${PRINTOBJDIR}
+CPPFLAGS+=-I${.CURDIR}/../common
+DPADD+= ${LIBCOMMON}/libcommon.a
+LDADD+= -L${LIBCOMMON} -lcommon
+
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
+
+.if exists(${.CURDIR}/../../Makefile.inc)
+.include "${.CURDIR}/../../Makefile.inc"
+.endif
index eb0d633115b85a753a6bc872b83d1435580224cd..a7f79249e46bc121cd42fffd450a26737ebc4e45 100644 (file)
@@ -1,7 +1,7 @@
 ***** Minix 3 Audio drivers *****
 
 Directories:
-framework/         Generic driver framework
+common/            Generic driver framework
 es1370/            ES1370 driver
 es1371/            ES1371 driver
 
diff --git a/drivers/audio/common/Makefile b/drivers/audio/common/Makefile
new file mode 100644 (file)
index 0000000..7e3f2e7
--- /dev/null
@@ -0,0 +1,8 @@
+# Makefile for the common audio framework
+
+LIBISPRIVATE=   yes
+
+LIB=    common
+SRCS=   audio_fw.c liveupdate.c
+
+.include <minix.lib.mk>
similarity index 99%
rename from drivers/audio/framework/audio_fw.h
rename to drivers/audio/common/audio_fw.h
index ea3b6e7a182c6af00c730d45eea73a8080ada853..dd18704c493ceee3e48c47447d9dc2e2c19fbd54 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef AUDIO_FW_H
 #define AUDIO_FW_H
 
-#include "../../drivers.h"
+#include <minix/drivers.h>
 #include <sys/ioc_sound.h>
 
 
index c6f2d6a3404ee660684385bce15ae9c770d1ef6b..eb237c5962ca1318f231923d514ba1bcc4833f48 100644 (file)
@@ -1,37 +1,9 @@
 # Makefile for the ES1371 sounddriver (SB16)
+PROG=  es1370
+SRCS=  es1370.c ak4531.c pci_helper.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-gen_drv_dir = ../../gen_drivers/cyclic_dma
-
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i
-LDFLAGS = -i
-LIBS = -lsys
-
-# build local binary
-all:   es1370
-
-es1370:        es1370.o ak4531.o audio_fw.o liveupdate.o pci_helper.o
-       $(CC) -o $@ $(LDFLAGS) es1370.o ak4531.o audio_fw.o liveupdate.o pci_helper.o $(LIBS)
-
-audio_fw.o liveupdate.o: ../framework/audio_fw.c ../framework/liveupdate.c ../framework/audio_fw.h
-       $(CC) -c ../framework/audio_fw.c ../framework/liveupdate.c
-       
-install: /usr/sbin/es1370
-/usr/sbin/es1370:      es1370
-       install -o root -S 1024k -c $? $@
-
-# clean up local files
-clean:
-       rm -f *.o *.bak core es1370
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index 561da2ec72bb0a737ea0418fd24b4fa8eb973bd3..a5e4e4ee3b4d0d927756332a46d8e0c436fcce0e 100644 (file)
@@ -2,7 +2,7 @@
 #define AK4531_H
 /* best viewed with tabsize=4 */
 
-#include "../../drivers.h"
+#include <minix/drivers.h>
 #include <minix/sound.h>
 
 _PROTOTYPE( int ak4531_init, (u16_t base, u16_t status_reg, u16_t bit, 
index aacfad3fe9841bb94158cc52b20ccfda4333ff25..bcef008e22bfafd9ba8102814807b60bc5f9a2b7 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <machine/pci.h>
 
-#include "../framework/audio_fw.h"
+#include "audio_fw.h"
 #include "es1370.h"
 #include "ak4531.h"
 #include "pci_helper.h"
index faabee25b808230a1cdfd1b8e3931b6efa3681ae..41a6a2e454d74b92386bff0e55f901dc56295727 100644 (file)
@@ -3,7 +3,7 @@
 /* best viewed with tabsize=4 */
 
 #include <sys/types.h>
-#include "../../drivers.h"
+#include <minix/drivers.h>
 #include <sys/ioc_sound.h>
 
 
index 8707f10eba993f87fd8c728cd521fbd17f3b8c39..d985e550a3b257cdd8030b87f6912e0fea91c4bf 100644 (file)
@@ -1,6 +1,6 @@
 /* best viewed with tabsize 4 */
 
-#include "../../drivers.h"
+#include <minix/drivers.h>
 
 #include <stdlib.h>
 #include <stdio.h>
index 8b6f2fdce706b341a883100a80b936962284cf21..4e7016127e743fae05a14b23ccc53cbac0c216dd 100644 (file)
@@ -1,54 +1,9 @@
 # Makefile for the ES1371 sounddriver (SB16)
+PROG=  es1371
+SRCS=  es1371.c AC97.c pci_helper.c wait.c sample_rate_converter.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-
-# programs, flags, etc.
-CC             = exec cc
-CFLAGS         = -I$i
-LDFLAGS = -i
-LIBS   = -lsys 
-
-PROGRAM_NAME   = es1371
-INSTALL_BIN            = /usr/sbin/$(PROGRAM_NAME)
-OBJ                            = es1371.o AC97.o audio_fw.o liveupdate.o pci_helper.o wait.o sample_rate_converter.o
-
-
-
-# build local binary
-all: $(PROGRAM_NAME)
-
-
-$(PROGRAM_NAME): $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-
-
-audio_fw.o liveupdate.o: ../framework/audio_fw.c ../framework/liveupdate.c ../framework/audio_fw.h
-       $(CC) -c ../framework/audio_fw.c ../framework/liveupdate.c
-       
-
-%.o: %.c
-       $(CC) $(CFLAGS) -c $<
-
-
-install: $(INSTALL_BIN)
-
-
-$(INSTALL_BIN):        $(PROGRAM_NAME)
-       install -o root -S 1024k -c $? $@
-
-
-# clean up local files
-clean:
-       rm -f $(OBJ) $(PROGRAM_NAME) core 
-
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
-
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index 63dbda91ced144552b714b19fddc717b929b5c17..a65a6d1c44ae356efad4a1edd4bac9f025520d9a 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <machine/pci.h>
 
-#include "../framework/audio_fw.h"
+#include "audio_fw.h"
 #include "es1371.h"
 #include "AC97.h"
 #include "sample_rate_converter.h"
index c3df787939656c6ea3af34ea5a122566f284b4c9..0395cbc19244ecba6d65f60bb3a0dc52cee34d4d 100644 (file)
@@ -3,7 +3,7 @@
 /* best viewed with tabsize=4 */
        
 #include <sys/types.h>
-#include "../../drivers.h"
+#include <minix/drivers.h>
 #include <sys/ioc_sound.h>
 #include <minix/sound.h>
 
index 50f7dabb271b3e7a0dcccd7689421a01433cb3d3..f25df86611f08cc8be24b7a642a4e3317ff04a58 100644 (file)
@@ -1,6 +1,6 @@
 /* best viewed with tabsize 4 */
 
-#include "../../drivers.h"
+#include <minix/drivers.h>
 
 #include <stdlib.h>
 #include <stdio.h>
index 7c3497e89365e536437176be6b336809adb05042..97145abe56d9faf401585cfefd5fb2fb12ead524 100644 (file)
@@ -1,4 +1,4 @@
-#include "../../drivers.h"
+#include <minix/drivers.h>
 #include <sys/types.h>
 #include "pci_helper.h"
 
diff --git a/drivers/audio/framework/Makefile b/drivers/audio/framework/Makefile
deleted file mode 100644 (file)
index c210c8d..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-CC =   exec cc
-
-all:   audio_fw.o liveupdate.o
-
-audio_fw.o liveupdate.o:
-       $(CC) -c audio_fw.c liveupdate.c
-
-clean:
-       rm -f a.out *.bak core errs audio_fw.o liveupdate.o
index f95bbb7e61c3c08f657bb7eec68b0fcc1c41cedf..415375223441fa4ac1258affc34ee9f5c33ab12d 100644 (file)
@@ -1,39 +1,9 @@
 # Makefile for the Sound Blaster 16 driver (SB16)
+PROG=  sb16
+SRCS=  sb16.c mixer.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
-
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i
-LDFLAGS = -i
-LIBS = -lsys 
-
-
-# build local binary
-all build:     sb16    
-
-sb16:  sb16.o mixer.o audio_fw.o liveupdate.o
-       $(CC) -o $@ $(LDFLAGS) sb16.o mixer.o audio_fw.o liveupdate.o $(LIBS)
-
-audio_fw.o liveupdate.o: ../framework/audio_fw.c ../framework/liveupdate.c ../framework/audio_fw.h
-       $(CC) -c ../framework/audio_fw.c ../framework/liveupdate.c
-
-# install with other drivers
-install:       /usr/sbin/sb16
-/usr/sbin/sb16:        sb16
-       install -o root -S 512k -c $? $@
-
-# clean up local files
-clean:
-       rm -f *.o *.bak sb16 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index 75ae7e25df0021bfed476346949ef4bc004f50ea..38b1843902ccd30a78fd40ee56911b694c275154 100644 (file)
@@ -2,7 +2,7 @@
 #define SB16_H
 
 #include <minix/sound.h>
-#include "../framework/audio_fw.h"
+#include "audio_fw.h"
 
 #define AUDIO 0
 #define MIXER 1
index 52ae04735ba197d4afa59fa42e4b5510922ecaba..2e584ad2e61287ffe1276c1ea90161d7472bd957 100644 (file)
@@ -1,39 +1,12 @@
 # Makefile for the BIOS disk driver (BIOS_WINI)
-DRIVER = bios_wini
+PROG=  bios_wini
+SRCS=  bios_wini.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBDRIVER} ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -ldriver -lsys -ltimers
 
-# programs, flags, etc.
-MAKE = exec make
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i -L../libdriver 
-LIBS = -ldriver    -lsys  -lsys -ltimers 
-
-OBJ = bios_wini.o 
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install $(DRIVER)
-
-# install with other drivers
-install:       /sbin/$(DRIVER)
-/sbin/$(DRIVER):       $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(DRIVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
+MAN=
 
+BINDIR?= /sbin
 
+.include <minix.prog.mk>
index 4088f607f271fd2d3447fd412d77b9ce264a4a9a..c9bb151430fc313782b33389463ca2d06d154b07 100644 (file)
@@ -20,9 +20,9 @@
  *     14 May 2000 by Kees J. Bot: d-d/i rewrite.
  */
 
-#include "../drivers.h"
-#include "../libdriver/driver.h"
-#include "../libdriver/drvlib.h"
+#include <minix/drivers.h>
+#include <minix/driver.h>
+#include <minix/drvlib.h>
 #include <minix/sysutil.h>
 #include <minix/safecopies.h>
 #include <sys/ioc_disk.h>
index 873b055166d44328427c38f47534a15a4bb0c353..a22fb4df76785deca4c0a503041130970bac26ac 100644 (file)
@@ -1,39 +1,17 @@
 ##
 ##  Makefile for Dec21140A ethernet board driver
 ##
+PROG=  dec21140A
+SRCS=  dec21140A.c
 
-##  Programs, flags, etc.
-DRIVER = dec21140A
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-debug  = 0
+MAN=
 
-CC     = exec cc
-LD     = $(CC)
-CPPFLAGS= -I.. -I/usr/include -Ddebug=$(debug) $(CPROFILE)
-CFLAGS = -ws -w -Wall $(CPPFLAGS)
-LDFLAGS        = -i -o $@
+BINDIR?= /usr/sbin
 
-SRCS   = dec21140A.c
-OBJS   = dec21140A.o
-LIBS   =  -lsys # -ltimers
+debug=         0
+CPPFLAGS+=     -Ddebug=${debug} -ws -w -Wall
 
-##  Build rules
-all build:     $(DRIVER)
-
-$(DRIVER):     $(OBJS)
-       $(CC) $(OBJS) $(LIBS) $(LDFLAGS)
-       install -S 16k $(DRIVER)
-
-##  Install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-##  Generate dependencies
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
-
-##  Clean directory
-clean:
-       @rm -f $(DRIVER) *.o *.BAK *~
+.include <minix.prog.mk>
index cf5589dbe63202c294174b7ccd6ac907905be21c..e8074759f750c329d611323c6d8488ea7d18808a 100644 (file)
@@ -9,7 +9,7 @@
  * Created:    Mar 2008 by Nicolas Tittley <first.last@ google's mail>
  */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <assert.h>
 #include <machine/pci.h>
index 6cda18a900abec77b9bc4f50a33b8f38b79e938e..09d86b353a8460018a19214709dc5582107741d2 100644 (file)
@@ -11,7 +11,7 @@
  *     I/O could be used as well but would result in poor performance.
  */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
index 79c33642fe0f501cc66cab3d5823b31e992441e1..68bd5eeea033bdf49d92511cb426f9c0f90feabe 100644 (file)
@@ -1,38 +1,12 @@
 # Makefile for dp8390 driver
-DRIVER = dp8390
+PROG=  dp8390
+SRCS=  3c503.c dp8390.c ne2000.c rtl8029.c wdeth.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i 
-LIBS = -lsys -ltimers
-
-OBJ = 3c503.o dp8390.o ne2000.o rtl8029.o wdeth.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 64k $(DRIVER)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f *.o *.bak $(DRIVER)
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index 08d4588760040b248b822171242cc89fe3e2031f..cd1694628b77b2ccdb03ef47cfb5b6232bbcead7 100644 (file)
@@ -52,7 +52,7 @@
  *     Added support for 3c503 boards.
  */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <stdlib.h>
 #include <minix/com.h>
index 0b678d4ff37c600434de175df1ecd9b8b5337915..fc1c75126c5247d1a6795d8a0bcb5ad06c83f07f 100644 (file)
@@ -7,7 +7,7 @@ specific code, the rest is in dp8390.c
 Created:       March 15, 1994 by Philip Homburg <philip@f-mnx.phicoh.com>
 */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
index f519868d5e42b5bbe90ef932999e18a3e1c1a8f9..e5885abc1a1aaa764a05bcd3d33473a0d6a1a255 100644 (file)
@@ -6,7 +6,7 @@ Initialization of PCI DP8390-based ethernet cards
 Created:       April 2000 by Philip Homburg <philip@f-mnx.phicoh.com>
 */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <stdlib.h>
 #include <sys/types.h>
index 52747f17370b99e017b6997a5000e78bec7cb696..b5a54460e81b439c7935d6731ac1679afad61c81 100644 (file)
@@ -4,7 +4,7 @@ wdeth.c
 Created:       March 14, 1994 by Philip Homburg
 */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
index d2e802ea7ee0e4d21fbb632065c831fdd70a2970..e5556fefbb610edbee42a6de5ff315069f6b8436 100644 (file)
@@ -11,7 +11,7 @@
 **  $Id$
 */
 
-#include "drivers.h"
+#include <minix/drivers.h>
 #include <minix/com.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
index 631ce110f4c5a24b72b29ed854dd703d062cd9bc..71895eb402310928e80920c7ee32224dfbad2b68 100644 (file)
@@ -11,7 +11,7 @@
 **  $Id$
 */
 
-#include "drivers.h"
+#include <minix/drivers.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
 #include "dp.h"
index 98a753662637ec71497105632de49fa4fdddcd0d..9811537ba6bbea8b0971a04431fbb7b4b8d18cfe 100644 (file)
@@ -11,7 +11,7 @@
 **  $Id$
 */
 
-#include "drivers.h"
+#include <minix/drivers.h>
 #include <minix/com.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
index 74f887b3cce4f60497289bbc3460fad6fd425d06..d5e292627e5eb924ceb3f6240b6353cf1e6766c5 100644 (file)
@@ -13,7 +13,7 @@
 **  $Id$
 */
 
-#include "drivers.h"
+#include <minix/drivers.h>
 #include <minix/com.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
index 60475181c51b6aa6b24d2a30c2332c2b461080df..ba9e822dccba8d23d9025df9a32bfaaf92f575ab 100644 (file)
@@ -1,42 +1,17 @@
 ##
 ##  Makefile for ISA ethernet drivers  May  02, 2000
 ##
+PROG=  dpeth
+SRCS=  3c501.c 3c509.c 3c503.c ne.c wd.c 8390.c devio.c netbuff.c dp.c
 
-##  Programs, flags, etc.
-DRIVER = dpeth
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-debug  = 0
+MAN=
 
-CC     = exec cc
-LD     = $(CC)
-CPPFLAGS= -I.. -I/usr/include -Ddebug=$(debug) $(CPROFILE)
-CFLAGS = -ws $(CPPFLAGS)
-LDFLAGS        = -i -o $@
+BINDIR?= /usr/sbin
 
-SRCS   = 3c501.c 3c509.c 3c503.c ne.c wd.c 8390.c devio.c netbuff.c dp.c
-OBJS   = 3c501.o 3c509.o 3c503.o ne.o wd.o 8390.o devio.o netbuff.o dp.o
-LIBS   = -lsys
+debug=         0
+CPPFLAGS+=     -Ddebug=$(debug)
 
-##  Build rules
-all build:     $(DRIVER)
-
-$(DRIVER):     $(OBJS)
-       $(CC) $(OBJS) $(LIBS) $(LDFLAGS)
-       install -S 16k $(DRIVER)
-
-##  Install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-##  Generate dependencies
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
-
-##  Clean directory
-clean:
-       @rm -f $(DRIVER) *.o *.BAK
-
-
-##  end
+.include <minix.prog.mk>
index a2a5349cab4d4d8afb90929b35eeba1183f2c181..b5c708a92634517c0ee84e35f551afedefc52374 100644 (file)
@@ -9,7 +9,7 @@
 **  $Id$
 */
 
-#include "drivers.h"
+#include <minix/drivers.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
 #include "dp.h"
index 3f1eef2071adf34f9db7c48a0fde28f23f002526..37511e2e8030f37959a65c39d4734d0f0cfdedd6 100644 (file)
@@ -54,7 +54,7 @@
 **   DL_STAT_REPLY)
 */
 
-#include "drivers.h"
+#include <minix/drivers.h>
 #include <minix/endpoint.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
index b347b926e257bbf9bc5492141203ff8d7f9b6de6..eac7100bf2384ca06a1bcdc1ae540903afade2bf 100644 (file)
@@ -14,7 +14,7 @@
 **  $Id$
 */
 
-#include "drivers.h"
+#include <minix/drivers.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
 #include "dp.h"
index 2e40db004c2f90d3d1fa772f7cd50c875ba121a4..1fade31341b629aeec62eb2002396c57e1d8f532 100644 (file)
@@ -9,7 +9,7 @@
 **  $Id$
 */
 
-#include "drivers.h"
+#include <minix/drivers.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
 #include "dp.h"
index 6a7f156a566d0ed1c9cc20545488226c0febc5da..5e0ad2dc84e8313ee0f640855e3672bacf73e37a 100644 (file)
@@ -14,7 +14,7 @@
 **  $Id$
 */
 
-#include "drivers.h"
+#include <minix/drivers.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
 #include "dp.h"
index 127dfd88a4443674960b5d3c9b721b0552ac08af..04650d9b884b1a12379bf562e744711bf11a4262 100644 (file)
@@ -1,42 +1,14 @@
 #
 # Makefile for the Intel Pro/1000 driver.
 #
-DRIVER = e1000
+PROG=  e1000
+SRCS=  e1000.c
 
-#
-# Directories.
-#
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
-
-#
-# Build Programs, Flags and Variables.
-#
-CC      = exec cc
-CFLAGS  = -I$i $(CPROFILE)
-LDFLAGS = -i 
-LIBS    = -lsys -ltimers
-OBJ     = e1000.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 128k $(DRIVER)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
-# clean up local files
-clean:
-       rm -f *.o $(DRIVER)
+MAN=
 
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index 117784a99f50ac94193ed6d0a833710670b9d236..f53ea991ce64879037f2cdf7d77bed578f5a17b0 100644 (file)
@@ -5,7 +5,7 @@
  *        Gigabit Ethernet Controllers.
  */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 #include <stdlib.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
index 81ca445212a508bfa4cfe69b31f4a71fb99896b6..75f1017ab94686b88c0f731e2e833fbe4f777823 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef __E1000_H
 #define __E1000_H
 
-#include "../drivers.h" 
+#include <minix/drivers.h>
 #include <stdlib.h> 
 #include <net/hton.h> 
 #include <net/gen/ether.h> 
index 6ae37a588c4f508dfdb608d86fd8584a7ae12400..41425fedee16c3370e2974dac55ea9f57a078e4c 100644 (file)
@@ -1,29 +1,14 @@
 # Makefile for filter driver
-DRIVER = filter
+PROG=  filter
+SRCS=  main.c sum.c driver.c util.c optset.c crc.c md5.c
 
-# programs, flags, etc.
-CC = cc
-CFLAGS = -I.. -DDEBUG=1 -DDEBUG2=0
-LDFLAGS = 
-LIBS = -lsys
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-OBJ = main.o sum.o driver.o util.o optset.o crc.o md5.o
+MAN=
 
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -c $? $@
-
-# clean up local files
-clean:
-       rm -f *.o *.bak $(DRIVER)
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+BINDIR?= /usr/sbin
 
+CPPFLAGS+= -DDEBUG=1 -DDEBUG2=0
 
+.include <minix.prog.mk>
index 5747b463348bdd1cd54878fc3af50e00eb2d13b3..9b9d5d87ae513e2f72651dff796686c48072fbdb 100644 (file)
@@ -1,39 +1,12 @@
 # Makefile for the floppy disk driver (FLOPPY)
-DRIVER = floppy
+PROG=  floppy
+SRCS=  floppy.c liveupdate.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBDRIVER} ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -ldriver -lsys -ltimers
 
-# programs, flags, etc.
-MAKE = exec make
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i -L../libdriver
-LIBS = -ldriver -lsys  -ltimers
-
-OBJ = floppy.o liveupdate.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 16k $(DRIVER)
-
-# install with other drivers
-install:       /sbin/$(DRIVER)
-/sbin/$(DRIVER):       $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(DRIVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
+MAN=
 
+BINDIR?= /sbin
 
+.include <minix.prog.mk>
index 2bc0334b739044ad96abcbe728d978cf7e316c6f..4853818fd46e0df8848bb892ce5a38d769b82306 100644 (file)
@@ -1,4 +1,4 @@
-#include "../drivers.h"
-#include "../libdriver/driver.h"
-#include "../libdriver/drvlib.h"
+#include <minix/drivers.h>
+#include <minix/driver.h>
+#include <minix/drvlib.h>
 
index af4a37e26ae95755bf6f7ebfd4c0629f912152a0..e26523fa799643b94a57439f87bcf3dabb9147b4 100644 (file)
@@ -1,38 +1,12 @@
 # Makefile for Intel Pro/100 driver (FXP)
-DRIVER = fxp
+PROG=  fxp
+SRCS=  fxp.c mii.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i 
-LIBS = -lsys  -ltimers
-
-OBJ = fxp.o mii.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 128k $(DRIVER)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f *.o *.bak $(DRIVER)
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index d7e943db3e1ccd1e892ff25701c7907d7de7626e..f031261f67b3b28950c7d3f8955d021248bd6b8b 100644 (file)
@@ -52,7 +52,7 @@
  * Created:    Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
  */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <stdlib.h>
 #include <net/hton.h>
index 39d65641f99730ad13983079a723cbc783f3d8c9..b72765054cf0f55c8b78284c458f1a3396c52861 100644 (file)
@@ -6,7 +6,7 @@ Created:        Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
 Media Independent (Ethernet) Interface functions
 */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 #if __minix_vmd
 #include "config.h"
 #endif
index addbc5f6c0163faa2798a9662d537c1d71089943..e2fa502abfbb3b019eb95b58eee7b7d195d8553b 100644 (file)
@@ -1,44 +1,12 @@
-#
 # Makefile for the hello driver.
-#
-DRIVER = hello
+PROG=  hello
+SRCS=  hello.c
 
-#
-# Directories.
-#
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBDRIVER} ${LIBSYS}
+LDADD+=        -ldriver -lsys
 
-#
-# Build Programs, Flags and Variables.
-#
-CC      = exec cc
-CFLAGS  = -I$i $(CPROFILE)
-LDFLAGS = -i -L../libdriver
-LIBS    = -ldriver -lsys
-OBJ     = hello.o
+MAN=
 
-# build local binary
-all build:      $(DRIVER)
-$(DRIVER):      $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 128k $(DRIVER)
+BINDIR?= /usr/sbin
 
-# install with other drivers
-install:        /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):    $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f *.o $(DRIVER)
-
-depend:
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
-
-# Include generated dependencies.
-include .depend
\ No newline at end of file
+.include <minix.prog.mk>
index 129bceba5d5198f67683adc88f7df5f1121b79ce..dbcaff3f5723a56024b0f30bc0d6dfe57dcc3fa1 100644 (file)
@@ -1,5 +1,5 @@
-#include "../drivers.h"
-#include "../libdriver/driver.h"
+#include <minix/drivers.h>
+#include <minix/driver.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <minix/ds.h>
index ec7dd19b256f636a906609c3a073d36d35c873ac..f2c13efc3c4d04450e3cba5daccebae8202b1e40 100644 (file)
@@ -1,38 +1,12 @@
-# Makefile for Intel Pro/100 driver (FXP)
-DRIVER = lance
+# Makefile for Lance driver
+PROG=  lance
+SRCS=  lance.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i 
-LIBS =  -lsys 
-#-lutils -ltimers
+MAN=
 
-OBJ = lance.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 128k $(DRIVER)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f *.o *.bak $(DRIVER)
-
-depend:
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index 26d5456c89ed7a68d062eebc1741a4eef6550220..fe4976dd5b5ff066d198329ca84b7cd64d1286f3 100644 (file)
@@ -40,7 +40,7 @@
 #define VERBOSE 0 /* Verbose debugging output */
 #define LANCE_FKEY 0 /* Use function key to dump Lance stats */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <net/hton.h>
 #include <net/gen/ether.h>
diff --git a/drivers/libdriver/Makefile b/drivers/libdriver/Makefile
deleted file mode 100644 (file)
index c9b944d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# Makefile for driver library
-
-# Directories
-u = /usr
-i = $u/include
-s = $i/sys
-b = $i/ibm
-m = $i/minix
-
-# Programs, flags, etc.
-CC = exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i
-LIBS = -lsys
-LIB = libdriver.a
-
-OBJECTS = driver.o drvlib.o mq.o
-
-all build install: $(LIB)
-
-$(LIB): $(OBJECTS)     
-       ar rc $(LIB) $(OBJECTS)
-
-# $(CC) -c $@ $(LDFLAGS) $(OBJ) $(LIBS)
-
-clean:
-       rm -f *.o *.bak *.a
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
-
-
index 672e18ad93d52189f9d97b7da93f74171437f613..36f8b144557e789d229528d6fab278e921c27677 100644 (file)
@@ -1,39 +1,12 @@
 # Makefile for log driver
-DRIVER = log
+PROG=  log
+SRCS=  log.c diag.c liveupdate.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-d = ..
+DPADD+=        ${LIBDRIVER} ${LIBSYS}
+LDADD+=        -ldriver -lsys
 
-# programs, flags, etc.
-MAKE = exec make
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i -L../libdriver
-LIBS = -ldriver  -lsys 
-LIB_DEP = ../libdriver/libdriver.a
-
-OBJ = log.o diag.o liveupdate.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) $(LIB_DEP)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 32kb $(DRIVER)
-
-# install with other drivers
-install:       $(DRIVER)
-       install -o root -cs $(DRIVER) /sbin/$(DRIVER)
-
-# clean up local files
-clean:
-       rm -f $(DRIVER) *.o *.bak 
-
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
+MAN=
 
+BINDIR?= /sbin
 
+.include <minix.prog.mk>
index d180305073f0282725c0697b465f66323d8c300e..6cc5e4a0a9de2558725a4d87b00b0f018ae4f137 100644 (file)
@@ -1,6 +1,6 @@
 /* Includes. */
-#include "../drivers.h"
-#include "../libdriver/driver.h"
+#include <minix/drivers.h>
+#include <minix/driver.h>
 #include <minix/type.h>
 #include <minix/const.h>
 #include <minix/com.h>
index b124a4db9247ad0ed9fa07348071b6a2acc625ff..df986f13ef0bd7e00154fa39c152111241de85de 100644 (file)
@@ -1,56 +1,7 @@
-# Makefile for memory driver (MEMORY)
-DRIVER = memory
+# Makefile for memory driver and ramdisk
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
-
-# programs, flags, etc.
-MAKE = exec make
-CC =   exec cc
-CFLAGS = -I$i
-LDFLAGS = -i -L../libdriver
-LIBS =  -ldriver -lsys  
-
-# imgrd_s.s is the ACK assembler version of the ramdisk. For more portability,
-# use the C version imgrd.c. However, the C compiler takes too much memory
-# compiling imgrd.c.
-IMGRD=imgrd_s.o
-#IMGRD=imgrd.c
-
-OBJ = memory.o $(IMGRD)
-
-# build local binary
-all build:     $(DRIVER)
-
-$(DRIVER):     ramdisk_image $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 8k $(DRIVER)
-
-imgrd.o:        ramdisk/image.c
-
-imgrd_s.o:      ramdisk/image.s
-       TMPDIR=/usr/tmp $(CC) -T /usr/tmp -c imgrd_s.s
-
-ramdisk_image:
-       cd ramdisk && make
-
-# install with other drivers
-install: /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(DRIVER) *.o *.bak 
-       cd ramdisk && make clean
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" memory.c ../libdriver/*.c > .depend
-       cd ramdisk && make depend
+.include <minix.own.mk>
 
+SUBDIR=        ramdisk .WAIT memory_driver
 
+.include <minix.subdir.mk>
diff --git a/drivers/memory/imgrd_s.s b/drivers/memory/imgrd_s.s
deleted file mode 100644 (file)
index 08e4e03..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-.sect .text; .sect .rom; .sect .data
-
-! export symbols
-.define _imgrd, _imgrd_size
-
-.sect .data
-_imgrd:
-0:
-#include "ramdisk/image.s"
-1:
-
-! Use local labels to compute the size of _imgrd.
-_imgrd_size:
-       .data4  [1b] - [0b]
diff --git a/drivers/memory/memory_driver/Makefile b/drivers/memory/memory_driver/Makefile
new file mode 100644 (file)
index 0000000..b149254
--- /dev/null
@@ -0,0 +1,17 @@
+# Makefile for memory driver (MEMORY)
+.include <minix.own.mk>
+
+PROG=  memory
+SRCS=  memory.c imgrd.c
+
+DPADD+=        ${LIBDRIVER} ${LIBSYS}
+LDADD+=        -ldriver -lsys
+
+MAN=
+
+BINDIR?= /usr/sbin
+
+CPPFLAGS.imgrd.c += -I${.CURDIR}/../ramdisk -T /usr/tmp
+
+.include <minix.prog.mk>
+.include <minix.subdir.mk>
similarity index 84%
rename from drivers/memory/imgrd.c
rename to drivers/memory/memory_driver/imgrd.c
index cc9bd85187de67008197beeffeeacc2293897271..947b7ffc300a6026b34f89ff90d0c20e40a51eac 100644 (file)
@@ -8,7 +8,7 @@ Ramdisk that is part of the image
 
 unsigned char imgrd[]=
 {
-#include "ramdisk/image.c"
+#include "image.c"
 };
 
 size_t imgrd_size= sizeof(imgrd);
similarity index 98%
rename from drivers/memory/memory.c
rename to drivers/memory/memory_driver/memory.c
index 8eaad90e26edf9df56c1ddd78e29ab108ad7fb04..92c4822ee80494e049a426c826e9561bfbfd4a04 100644 (file)
  *     Apr 20, 1992    device dependent/independent split  (Kees J. Bot)
  */
 
-#include "../drivers.h"
-#include "../libdriver/driver.h"
+#include <minix/drivers.h>
+#include <minix/driver.h>
 #include <sys/ioc_memory.h>
 #include <minix/ds.h>
 #include <minix/vm.h>
 #include <sys/mman.h>
-#include "../../kernel/const.h"
-#include "../../kernel/config.h"
-#include "../../kernel/type.h"
+#include "../../../kernel/const.h"
+#include "../../../kernel/config.h"
+#include "../../../kernel/type.h"
 
 #include <machine/vm.h>
 
index ea7a043f52610f16275f1d879e4ec49c98a914ef..ff9ee3a00f8f0a03e4d5cc0dd5ec89ded934b96d 100644 (file)
@@ -6,17 +6,14 @@ EXTRA=system.conf passwd
 
 MAKEDEV=/usr/bin/MAKEDEV
 
-all:   image.c image.s
+all:   image.c
 
 clean:
-       rm -rf $(PROGRAMS) $(EXTRA) bintoc image image.c image.s t proto.gen
+       rm -rf $(PROGRAMS) $(EXTRA) bintoc image image.c t proto.gen
 
 image.c:       bintoc image
        ./bintoc -o $@ image
 
-image.s:       image.c
-       sed < image.c > $@ 's/^/.data1 /;s/,$$//' || { rm -f $@; false; }
-
 # Note for cross compilation: this executable has to be compiled for the
 # host system
 bintoc:        bintoc.c
@@ -85,8 +82,8 @@ sh:   ../../../commands/ash/sh
 ../../../commands/ash/sh: 
        cd ../../../commands/ash && make sh
 
-service: ../../../servers/rs/service
-       install -s ../../../servers/rs/$@ $@
+service: ../../../servers/rs/service/service
+       install -s ../../../servers/rs/service/$@ $@
 
 ../../../servers/rs/service: 
        cd ../../../servers/rs && make service
@@ -103,10 +100,7 @@ system.conf: ../../../etc/system.conf
 passwd: ../../../etc/passwd
        install -s ../../../etc/$@ $@
 
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
-
 proto.gen: $(MAKEDEV) proto.sh proto
        sh -e proto.sh >proto.gen
 
-
+.include <minix.prog.mk>
index 337dcc89dd60100b9b546116551e15777b45129d..3833e819a972423c150f6aa5d509bb288027f952 100644 (file)
@@ -1,40 +1,12 @@
 # Makefile for the Orinoco wireless card (Prism chipset)
-DRIVER = orinoco
-
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
-
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i
-LIBS = -lsys -ltimers
-
-OBJ = orinoco.o hermes.o
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 100kw $(DRIVER)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(DRIVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+PROG=  orinoco
+SRCS=  orinoco.c hermes.c
 
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index 9f43dd833cd4edf7edbf3d48bdc924f52637dd2f..38a79be9bec295badae7b10704978fc24141e299 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef _HERMES_H
 #define _HERMES_H
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 #include <net/gen/ether.h>
 #include <net/gen/eth_io.h>
 #include <net/hton.h>
index ef5f24625acf49d79296c72f7be2f9e3de7cbf64..138f3733fa3abcfc98b99f944f1df4b2d1dd40d3 100644 (file)
@@ -53,7 +53,7 @@
  *
  */
 
-#include       "../drivers.h" 
+#include       <minix/drivers.h>
 #include       <string.h>
 #include       <minix/syslib.h>
 #include       <minix/type.h>
index e655e56dc90a98e3d739199c11d585e34f247217..ce07655b6d757174dc55fad386e2aabfe440652c 100644 (file)
@@ -1,38 +1,12 @@
 # Makefile for PCI support
-DRIVER = pci
+PROG=  pci
+SRCS=  main.c pci.c pci_table.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
-# programs, flags, etc.
-CC =   cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i 
-LIBS =  -lsys -ltimers 
-
-OBJ = main.o pci.o pci_table.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 32k $(DRIVER)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f *.o *.bak $(DRIVER)
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index f96349dac3c4eec702b9fe4623d938c6cccdda26..d0b042546559537be58a80ae88dd1cf4768a28fc 100644 (file)
@@ -2,7 +2,7 @@
 main.c
 */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <minix/rs.h>
 #include <minix/endpoint.h>
index 5c8485c6ec8e5d484a16b336c9b353005bc2bd38..3dfb20f0b846c5a745d9d6de3963e4b9a7fca41f 100644 (file)
@@ -8,7 +8,7 @@ Configure devices on the PCI bus
 Created:       Jan 2000 by Philip Homburg <philip@cs.vu.nl>
 */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 #include <assert.h>
 #include <machine/pci.h>
 #include <machine/vm.h>
index 3f8702d5a96a5068c8920eb96c8fcee9d32d8065..0291a7574cb4740a91cd88b36f33d3bb02195b4c 100644 (file)
@@ -13,7 +13,7 @@ See the Linux PCI ID Repository <http://pciids.sourceforge.net/>.
  * 2004-08-08 (asw) add Intel 82371AB (0x8086, 0x7100) 
  */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 #include "pci.h"
 #if __minix_vmd
 #include "config.h"
index 5150b80737e6c7411b1856853ecce17a29a38d2c..215ac7b894da3e39c57e06e85620a9645659cbbc 100644 (file)
@@ -1,39 +1,12 @@
 # Makefile for Centronics printer driver (PRINTER)
-DRIVER = printer
+PROG=  printer
+SRCS=  printer.c liveupdate.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i
-LIBS =  -lsys
-
-OBJ = printer.o liveupdate.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install $(DRIVER)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -c $? $@
-#      install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f *.o *.bak $(DRIVER)
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index de040947ef2e1219608a48ba78cdbd0e6dd075e9..d0666d54805a6e549c398b833b787d296a1d9bbe 100644 (file)
@@ -1,4 +1,4 @@
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 /* State management variables. */
 EXTERN int writing;
index 152310a7d141a55332947199c69fd040d9ced9a5..6c25e49e7b13298fc2f843ce5e38735cb01c83ec 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 #include <minix/endpoint.h>
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 /* Control bits (in port_base + 2).  "+" means positive logic and "-" means
  * negative logic.  Most of the signals are negative logic on the pins but
index 81b52ec825796005a6d238ccbb41cac2ef922616..6287c5878025ccd370ce1c7343d82d4723cd228b 100644 (file)
@@ -1,47 +1,15 @@
 # Makefile for random driver (RANDOM)
-DRIVER = random
+PROG=  random
+SRCS=  main.c random.c sha2.c rijndael_api.c rijndael_alg.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+.PATH: ${.CURDIR}/aes
 
-# programs, flags, etc.
-MAKE = exec make
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i -L../libdriver
-LIBS =  -ldriver -lsys 
-LIB_DEPS=../libdriver/libdriver.a
+DPADD+=        ${LIBDRIVER} ${LIBSYS}
+LDADD+=        -ldriver -lsys
 
-OBJ = main.o random.o sha2.o aes/rijndael_api.o aes/rijndael_alg.o
+MAN=
 
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) $(LIB_DEPS)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 8k $(DRIVER)
-
-aes/rijndael_api.o:
-       $(CC) -c -o $@ aes/rijndael_api.c
-
-aes/rijndael_alg.o:
-       $(CC) -c -o $@ aes/rijndael_alg.c
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(DRIVER) *.o *.bak aes/*.o
-
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c aes/*.c > .depend
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
 
index 773e378480d6d8b837845088a683e650d1c665ca..7127729687902515470a6de17d3023b28ec612aa 100644 (file)
@@ -3,8 +3,8 @@
  *     /dev/random     - random number generator
  */
 
-#include "../drivers.h"
-#include "../libdriver/driver.h"
+#include <minix/drivers.h>
+#include <minix/driver.h>
 #include <minix/type.h>
 
 #include "assert.h"
index ad81e36764e2fc555bf91defb5c20121e4365ec4..bab0d330776836eeca6db592401629cbecc0fc70 100644 (file)
@@ -7,7 +7,7 @@ The random number generator collects data from the kernel and compressed
 that data into a seed for a psuedo random number generator.
 */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 #include "../../kernel/const.h"
 #include "assert.h"
 
index 193631198dc8a47340c3eb0305d29dca0f828546..984cbe6260b97dca0fc9a56b19d4270e46a983d9 100644 (file)
@@ -1,31 +1,14 @@
 # Makefile for readclock 'driver'
-DRIVER = readclock.drv
+PROG=  readclock.drv
+SRCS=  readclock.c
 
-# programs, flags, etc.
-MAKE = exec make
-CC =   exec cc
-CFLAGS=-D_MINIX=1 -D_POSIX_SOURCE=1 -D_SYSTEM=1
-LDFLAGS = -i
-LIBS =  -lsys
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-OBJ = readclock.o 
+MAN=
 
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install $(DRIVER)
-
-# install with other drivers
-install:       /sbin/$(DRIVER)
-/sbin/$(DRIVER):       $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(DRIVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+BINDIR?= /sbin
 
+CPPFLAGS+= -D_MINIX=1 -D_POSIX_SOURCE=1 -D_SYSTEM=1
 
+.include <minix.prog.mk>
index f9b2469ba4d3f9e6db69e7afcb2285db197cf49b..b83e12dc681e11731cddbb3e7c69166b39a860d3 100644 (file)
@@ -1,39 +1,12 @@
 # Makefile for the Realtek RTL8139 ethernet driver (RTL8139)
-DRIVER = rtl8139
+PROG=  rtl8139
+SRCS=  rtl8139.c liveupdate.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
-# programs, flags, etc.
-MAKE = exec make
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i
-LIBS = -lsys -ltimers 
-
-OBJ = rtl8139.o liveupdate.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 64kw $(DRIVER)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(DRIVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index d7076ee569e36d703c0998722ad9a72ab364a43d..c8a299a89c66c7e6b78256e60a02ae498e35e8cf 100644 (file)
@@ -4,7 +4,7 @@ ibm/rtl8139.h
 Created:       Aug 2003 by Philip Homburg <philip@cs.vu.nl>
 */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <stdlib.h>
 #include <stdio.h>
index a08159b2772ba7f686a5aaf74649804da1dd7067..dc1a68361d6c274659ea87f35f6820dcdaf92604 100644 (file)
@@ -1,39 +1,12 @@
 # Makefile for the Realtek RTL8169 ethernet driver (RTL8169)
-DRIVER = rtl8169
+PROG=  rtl8169
+SRCS=  rtl8169.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
-# programs, flags, etc.
-MAKE = exec make
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i
-LIBS = -lsys -ltimers
-
-OBJ = rtl8169.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 64kw $(DRIVER)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(DRIVER) *.o *.bak
-
-depend:
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index 0dd7992b762704f53a56ae28de7f510321488314..dfee1dddb7dbe03552f4c03caed1ed70c8f3aeee 100644 (file)
@@ -6,7 +6,7 @@
  *
  */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 
 #include <stdlib.h>
 #include <stdio.h>
index 59e749b3343f0cbafe1849645072db733ddbc676..ac1aac5b3e2110eb70bb25780af37416690645ed 100644 (file)
@@ -1,39 +1,7 @@
-# Makefile for the Sound Blaster 16 driver (SB16)
+# Makefile for the Sound Blaster 16 (SB16) driver
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
-
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i
-LIBS = -lsys
-
-
-# build local binary
-all build:     sb16_dsp sb16_mixer
-sb16_dsp:      sb16.o sb16_dsp.o sb16_dsp_liveupdate.o
-       $(CC) -o $@ $(LDFLAGS) sb16.o sb16_dsp.o sb16_dsp_liveupdate.o $(LIBS)
-sb16_mixer:    sb16.o sb16_mixer.o
-       $(CC) -o $@ $(LDFLAGS) sb16.o sb16_mixer.o $(LIBS)
-
-# install with other drivers
-install:       /usr/sbin/sb16_dsp /usr/sbin/sb16_mixer
-/usr/sbin/sb16_dsp:    sb16_dsp
-       install -o root -c $? $@
-/usr/sbin/sb16_mixer:  sb16_mixer
-       install -o root -c $? $@
-
-# clean up local files
-clean:
-       rm -f *.o *.bak sb16 sb16_dsp sb16_mixer
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+.include <minix.own.mk>
 
+SUBDIR=        common .WAIT dsp mixer
 
+.include <minix.subdir.mk>
diff --git a/drivers/sb16/Makefile.inc b/drivers/sb16/Makefile.inc
new file mode 100644 (file)
index 0000000..8bc08c9
--- /dev/null
@@ -0,0 +1,13 @@
+.include <minix.own.mk>
+
+LIBCOMMON != cd ${.CURDIR}/../common && ${PRINTOBJDIR}
+CPPFLAGS+=-I${.CURDIR}/../common
+DPADD+= ${LIBCOMMON}/libcommon.a
+LDADD+= -L${LIBCOMMON} -lcommon
+
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
+
+.if exists(${.CURDIR}/../../Makefile.inc)
+.include "${.CURDIR}/../../Makefile.inc"
+.endif
diff --git a/drivers/sb16/common/Makefile b/drivers/sb16/common/Makefile
new file mode 100644 (file)
index 0000000..8af3a80
--- /dev/null
@@ -0,0 +1,8 @@
+# Makefile for the Sound Blaster 16 (SB16) common
+
+LIBISPRIVATE=   yes
+
+LIB=    common
+SRCS=   sb16.c
+
+.include <minix.lib.mk>
similarity index 99%
rename from drivers/sb16/sb16.h
rename to drivers/sb16/common/sb16.h
index 958da237bba6dec39ec1aec82dcab1d4ffdd016a..0b1d4562f3c84d8f3d410f081a7e440f503bbdd3 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SB16_H
 #define SB16_H
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 #include <sys/ioc_sound.h>
 #include <minix/sound.h>
 
diff --git a/drivers/sb16/dsp/Makefile b/drivers/sb16/dsp/Makefile
new file mode 100644 (file)
index 0000000..43e75c2
--- /dev/null
@@ -0,0 +1,9 @@
+# Makefile for the Sound Blaster 16 (SB16) dsp
+PROG=  sb16_dsp
+SRCS=  sb16_dsp.c sb16_dsp_liveupdate.c
+
+MAN=
+
+BINDIR?= /usr/sbin
+
+.include <minix.prog.mk>
diff --git a/drivers/sb16/mixer/Makefile b/drivers/sb16/mixer/Makefile
new file mode 100644 (file)
index 0000000..28edb53
--- /dev/null
@@ -0,0 +1,9 @@
+# Makefile for the Sound Blaster 16 (SB16) mixer
+PROG=  sb16_mixer
+SRCS=  sb16_mixer.c
+
+MAN=
+
+BINDIR?= /usr/sbin
+
+.include <minix.prog.mk>
index 43e21e174b0563c0d70a5960803279d3df3bfb54..6ad5d59c603405399ab4adef7841271dccca9634 100644 (file)
@@ -1,38 +1,12 @@
 # Makefile for the Texas Instruments PCI1225 PC Card controller driver (ti1225)
-DRIVER = ti1225
+PROG=  ti1225
+SRCS=  ti1225.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i 
-LIBS = -lsys -ltimers
-
-OBJ = ti1225.o
-
-# build local binary
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 8k $(DRIVER)
-
-# install with other drivers
-install:       /usr/sbin/$(DRIVER)
-/usr/sbin/$(DRIVER):   $(DRIVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f *.o *.bak $(DRIVER)
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index 4f50e3014272459aed1a4e03322e3e4d3fe393fc..61c2a06e994eede96576c63bb46adf674f35a277 100644 (file)
@@ -4,7 +4,7 @@ ti1225.c
 Created:       Dec 2005 by Philip Homburg
 */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 #include <machine/pci.h>
 #include <machine/vm.h>
 
index ab77633714b267e9befa5c64c080ee5350b58613..468c7eefb1c89db62e75b813b89e2d830929fe1e 100644 (file)
@@ -1,46 +1,21 @@
 # Makefile for terminal driver (TTY)
-DRIVER = tty
 
-include /etc/make.conf
+.include <minix.own.mk>
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-d = ..
+PROG=  tty
+SRCS=  tty.c console.c keyboard.c pty.c rs232.c
 
-# programs, flags, etc.
-MAKE = exec make
-CC =   exec cc
-CPPFLAGS = -I.. -I../.. -I$i
-CFLAGS = $(CPPFLAGS)
-LDFLAGS = -i
-LIBS =  -lsys -ltimers
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
-OBJ = tty.o console.o keyboard.o pty.o rs232.o 
+MAN=
 
-# build local binary 
-all build:     $(DRIVER)
-$(DRIVER):     $(OBJ) 
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 16k $(DRIVER)
-
-# install with other drivers
-install:       
-       cd keymaps && $(MAKE) -$(MAKEFLAGS) install
-
-#/sbin/$(DRIVER):      $(DRIVER)
-#      install -o root -cs $? $@
-
-# clean up local files
-clean:
-       cd keymaps && $(MAKE) -$(MAKEFLAGS) $@
-       rm -f $(DRIVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+BINDIR?= /sbin
 
+SUBDIR= keymaps
 
+# Needs kernel/const.h, etc
+CPPFLAGS+=      -I ../..
 
+.include <minix.prog.mk>
+.include <minix.subdir.mk>
index 816bd62834fa815e17a609b189d4fd8a9aa26883..00d30adab0f3691beaad2888148e6ed4a2ed6c73 100644 (file)
@@ -16,7 +16,7 @@
  * and the scrolling function worries about wrapping.
  */
 
-#include <drivers.h>
+#include <minix/drivers.h>
 #include <termios.h>
 #include <sys/ioctl.h>
 #include <sys/vm.h>
index 9fe9dd5bec9115a46fb6f89caf915799ff57f94f..bdf2e40d59349876331cd8fbf25a276c7760d0cb 100644 (file)
@@ -6,7 +6,7 @@
  *   Feb 04, 1994   loadable keymaps  (Marcus Hampel)
  */
 
-#include <drivers.h>
+#include <minix/drivers.h>
 #include <sys/ioctl.h>
 #include <sys/kbdio.h>
 #include <sys/time.h>
index dfaf1b29ac31701b9479062c933e94c58f0e6dfc..7cffe91628acbcce13c824ebad90d124dabd55d7 100644 (file)
 # Generate binary keymaps.
 
-LK =   /usr/lib/keymaps
+.include <minix.own.mk>
 
-.SUFFIXES:     .src .map
+FILES= dvorak.map french.map german.map italian.map japanese.map \
+       latin-america.map olivetti.map polish.map russian-cp866.map \
+       russian.map scandinavian.map spanish.map uk.map \
+       us-std-esc.map us-std.map us-swap.map
 
-.src.map: 
-       $(CC) -DKEYSRC=\"$<\" genmap.c
-       ./a.out > $@
-       @rm -f a.out
+.include "Makefile.inc"
 
-all:   \
-       dvorak.map \
-       french.map \
-       german.map \
-       italian.map \
-       japanese.map \
-       latin-america.map \
-       olivetti.map \
-       polish.map \
-       russian.map \
-       russian-cp866.map \
-       scandinavian.map \
-       spanish.map \
-       uk.map \
-       us-std.map \
-       us-std-esc.map \
-       us-swap.map \
-
-install:       \
-       $(LK) \
-       $(LK)/dvorak.map \
-       $(LK)/french.map \
-       $(LK)/german.map \
-       $(LK)/italian.map \
-       $(LK)/japanese.map \
-       $(LK)/latin-america.map \
-       $(LK)/olivetti.map \
-       $(LK)/polish.map \
-       $(LK)/russian.map \
-       $(LK)/russian-cp866.map \
-       $(LK)/scandinavian.map \
-       $(LK)/spanish.map \
-       $(LK)/uk.map \
-       $(LK)/us-std.map \
-       $(LK)/us-std-esc.map \
-       $(LK)/us-swap.map \
-
-clean:
-       rm -f a.out *.map
-
-$(LK):
-       install -d $@
-
-$(LK)/dvorak.map:      dvorak.map
-       install -c $? $@
-
-$(LK)/french.map:      french.map
-       install -c $? $@
-
-$(LK)/german.map:      german.map
-       install -c $? $@
-
-$(LK)/italian.map:     italian.map
-       install -c $? $@
-
-$(LK)/japanese.map:    japanese.map
-       install -c $? $@
-
-$(LK)/latin-america.map:       latin-america.map
-       install -c $? $@
-
-$(LK)/olivetti.map:    olivetti.map
-       install -c $? $@
-
-$(LK)/polish.map:      polish.map
-       install -c $? $@
-
-$(LK)/russian.map:     russian.map
-       install -c $? $@
-
-$(LK)/russian-cp866.map:       russian-cp866.map
-       install -c $? $@
-       
-$(LK)/scandinavian.map:        scandinavian.map
-       install -c $? $@
-
-$(LK)/spanish.map:     spanish.map
-       install -c $? $@
-
-$(LK)/uk.map:  uk.map
-       install -c $? $@
-
-$(LK)/us-std.map:      us-std.map
-       install -c $? $@
-
-$(LK)/us-std-esc.map:  us-std-esc.map
-       install -c $? $@
-
-$(LK)/us-swap.map:     us-swap.map
-       install -c $? $@
+.include <minix.prog.mk>
diff --git a/drivers/tty/keymaps/Makefile.inc b/drivers/tty/keymaps/Makefile.inc
new file mode 100644 (file)
index 0000000..b6885d4
--- /dev/null
@@ -0,0 +1,14 @@
+FILESDIR= ${DESTDIR}/usr/lib/keymaps
+
+.SUFFIXES:      .src .map
+
+.src.map:
+       ${_MKTARGET_CREATE}
+       $(CC) -DKEYSRC=\"$<\" genmap.c
+       ./a.out > $@
+       @rm -f a.out
+
+realall: ${FILES}
+
+clean:
+       rm -f ${FILES}
index 3949a70158f196a3dd391e00cacfbdce3058bee4..025c27245958ee19e72a26ace3b1057d3ac074b2 100644 (file)
@@ -16,7 +16,7 @@
  * end are to be read at the other end and vice-versa.
  */
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 #include <assert.h>
 #include <termios.h>
 #include <signal.h>
index 649962627e76367d6bba6e7630e138fd3d37842b..f6fc7332e56b3ae6867b6825b6608221f7156960 100644 (file)
@@ -4,7 +4,7 @@
  *             Added support for Atari ST M68901 and YM-2149   --kub        *
  *---------------------------------------------------------------------------*/
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 #include <termios.h>
 #include <signal.h>
 #include "tty.h"
index 3cbec48e6dd592b00a12d3104d16531a1d208db5..af47414a6eb05f03e644a34afe0deb9b207c9ed0 100644 (file)
@@ -57,7 +57,7 @@
  *   Jul 13, 2004   support for function key observers  (Jorrit N. Herder)  
  */
 
-#include <drivers.h>
+#include <minix/drivers.h>
 #include <termios.h>
 #include <sys/ioc_tty.h>
 #include <signal.h>
index 9c893fbe6ff8d727da94fde36ff3353ebb2a4ed0..ebcf24c5d56b6ef275d289cd63c86fc256ea4895 100644 (file)
@@ -6,6 +6,8 @@
 # Pull in <minix.sys.mk> here so we can override its .c.o rule
 .include <minix.sys.mk>
 
+LIBISPRIVATE?= no
+
 ##### Basic targets
 .PHONY:                libinstall
 realinstall:   libinstall
@@ -81,6 +83,11 @@ STOBJS+=${OBJS}
 
 LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
 
+.if ${LIBISPRIVATE} != "no"
+# No installation is required
+libinstall::
+.endif # ${LIBISPRIVATE} == "no"                                       # {
+
 ALLOBJS=
 
 ALLOBJS+=${STOBJS}
@@ -119,6 +126,7 @@ cleanlib: .PHONY
        rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
        rm -f lib${LIB}.a ${STOBJS}
 
+.if !target(libinstall)                                                        # {
 
 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
 .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
@@ -131,8 +139,15 @@ ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
 .endif
 ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
 
+.endif # !target(libinstall)                                           # }
 
+##### Pull in related .mk logic
+LINKSOWN?= ${LIBOWN}
+LINKSGRP?= ${LIBGRP}
+LINKSMODE?= ${LIBMODE}
 .include <minix.files.mk>
+.include <minix.inc.mk>
+.include <minix.links.mk>
 .include <minix.dep.mk>
 
 .if ${COMPILER_TYPE} == "ack"
index f58cb0514a64ded7208662790e759c0823ad3291..642ff0940b2248aaa7272a1ed227d74654b10975 100644 (file)
@@ -783,7 +783,9 @@ INSTPRIV.unpriv=
 .endif
 INSTPRIV?=     ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
 .endif
-STRIPFLAG?=    
+STRIPFLAG?=
+#XXX: Strip flag for MINIX
+#STRIPFLAG?=   -s
 
 .if ${NEED_OWN_INSTALL_TARGET} != "no"
 INSTALL_DIR?=          ${INSTALL} ${INSTPRIV} -d
index fa90268992ba560041ebf09ef9d96727bfde04b3..51c55daaf874394f4d69fb0fd228f44e5a9dace1 100644 (file)
@@ -37,19 +37,21 @@ MKDEP_SUFFIXES?=    .o .ln
 #              LIBX11?=${DESTDIR}/usr/X11R7/lib/libX11.a
 #      etc..
 
+# .for _lib in \
+#      archive asn1 bluetooth bsdmalloc bz2 c c_pic cdk com_err compat \
+#      crypt crypto crypto_idea crypto_mdc2 crypto_rc5 \
+#      curses dbm des edit event \
+#      fetch form fl g2c gcc gnumalloc gssapi hdb heimntlm hx509 intl ipsec \
+#      kadm5clnt kadm5srv kafs krb5 kvm l lber ldap ldap_r \
+#      m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \
+#      puffs radius resolv rmt roken rpcsvc rt rump rumpuser skey sl ss \
+#      ssh ssl termcap usbhid util wrap y z bind9 dns lwres isccfg isccc isc \
+#      \
+#      rumpfs_cd9660fs rumpfs_efs rumpfs_ext2fs rumpfs_ffs rumpfs_hfs \
+#      rumpfs_lfs rumpfs_msdosfs rumpfs_nfs rumpfs_ntfs rumpfs_syspuffs \
+#      rumpfs_tmpfs rumpfs_udf rumpfs_ufs
 .for _lib in \
-       archive asn1 bluetooth bsdmalloc bz2 c c_pic cdk com_err compat \
-       crypt crypto crypto_idea crypto_mdc2 crypto_rc5 \
-       curses dbm des edit event \
-       fetch form fl g2c gcc gnumalloc gssapi hdb heimntlm hx509 intl ipsec \
-       kadm5clnt kadm5srv kafs krb5 kvm l lber ldap ldap_r \
-       m magic menu objc ossaudio pam pcap pci pmc posix pthread pthread_dbg \
-       puffs radius resolv rmt roken rpcsvc rt rump rumpuser skey sl ss \
-       ssh ssl termcap usbhid util wrap y z bind9 dns lwres isccfg isccc isc \
-       \
-       rumpfs_cd9660fs rumpfs_efs rumpfs_ext2fs rumpfs_ffs rumpfs_hfs \
-       rumpfs_lfs rumpfs_msdosfs rumpfs_nfs rumpfs_ntfs rumpfs_syspuffs \
-       rumpfs_tmpfs rumpfs_udf rumpfs_ufs
+       c curses driver edit end m sys timers util
 .ifndef LIB${_lib:tu}
 LIB${_lib:tu}= ${DESTDIR}/usr/lib/lib${_lib}.a
 .if ${COMPILER_TYPE} == "ack"
@@ -90,12 +92,12 @@ CPPFLAGS+=  -DRESCUEDIR=\"${RESCUEDIR}\"
 __proginstall: .USE
        ${_MKTARGET_INSTALL}
        ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
-               ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
+               ${INSTALLFLAGS} ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
 
 __progdebuginstall: .USE
        ${_MKTARGET_INSTALL}
        ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
-               ${.ALLSRC} ${.TARGET}
+               ${INSTALLFLAGS} ${.ALLSRC} ${.TARGET}
 
 
 
@@ -377,4 +379,12 @@ cleanextra: .PHONY
 
 ${TARGETS}:    # ensure existence
 
+###### Minix rule to set up mem allocations for boot image services
+.if defined(INSTALLFLAGS)
+all: .PHONY memalloc
+
+memalloc: realall
+       ${INSTALL} ${INSTALLFLAGS} ${PROG}
+.endif
+
 .endif # HOSTPROG
index 0bc0fb102ff45961b30bb01bed739cff3f64fcf7..d7cb479edbd5a553efdd39a749b62299c016fa42 100644 (file)
@@ -100,7 +100,9 @@ PIE_AFLAGS?=            -fPIC -DPIC
 
 # Helpers for cross-compiling
 HOST_CC?=      cc
-HOST_CFLAGS?=  -O
+#XXX: Temporarily disable -O for MINIX
+#HOST_CFLAGS?= -O
+HOST_CFLAGS?=
 HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
 HOST_COMPILE.cc?=      ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} -c
 .if defined(HOSTPROG_CXX) 
@@ -110,7 +112,9 @@ HOST_LINK.c?=       ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
 .endif
 
 HOST_CXX?=     c++
-HOST_CXXFLAGS?=        -O
+#XXX: Temporarily disable -O for MINIX
+#HOST_CXXFLAGS?=       -O
+HOST_CXXFLAGS?=
 
 HOST_CPP?=     cpp
 HOST_CPPFLAGS?=
index 87112fb4bde9cef884132dd7e4ccf25d47eb3344..98167a07699644bd365cd56857946f1723dd72fd 100644 (file)
@@ -41,7 +41,9 @@ DBG?= -O1 -fgcse -fstrength-reduce -fgcse-after-reload
 # see src/doc/HACKS for details
 DBG?=  -O1
 .else
-DBG?=  -O
+#XXX: Temporarily disable -O for MINIX
+#DBG?= -O
+DBG?=
 .endif
 CFLAGS?=       ${DBG}
 LDFLAGS?=
index d23e024be1fb8e9607f28553619b040d4f6e299b..f49bd609a5b8649998d6096ef6b6c8edaf9a518f 100644 (file)
@@ -13,15 +13,15 @@ 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
+       minix/dir.h minix/dl_eth.h minix/dmap.h minix/driver.h \
+       minix/drivers.h minix/drvlib.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 \
similarity index 90%
rename from drivers/drivers.h
rename to include/minix/drivers.h
index 8da9f526064083ba7752f422be830a3c43282e04..b68b447fb56aaf0f1d06eac95395d8dc6ac04bb9 100644 (file)
@@ -24,8 +24,8 @@
 #include <minix/bitmap.h>
 
 #include <machine/interrupt.h> /* IRQ vectors and miscellaneous ports */
-#include <machine/bios.h>              /* BIOS index numbers */
-#include <machine/ports.h>             /* Well-known ports */
+#include <machine/bios.h>      /* BIOS index numbers */
+#include <machine/ports.h>     /* Well-known ports */
 
 #include <string.h>
 #include <signal.h>
index 41a1a470036c2777c90b31f50196345cdb5fb98a..2b3f8b1efabcad052c646806933f4af5eafdd61b 100644 (file)
@@ -1,6 +1,7 @@
 .include <minix.own.mk>
 
-SUBDIR= csu libc libcurses libend libedit libm libsys libtimers libutil
+SUBDIR= csu libc libcurses libdriver libend libedit libm libsys \
+       libtimers libutil
 
 .if ${COMPILER_TYPE} == "ack"
 SUBDIR+= ack/libd ack/libe ack/libfp ack/liby
diff --git a/lib/libdriver/Makefile b/lib/libdriver/Makefile
new file mode 100644 (file)
index 0000000..86c269b
--- /dev/null
@@ -0,0 +1,7 @@
+# Makefile for libdriver
+
+LIB=   driver
+
+SRCS=  driver.c drvlib.c mq.c
+
+.include <minix.lib.mk>
similarity index 99%
rename from drivers/libdriver/driver.c
rename to lib/libdriver/driver.c
index 8e3f7385bb8277d7e078171cd7bedb55c66c573c..5b9a88e4fbabe501392a7cdd388976ca3cb40181 100644 (file)
  */
 
 
-#include "../drivers.h"
+#include <minix/drivers.h>
 #include <sys/ioc_disk.h>
 #include <minix/mq.h>
 #include <minix/endpoint.h>
-#include "driver.h"
+#include <minix/driver.h>
 
 /* Claim space for variables. */
 u8_t *tmp_buf = NULL;          /* the DMA buffer eventually */
similarity index 99%
rename from drivers/libdriver/drvlib.c
rename to lib/libdriver/drvlib.c
index 3f9f795bdf4ab415110370af853b03d9bdf516e7..38f4ce0331a8cd0c113fb93fe1e88eeff00d2fb3 100644 (file)
@@ -4,8 +4,8 @@
  *   partition:        partition a disk to the partition table(s) on it.
  */
 
-#include "driver.h"
-#include "drvlib.h"
+#include <minix/driver.h>
+#include <minix/drvlib.h>
 #include <unistd.h>
 
 /* Extended partition? */
similarity index 100%
rename from drivers/libdriver/mq.c
rename to lib/libdriver/mq.c
index 3da04d36c6ae15569c1f534e7e7aea8dbc74330e..1e251c75b3d04c2c2f29748566800d28aa97c4b8 100644 (file)
@@ -1,41 +1,10 @@
 # Makefile for all system servers.
 #
-MAKE = exec make -$(MAKEFLAGS)
 
-usage:
-       @echo "" >&2
-       @echo "Makefile for all system servers." >&2
-       @echo "Usage:" >&2
-       @echo " make build    # Compile all system servers locally" >&2
-       @echo " make image    # Compile servers in boot image" >&2
-       @echo " make clean    # Remove local compiler results" >&2
-       @echo " make install  # Install servers to /etc/servers/" >&2
-       @echo "                 (requires root privileges)" >&2
-       @echo "" >&2
+.include <minix.own.mk>
 
-build: all
-all install depend clean:
-       cd ./pm && $(MAKE) $@
-       cd ./vfs && $(MAKE) $@
-       cd ./mfs && $(MAKE) $@
-       cd ./pfs && $(MAKE) $@
-       cd ./iso9660fs && $(MAKE) $@
-       cd ./hgfs && $(MAKE) $@
-       cd ./rs && $(MAKE) $@
-       cd ./ds && $(MAKE) $@
-       cd ./is && $(MAKE) $@
-       cd ./vm && $(MAKE) $@
-       cd ./init && $(MAKE) $@
-       cd ./inet && $(MAKE) $@
-       cd ./ipc && $(MAKE) $@
+SUBDIR=        ds hgfs inet init ipc is iso9660fs mfs pfs pm rs vfs vm
 
-image:
-       cd ./pm && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) build
-       cd ./vfs && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) build
-       cd ./pfs && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) build
-       cd ./mfs && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) build
-       cd ./rs && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) build
-       cd ./ds && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) build
-       cd ./vm && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) build
-       cd ./init && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) build
+IMAGE_SUBDIR=  ds init mfs pfs pm rs vfs vm
 
+.include <minix.subdir.mk>
index a99761000aba19006f5f7827c6fed54b6da93583..3fc6b1c3550b4d2a298e0711b0ca3a2c21b09cdc 100644 (file)
@@ -1,38 +1,12 @@
 # Makefile for Data Store Server (DS)
-SERVER = ds
+PROG=  ds
+SRCS=  main.c store.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-k = $u/src/kernel
-p = $u/src/servers/pm
-f = $u/src/servers/fs
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(CPROFILE)
-LDFLAGS = -i
-LIBS = -lsys 
-
-OBJ = main.o store.o 
-
-# build local binary
-all build:     $(SERVER)
-$(SERVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 16k $@
-
-# install with other servers
-install: $(SERVER)
-
-# clean up local files
-clean:
-       rm -f $(SERVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index 98b7d5e6a6a0e43b9f89d77d0cd3d65aab4f2c59..483c9b51e500ad1cf9ec00615cf6e3947f33eb3b 100644 (file)
@@ -1,31 +1,7 @@
 # Makefile for VMware Host/Guest File System (HGFS) server
-SERVER=hgfs
 
-LIBHGFSDIR=./libhgfs
-LIBHGFS=$(LIBHGFSDIR)/libhgfs.a
+.include <minix.own.mk>
 
-DEST=/sbin/$(SERVER)
-LIBS=-lsys -L$(LIBHGFSDIR) -lhgfs
+SUBDIR=        libhgfs .WAIT hgfs_server
 
-OBJ=dentry.o handle.o inode.o link.o lookup.o main.o \
-       misc.o mount.o name.o optset.o path.o read.o \
-       stat.o table.o util.o verify.o write.o
-
-all build: $(SERVER)
-
-$(SERVER): $(LIBHGFS) $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-
-$(LIBHGFS):
-       cd $(LIBHGFSDIR) && $(MAKE)
-
-install: $(SERVER)
-       install -c $(SERVER) $(DEST)
-
-clean:
-       cd $(LIBHGFSDIR) && $(MAKE) $@
-       rm -f $(SERVER) $(OBJ)
-
-depend:
-       cd $(LIBHGFSDIR) && $(MAKE) $@
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+.include <minix.subdir.mk>
diff --git a/servers/hgfs/Makefile.inc b/servers/hgfs/Makefile.inc
new file mode 100644 (file)
index 0000000..4229a01
--- /dev/null
@@ -0,0 +1,13 @@
+.include <minix.own.mk>
+
+LIBHGFS != cd ${.CURDIR}/../libhgfs && ${PRINTOBJDIR}
+CPPFLAGS+=-I${.CURDIR}/../libhgfs
+DPADD+= ${LIBHGFS}/libhgfs.a
+LDADD+= -L${LIBHGFS} -lhgfs
+
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
+
+.if exists(${.CURDIR}/../../Makefile.inc)
+.include "${.CURDIR}/../../Makefile.inc"
+.endif
diff --git a/servers/hgfs/hgfs_server/Makefile b/servers/hgfs/hgfs_server/Makefile
new file mode 100644 (file)
index 0000000..ce98eb4
--- /dev/null
@@ -0,0 +1,11 @@
+# Makefile for VMware Host/Guest File System (HGFS) server
+PROG=  hgfs
+SRCS=  dentry.c handle.c inode.c link.c lookup.c main.c \
+       misc.c mount.c name.c optset.c path.c read.c \
+       stat.c table.c util.c verify.c write.c
+
+MAN=
+
+BINDIR?= /sbin
+
+.include <minix.prog.mk>
similarity index 96%
rename from servers/hgfs/inc.h
rename to servers/hgfs/hgfs_server/inc.h
index 01b77c660b7517f090704d9517ae18383ae0cbc7..5f983a5982b4c778f09308b54388c5d3f7ee5054 100644 (file)
@@ -27,7 +27,7 @@
 #include <sys/stat.h>
 #include <sys/queue.h>
 
-#include "libhgfs/hgfs.h"
+#include "hgfs.h"
 
 #include "type.h"
 #include "const.h"
index c482560cdc0c6dc4536dd2f05c49539f19da5676..d7947cdfd060fd50d57324083ee3383b0bbaeaca 100644 (file)
@@ -1,23 +1,9 @@
 # Makefile for HGFS library
-LIBNAME=libhgfs.a
 
-OBJ=backdoor.o attr.o channel.o dir.o error.o file.o \
-       link.o misc.o path.o rpc.o time.o
+LIBISPRIVATE=   yes
 
-AR=ar
-GAS2ACK=gas2ack -u
+LIB=    hgfs
+SRCS=  backdoor.S attr.c channel.c dir.c error.c file.c \
+       link.c misc.c path.c rpc.c time.c
 
-all build: $(LIBNAME)
-
-$(LIBNAME): $(OBJ)
-       $(AR) cr $@ $(OBJ)
-
-backdoor.o: backdoor.S
-       $(GAS2ACK) $< $@.s
-       $(CC) $(CFLAGS) -c -o $@ $@.s
-
-clean distclean:
-       rm -f $(LIBNAME) $(OBJ) *.o.s
-
-depend:
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+.include <minix.lib.mk>
index 870419d3c51a339227e46e4d9b821ff21621fe67..e33ae487c880219dc7e4178e806e92888a9c15d2 100644 (file)
@@ -1,8 +1,8 @@
-# Part of libhgfs - (c) 2009, D.C. van Moolenbroek
+/* Part of libhgfs - (c) 2009, D.C. van Moolenbroek */
 
-.globl __libhgfs_backdoor
-.globl __libhgfs_backdoor_in
-.globl __libhgfs_backdoor_out
+.globl ___libhgfs_backdoor
+.globl ___libhgfs_backdoor_in
+.globl ___libhgfs_backdoor_out
 
 .text
 
@@ -11,7 +11,7 @@
        IO_PORT = 0x5659
 
 .balign        16
-__libhgfs_backdoor:
+___libhgfs_backdoor:
        pushl   %ebx
        pushl   %esi
        pushl   %edi
@@ -38,7 +38,7 @@ __libhgfs_backdoor:
        ret
 
 .balign        16
-__libhgfs_backdoor_in:
+___libhgfs_backdoor_in:
        pushl   %ebx
        pushl   %esi
        pushl   %edi
@@ -72,7 +72,7 @@ __libhgfs_backdoor_in:
        ret
 
 .balign        16
-__libhgfs_backdoor_out:
+___libhgfs_backdoor_out:
        pushl   %ebx
        pushl   %esi
        pushl   %edi
index 356e912930a95170b4ed20471c68add0b3b4d84f..1285617e1328d7385de5e4c4ab48c022d51798fc 100644 (file)
@@ -1,43 +1,24 @@
 # Makefile for inet.
+PROG=  inet
+SRCS=  buf.c clock.c inet.c inet_config.c \
+       mnx_eth.c mq.c qp.c sr.c \
+       udp.c arp.c eth.c event.c \
+       icmp.c io.c ip.c ip_ioctl.c \
+       ip_lib.c ip_read.c ip_write.c \
+       ipr.c rand256.c tcp.c tcp_lib.c \
+       tcp_recv.c tcp_send.c ip_eth.c \
+       ip_ps.c psip.c \
+       queryparam.c sha2.c version.c
 
-# Directories
-g = generic
+.PATH: ${.CURDIR}/generic
 
-# Programs, flags, and libraries
-CC =           cc
-CPPFLAGS =     -I. -D_MINIX
-CFLAGS =       $(OPT) $(CPPFLAGS) $(CPROFILE)
-LDFLAGS =
-LIBS =           -lsys 
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-.c.o:
-       $(CC) $(CFLAGS) -o $@ -c $<
+MAN=
 
-OBJ =  buf.o clock.o inet.o inet_config.o \
-       mnx_eth.o mq.o qp.o sr.o \
-       $g/udp.o $g/arp.o $g/eth.o $g/event.o \
-       $g/icmp.o $g/io.o $g/ip.o $g/ip_ioctl.o \
-       $g/ip_lib.o $g/ip_read.o $g/ip_write.o \
-       $g/ipr.o $g/rand256.o $g/tcp.o $g/tcp_lib.o \
-       $g/tcp_recv.o $g/tcp_send.o $g/ip_eth.o \
-       $g/ip_ps.o $g/psip.o \
-       minix3/queryparam.o sha2.o
+BINDIR?= /usr/sbin
 
-all:   inet
+CPPFLAGS+=  -I${.CURDIR} -D_MINIX
 
-inet:  $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) version.c $(LIBS)
-
-install: inet
-       install -c inet /usr/sbin/inet
-
-clean:
-       rm -f $(OBJ) inet *.bak
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c generic/*.c > .depend
-
-
-#
-# $PchId: Makefile.mnx3,v 1.1 2005/06/28 14:28:45 philip Exp $
-#
+.include <minix.prog.mk>
index 439097021a8f0188e06c70f6424f5ea7d89310c7..c6bc310ca701fa8f0762bd639e3dc2073b0ded7a 100644 (file)
@@ -10,7 +10,7 @@ Created:      June 1995 by Philip Homburg <philip@f-mnx.phicoh.com>
 #include "generic/assert.h"
 
 #include <sys/svrctl.h>
-#include <minix3/queryparam.h>
+#include "queryparam.h"
 
 #include "generic/buf.h"
 #include "generic/clock.h"
similarity index 99%
rename from servers/inet/minix3/queryparam.c
rename to servers/inet/queryparam.c
index 3fb164786fd446d4bcc5a9d41469f0e6147714c5..26bf5d7f4f19a81f1198eb829f11b3ee7b53acbf 100644 (file)
@@ -6,7 +6,7 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
-#include <minix3/queryparam.h>
+#include "queryparam.h"
 
 #if EXAMPLE
 struct stat st[2];
index 6815e791ad2ba11932792393876d2dcbead9e990..9490587d2a0cad942d34719b09c631ef4d86267c 100644 (file)
@@ -1,36 +1,14 @@
 # Makefile for the init program (INIT)
-SERVER = init
+PROG=  init
+SRCS=  init.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-h = $i/minix
-k = $u/src/kernel
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i -O -D_MINIX -D_POSIX_SOURCE
-LDFLAGS = -i
+MAN=
 
-OBJ =  init.o
-
-# build local binary
-all build:     $(SERVER)
-$(SERVER):     $(OBJ)
-       $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJ) -lsys
-       install -S 64k $@
-
-# install with other servers
-install:       /usr/sbin/$(SERVER)
-/usr/sbin/$(SERVER):   $(SERVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(SERVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+BINDIR?= /usr/sbin
 
+CPPFLAGS+= -O -D_MINIX -D_POSIX_SOURCE
 
+.include <minix.prog.mk>
index e8152c7a47a44ddf0be0578ab850a64f1cc9146e..e98a9fbbd21fb42e9045d01b205b7cb7f35ee084 100644 (file)
@@ -1,28 +1,12 @@
 # Makefile for IPC server
-SERVER = ipc
+PROG=  ipc
+SRCS=  main.c utility.c shm.c sem.c
 
-include /etc/make.conf
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-OBJ = main.o utility.o shm.o sem.o
-
-CPPFLAGS=
-CFLAGS = $(CPROFILE) $(CPPFLAGS)
-
-# build local binary
-
-all build:     $(SERVER)
-
-install: $(SERVER)
-       install -o root -c $(SERVER) /usr/sbin/$(SERVER)
-
-$(SERVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) -lsys  
-
-# clean up local files
-clean:
-       rm -f $(SERVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
 
+.include <minix.prog.mk>
index fb8de4aaa029887834dcc28cae9b523c80bd4492..d6ce20a296232aad2c448508d70a08bb780ec0e5 100644 (file)
@@ -1,42 +1,12 @@
 # Makefile for Information Server (IS)
-SERVER = is
+PROG=  is
+SRCS=  main.c dmp.c dmp_kernel.c dmp_pm.c dmp_fs.c dmp_rs.c dmp_ds.c dmp_vm.c
 
-include /etc/make.conf
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
-k = $u/src/kernel
-p = $u/src/servers/pm
-f = $u/src/servers/fs
-
-# programs, flags, etc.
-CC =   exec cc
-CPPFLAGS=-I$i
-CFLAGS = $(CPROFILE) $(CPPFLAGS)
-LDFLAGS = -i
-LIBS = -lsys 
-
-OBJ = main.o dmp.o dmp_kernel.o dmp_pm.o dmp_fs.o dmp_rs.o dmp_ds.o dmp_vm.o
-
-# build local binary
-all build:     $(SERVER)
-$(SERVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-#      install -S 256w $@
-
-# install with other servers
-install:       $(SERVER)
-       install -o root -c $(SERVER) /sbin/$(SERVER)
-
-# clean up local files
-clean:
-       rm -f $(SERVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /sbin
 
+.include <minix.prog.mk>
index 51540fb88aed6deb2ae487a1cb27bbe55e06f463..c776b66751556924350ee4737d3f63fb0e7ca073 100644 (file)
@@ -1,35 +1,16 @@
 # Makefile for ISO9660 fs
-SERVER = isofs
-NR_BUFS = 100
+PROG=  isofs
+SRCS=  main.c table.c mount.c super.c inode.c device.c \
+       utility.c misc.c path.c read.c stadir.c cache.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-h = $i/minix
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(EXTRA_OPTS) $(CPROFILE) -DNR_BUFS=$(NR_BUFS)
-LDFLAGS = -i
-LIBS = -lsys -ltimers
+MAN=
 
-OBJ =  main.o table.o mount.o super.o inode.o device.o \
-       utility.o misc.o path.o read.o stadir.o cache.o 
+BINDIR?= /sbin
 
-# build local binary 
-all build:     $(SERVER)
-$(SERVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 64k $(SERVER)
-
-install: $(SERVER)
-       install $(SERVER) /sbin/$(SERVER)
-
-# clean up local files
-clean:
-       rm -f $(SERVER) *.o *.bak *~
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+NR_BUFS= 100
+CPPFLAGS+= -DNR_BUFS=${NR_BUFS}
 
+.include <minix.prog.mk>
index 4f8f2692b59668765b190d34e63ed39ec4e28135..fcdcab9a824491d57532d8e5349e965a97f5eb52 100644 (file)
@@ -1,41 +1,18 @@
 # Makefile for Minix File System (MFS)
-SERVER = mfs
-DEST=/sbin/$(SERVER)
-NR_BUFS=1024
-BS=4096
+PROG=  mfs
+SRCS=  cache.c device.c link.c \
+       mount.c misc.c open.c protect.c read.c \
+       stadir.c table.c time.c utility.c \
+       write.c inode.c main.c path.c super.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-h = $i/minix
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(EXTRA_OPTS) $(CPROFILE) -DNR_BUFS=$(NR_BUFS)
-LDFLAGS = -i
-LIBS =  -lsys 
-
-OBJ =  cache.o device.o link.o \
-       mount.o misc.o open.o protect.o read.o \
-       stadir.o table.o time.o utility.o \
-       write.o inode.o main.o path.o super.o
-
-# build local binary 
-all build:     $(SERVER)
-$(SERVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-
-install: $(SERVER)
-       -mv $(DEST) $(DEST).prev
-       install $(SERVER) $(DEST)
-
-# clean up local files
-clean:
-       rm -f $(SERVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /sbin
 
+NR_BUFS= 1024
+CPPFLAGS+= -DNR_BUFS=${NR_BUFS}
 
+.include <minix.prog.mk>
index cee68f7b92bfc65c09fbc74e91cf0ac38c88d305..a5fc8f7994326a641cca7400c6be35648dad286c 100644 (file)
@@ -1,31 +1,16 @@
 # Makefile for Pipe File System (PFS)
-SERVER = pfs
-NR_BUFS=256 
-BS=4096
+PROG=  pfs
+SRCS=  open.c table.c inode.c main.c super.c link.c \
+       buffer.c read.c misc.c utility.c stadir.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-h = $i/minix
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(EXTRA_OPTS) $(CPROFILE) -DNR_BUFS=$(NR_BUFS)
-LDFLAGS = -i
-LIBS =  -lsys 
+MAN=
 
-OBJ =   open.o table.o inode.o main.o super.o link.o \
-        buffer.o read.o misc.o utility.o stadir.o
+BINDIR?= /usr/sbin
 
-# build local binary 
-install all build:     $(SERVER)
-$(SERVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
+NR_BUFS= 256
+CPPFLAGS+= -DNR_BUFS=${NR_BUFS}
 
-# clean up local files
-clean:
-       rm -f $(SERVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+.include <minix.prog.mk>
index c48759275493a3f9bcbcedf8c309a57ee9c23b87..bdf1aab60ef7dfec1c9b0990aa92dc0b950beb67 100644 (file)
@@ -1,41 +1,15 @@
 # Makefile for Process Manager (PM)
-SERVER = pm
+PROG=  pm
+SRCS=  main.c forkexit.c break.c exec.c time.c timers.c alarm.c \
+       signal.c utility.c table.c trace.c getset.c misc.c \
+       profile.c dma.c mcontext.c
 
-include /etc/make.conf
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-h = $i/minix
-k = $u/src/kernel
-
-# programs, flags, etc.
-CC =   exec cc
-CPPFLAGS=-I$i
-CFLAGS = $(CPROFILE) $(CPPFLAGS)
-LDFLAGS = -i
-
-OBJ =  main.o forkexit.o break.o exec.o time.o timers.o alarm.o \
-       signal.o utility.o table.o trace.o getset.o misc.o \
-       profile.o dma.o mcontext.o
-
-# build local binary
-all build:     $(SERVER)
-$(SERVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) -lsys -ltimers
-       install -S 32k $@
-
-# install with other servers
-install:       /usr/sbin/$(SERVER)
-/usr/sbin/$(SERVER):   $(SERVER)
-       install -o root -cs $? $@
-
-# clean up local files
-clean:
-       rm -f $(SERVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+MAN=
 
+BINDIR?= /usr/sbin
+INSTALLFLAGS+= -S 32k
 
+.include <minix.prog.mk>
index 20b8d6ddeceec30a5e1a30a3c0babbf7f9ea5e5c..841692f93000d95e5c9beffd11c4d290a022888f 100644 (file)
@@ -1,46 +1,18 @@
 # Makefile for Reincarnation Server (RS)
-SERVER = rs
-UTIL = service
+.include <minix.own.mk>
 
-include /etc/make.conf
+PROG=  rs
+SRCS=  exec.c main.c request.c manager.c table.c utility.c memory.c error.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-m = $i/minix
-b = $i/ibm
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-# programs, flags, etc.
-CC =   exec cc
-CPPFLAGS =
-CFLAGS = -I$i $(CPROFILE) $(CPPFLAGS)
-LDFLAGS = -i
-LIBS = -lsys 
+MAN=
 
-UTIL_OBJ = service.o
-OBJ = exec.o main.o request.o manager.o table.o utility.o memory.o error.o
-
-# build local binary
-all build:     $(SERVER) $(UTIL)
-$(UTIL):       $(UTIL_OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(UTIL_OBJ) $(UTIL_LIBS)
-$(SERVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 850k $@
-
-# install with other servers
-install:       /bin/$(UTIL) /usr/sbin/$(SERVER)
-/bin/$(UTIL):  $(UTIL)
-       install -c $? $@
-/usr/sbin/$(SERVER):   $(SERVER)
-       install -o root -c $? $@
-
-# clean up local files
-clean:
-       rm -f $(UTIL) $(SERVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+BINDIR?= /usr/sbin
+INSTALLFLAGS+= -S 850k
 
+SUBDIR= service
 
+.include <minix.prog.mk>
+.include <minix.subdir.mk>
diff --git a/servers/rs/service/Makefile b/servers/rs/service/Makefile
new file mode 100644 (file)
index 0000000..03e23fc
--- /dev/null
@@ -0,0 +1,11 @@
+# Makefile for service
+.include <minix.own.mk>
+
+PROG=  service
+SRCS=  service.c
+
+MAN=
+
+BINDIR?= /bin
+
+.include <minix.prog.mk>
index 4373a9bc6203be6a45edd7e1628f6081f540e79f..490d9dfc7f4fc6110c742c0437ee25021c75a606 100644 (file)
@@ -1,35 +1,17 @@
-# Makefile for File System (FS)
-SERVER = vfs
+# Makefile for Virtual File System (VFS)
+PROG=  vfs
+SRCS=  main.c open.c read.c write.c pipe.c dmap.c \
+       path.c device.c mount.c link.c exec.c \
+       filedes.c stadir.c protect.c time.c \
+       lock.c misc.c utility.c select.c timers.c table.c \
+       vnode.c vmnt.c request.c fscall.c
 
-# directories
-u = /usr
-i = $u/include
-s = $i/sys
-h = $i/minix
+DPADD+=        ${LIBSYS} ${LIBTIMERS}
+LDADD+=        -lsys -ltimers
 
-# programs, flags, etc.
-CC =   exec cc
-CFLAGS = -I$i $(EXTRA_OPTS) $(CPROFILE)
-LDFLAGS = -i
-LIBS = -lsys -ltimers
+MAN=
 
-OBJ =  main.o open.o read.o write.o pipe.o dmap.o \
-       path.o device.o mount.o link.o exec.o \
-       filedes.o stadir.o protect.o time.o \
-       lock.o misc.o utility.o select.o timers.o table.o \
-       vnode.o vmnt.o request.o fscall.o
-
-# build local binary 
-install all build:     $(SERVER)
-
-$(SERVER):     $(OBJ)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
-       install -S 16k $@
-
-# clean up local files
-clean:
-       rm -f $(SERVER) *.o *.bak 
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+BINDIR?= /usr/sbin
+INSTALLFLAGS+= -S 16k
 
+.include <minix.prog.mk>
index defbdd8bb7315aff05fe5538b96a9dc88ac255c2..587d92d6dfd4e8d7dd6aad47d76892a66efade6f 100644 (file)
@@ -1,34 +1,22 @@
 # Makefile for VM server
-SERVER = vm
+.include <minix.own.mk>
 
-include /etc/make.conf
+PROG=  vm
+SRCS=  main.c alloc.c utility.c exec.c exit.c fork.c break.c \
+       signal.c mmap.c slaballoc.c region.c pagefaults.c addravl.c \
+       physravl.c rs.c queryexit.c map_mem.c
 
-OBJ = main.o alloc.o utility.o exec.o exit.o fork.o break.o \
-       signal.o mmap.o slaballoc.o region.o pagefaults.o addravl.o \
-       physravl.o rs.o queryexit.o map_mem.o
-ARCHOBJ =  $(ARCH)/vm.o $(ARCH)/pagetable.o $(ARCH)/arch_pagefaults.o $(ARCH)/util.o 
+#Arch-specific sources
+.PATH: ${.CURDIR}/arch/${ARCH}
+SRCS+= vm.c pagetable.c arch_pagefaults.c util.S
 
-CPPFLAGS=-I$(ARCH)
-CFLAGS = $(CPROFILE) $(CPPFLAGS)
+DPADD+=        ${LIBSYS}
+LDADD+=        -lsys
 
-# build local binary
+MAN=
 
-all build install:     $(SERVER)
-
-$(SERVER):     $(OBJ) phony
-       cd $(ARCH) && $(MAKE)
-       $(CC) -o $@ $(LDFLAGS) $(OBJ) $(ARCHOBJ)  -lsys  
-
-# clean up local files
-clean:
-       rm -f $(SERVER) *.o *.bak 
-       cd $(ARCH) && $(MAKE) $@
-
-depend: 
-       cd $(ARCH) && $(MAKE) $@
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c $(ARCH)/*.c > .depend
-
-phony:
-       @:
+BINDIR?= /usr/sbin
 
+CPPFLAGS+= -I${.CURDIR} -Iarch/${ARCH}
 
+.include <minix.prog.mk>
similarity index 92%
rename from servers/vm/i386/arch_pagefaults.c
rename to servers/vm/arch/i386/arch_pagefaults.c
index 83c38723be1139deba7d6a917ac0d3a143bbda2f..918420e8b8a486d85c6620b55899756c33b0f9cb 100644 (file)
@@ -22,9 +22,9 @@
 #include <stdio.h>
 #include <fcntl.h>
 
-#include "../glo.h"
-#include "../proto.h"
-#include "../util.h"
+#include "glo.h"
+#include "proto.h"
+#include "util.h"
 
 /*===========================================================================*
  *                             arch_handle_pagefaults                       *
similarity index 99%
rename from servers/vm/i386/pagetable.c
rename to servers/vm/arch/i386/pagetable.c
index 1d9d8a9995e4c0a9f8dbbbe6201d1c6dd52e4f97..66e28c520687707643cd1e0a609efc8d72655719 100644 (file)
 #include <fcntl.h>
 #include <stdlib.h>
 
-#include "../proto.h"
-#include "../glo.h"
-#include "../util.h"
-#include "../vm.h"
-#include "../sanitycheck.h"
+#include "proto.h"
+#include "glo.h"
+#include "util.h"
+#include "vm.h"
+#include "sanitycheck.h"
 
 #include "memory.h"
 
similarity index 98%
rename from servers/vm/i386/pagetable.h
rename to servers/vm/arch/i386/pagetable.h
index 4d17e798b4a5fbdffae8f0700d7706a99c74fae5..c1eacc8a26080978c03121f2f1ad47b4e6a09418 100644 (file)
@@ -5,7 +5,7 @@
 #include <stdint.h>
 #include <machine/vm.h>
 
-#include "../vm.h"
+#include "vm.h"
 
 /* An i386 pagetable. */
 typedef struct {
diff --git a/servers/vm/arch/i386/util.S b/servers/vm/arch/i386/util.S
new file mode 100644 (file)
index 0000000..fd65e26
--- /dev/null
@@ -0,0 +1,24 @@
+.globl _i386_invlpg
+
+.text
+
+/**===========================================================================* */
+/**                              i386_invlpg                                  * */
+/**===========================================================================* */
+/* PUBLIC void i386_invlpg(u32_t addr) */
+/* Tell the processor to invalidate a tlb entry at virtual address addr. */
+_i386_invlpg:
+       push    %ebp
+       mov     %esp, %ebp
+       push    %eax
+
+       mov     8(%ebp), %eax
+#ifdef __ACK__
+       invlpg  %eax
+#else
+       invlpg  (%eax)
+#endif
+
+       pop     %eax
+       pop     %ebp
+       ret
similarity index 98%
rename from servers/vm/i386/vm.c
rename to servers/vm/arch/i386/vm.c
index f23534e7a211df4a59ed5318c06cc45e46458802..3df08eb28a06a879bdb63d8b75833a6fac46422c 100644 (file)
@@ -20,9 +20,9 @@
 #include <errno.h>
 #include <env.h>
 
-#include "../proto.h"
-#include "../vm.h"
-#include "../util.h"
+#include "proto.h"
+#include "vm.h"
+#include "util.h"
 
 #include "memory.h"
 
diff --git a/servers/vm/i386/Makefile b/servers/vm/i386/Makefile
deleted file mode 100644 (file)
index 7f97f13..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-include /etc/make.conf
-
-OBJ = vm.o pagetable.o arch_pagefaults.o util.o
-
-CPPFLAGS=-I.
-CFLAGS = $(CPROFILE) $(CPPFLAGS)
-
-all:   $(OBJ)
-
-clean:
-       rm -f $(OBJ)
-
-depend: 
-       mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
-
-
diff --git a/servers/vm/i386/util.s b/servers/vm/i386/util.s
deleted file mode 100644 (file)
index 7b31227..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-
-.sect .text; .sect .rom; .sect .data; .sect .bss                             
-
-.define _i386_invlpg
-
-.sect .text
-
-!*===========================================================================*
-!*                              i386_invlpg                                  *
-!*===========================================================================*
-! PUBLIC void i386_invlpg(u32_t addr)
-! Tell the processor to invalidate a tlb entry at virtual address addr.
-_i386_invlpg:
-       push    ebp
-       mov     ebp, esp
-       push    eax
-
-       mov     eax, 8(ebp)
-       invlpg  eax
-
-       pop     eax
-       pop     ebp
-       ret
index 803367f44047aa40e3e51e7c3081daafc41104af..c01eff574731c0aa61ff542fa98050cdbb29666f 100644 (file)
@@ -10,7 +10,7 @@ PROGRAMS=     ../kernel/kernel \
        ../servers/pm/pm \
        ../servers/vfs/vfs \
        ../servers/rs/rs \
-       ../drivers/memory/memory \
+       ../drivers/memory/memory_driver/memory \
        ../drivers/log/log \
        ../drivers/tty/tty \
        ../servers/ds/ds \
@@ -45,14 +45,8 @@ all: services image
 
 image:  includes
        cd ../kernel && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS)
-       cd ../servers && $(MAKE) image
-       cd ../drivers && $(MAKE) image
-       installboot -image $@ $(PROGRAMS)
-
-image_small:  includes
-       cd ../kernel && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS)
-       cd ../servers && $(MAKE) EXTRA_OPTS=-D_MINIX_SMALL=1 image
-       cd ../drivers && $(MAKE) EXTRA_OPTS=$(EXTRA_OPTS) image
+       cd ../servers && $(MAKE) all
+       cd ../drivers && $(MAKE) all
        installboot -image $@ $(PROGRAMS)
 
 # rebuild the program or system libraries
@@ -64,8 +58,8 @@ depend: includes
 
 services: includes 
        cd ../kernel && $(MAKE) 
-       cd ../servers && $(MAKE) install
-       cd ../drivers && $(MAKE) install
+       cd ../servers && $(MAKE) all install
+       cd ../drivers && $(MAKE) all install
 
 libraries: includes
        cd ../lib && sh ack_build.sh clean obj depend all install
@@ -89,5 +83,5 @@ clean:
        cd ../kernel && $(MAKE) $@
        cd ../servers && $(MAKE) $@
        cd ../drivers && $(MAKE) $@
-       rm -rf *.bak image image_small *.iso *.iso.gz cdfdimage rootimage src
+       rm -rf *.bak image *.iso *.iso.gz cdfdimage rootimage src