From 436d6012a33355cf2586534411a89835269252f0 Mon Sep 17 00:00:00 2001 From: Arun Thomas Date: Mon, 22 Mar 2010 21:25:22 +0000 Subject: [PATCH] Convert drivers/ and servers/ over to bsdmake -Move libdriver to lib/ -Install all boot image services on filesystem to aid restartability --- Makefile | 4 +- commands/pax/Makefile | 1 - drivers/Makefile | 59 ++-------- drivers/amddev/Makefile | 32 ++---- drivers/at_wini/Makefile | 43 ++------ drivers/at_wini/at_wini.h | 6 +- drivers/atl2/Makefile | 38 ++----- drivers/atl2/atl2.c | 2 +- drivers/audio/Makefile | 8 +- drivers/audio/Makefile.inc | 13 +++ drivers/audio/README | 2 +- drivers/audio/common/Makefile | 8 ++ .../audio/{framework => common}/audio_fw.c | 0 .../audio/{framework => common}/audio_fw.h | 2 +- .../audio/{framework => common}/liveupdate.c | 0 drivers/audio/{ => es1370}/AC97.h | 0 drivers/audio/es1370/Makefile | 38 +------ drivers/audio/es1370/ak4531.h | 2 +- drivers/audio/es1370/es1370.c | 2 +- drivers/audio/es1370/es1370.h | 2 +- drivers/audio/es1370/pci_helper.c | 2 +- drivers/audio/es1371/Makefile | 55 +--------- drivers/audio/es1371/es1371.c | 2 +- drivers/audio/es1371/es1371.h | 2 +- drivers/audio/es1371/pci_helper.c | 2 +- drivers/audio/es1371/wait.c | 2 +- drivers/audio/framework/Makefile | 9 -- drivers/audio/sb16/Makefile | 40 +------ drivers/audio/sb16/sb16.h | 2 +- drivers/bios_wini/Makefile | 41 ++----- drivers/bios_wini/bios_wini.c | 6 +- drivers/dec21140A/Makefile | 40 ++----- drivers/dec21140A/dec21140A.c | 2 +- drivers/dp8390/3c503.c | 2 +- drivers/dp8390/Makefile | 40 ++----- drivers/dp8390/dp8390.c | 2 +- drivers/dp8390/ne2000.c | 2 +- drivers/dp8390/rtl8029.c | 2 +- drivers/dp8390/wdeth.c | 2 +- drivers/dpeth/3c501.c | 2 +- drivers/dpeth/3c503.c | 2 +- drivers/dpeth/3c509.c | 2 +- drivers/dpeth/8390.c | 2 +- drivers/dpeth/Makefile | 43 ++------ drivers/dpeth/devio.c | 2 +- drivers/dpeth/dp.c | 2 +- drivers/dpeth/ne.c | 2 +- drivers/dpeth/netbuff.c | 2 +- drivers/dpeth/wd.c | 2 +- drivers/e1000/Makefile | 42 ++----- drivers/e1000/e1000.c | 2 +- drivers/e1000/e1000.h | 2 +- drivers/filter/Makefile | 31 ++---- drivers/floppy/Makefile | 41 ++----- drivers/floppy/floppy.h | 6 +- drivers/fxp/Makefile | 40 ++----- drivers/fxp/fxp.c | 2 +- drivers/fxp/mii.c | 2 +- drivers/hello/Makefile | 46 ++------ drivers/hello/hello.c | 4 +- drivers/lance/Makefile | 42 ++----- drivers/lance/lance.c | 2 +- drivers/libdriver/Makefile | 32 ------ drivers/log/Makefile | 41 ++----- drivers/log/log.h | 4 +- drivers/memory/Makefile | 57 +--------- drivers/memory/imgrd_s.s | 15 --- drivers/memory/memory_driver/Makefile | 17 +++ drivers/memory/{ => memory_driver}/imgrd.c | 2 +- drivers/memory/{ => memory_driver}/local.h | 0 drivers/memory/{ => memory_driver}/memory.c | 10 +- drivers/memory/ramdisk/Makefile | 16 +-- drivers/orinoco/Makefile | 42 ++----- drivers/orinoco/hermes.h | 2 +- drivers/orinoco/orinoco.c | 2 +- drivers/pci/Makefile | 40 ++----- drivers/pci/main.c | 2 +- drivers/pci/pci.c | 2 +- drivers/pci/pci_table.c | 2 +- drivers/printer/Makefile | 41 ++----- drivers/printer/liveupdate.c | 2 +- drivers/printer/printer.c | 2 +- drivers/random/Makefile | 48 ++------ drivers/random/main.c | 4 +- drivers/random/random.c | 2 +- drivers/readclock/Makefile | 33 ++---- drivers/rtl8139/Makefile | 41 ++----- drivers/rtl8139/rtl8139.h | 2 +- drivers/rtl8169/Makefile | 41 ++----- drivers/rtl8169/rtl8169.c | 2 +- drivers/sb16/Makefile | 40 +------ drivers/sb16/Makefile.inc | 13 +++ drivers/sb16/common/Makefile | 8 ++ drivers/sb16/{ => common}/sb16.c | 0 drivers/sb16/{ => common}/sb16.h | 2 +- drivers/sb16/dsp/Makefile | 9 ++ drivers/sb16/{ => dsp}/sb16_dsp.c | 0 drivers/sb16/{ => dsp}/sb16_dsp_liveupdate.c | 0 drivers/sb16/mixer/Makefile | 9 ++ drivers/sb16/{ => mixer}/sb16_mixer.c | 0 drivers/ti1225/Makefile | 40 ++----- drivers/ti1225/ti1225.c | 2 +- drivers/tty/Makefile | 49 ++------- drivers/tty/console.c | 2 +- drivers/tty/keyboard.c | 2 +- drivers/tty/keymaps/Makefile | 103 ++---------------- drivers/tty/keymaps/Makefile.inc | 14 +++ drivers/tty/pty.c | 2 +- drivers/tty/rs232.c | 2 +- drivers/tty/tty.c | 2 +- etc/mk/minix.lib.mk | 15 +++ etc/mk/minix.own.mk | 4 +- etc/mk/minix.prog.mk | 38 ++++--- etc/mk/minix.sys.mk | 8 +- etc/mk/sys.mk | 4 +- include/Makefile | 18 +-- {drivers/libdriver => include/minix}/driver.h | 0 {drivers => include/minix}/drivers.h | 4 +- {drivers/libdriver => include/minix}/drvlib.h | 0 lib/Makefile | 3 +- lib/libdriver/Makefile | 7 ++ {drivers => lib}/libdriver/driver.c | 4 +- {drivers => lib}/libdriver/drvlib.c | 4 +- {drivers => lib}/libdriver/mq.c | 0 servers/Makefile | 39 +------ servers/ds/Makefile | 40 ++----- servers/hgfs/Makefile | 30 +---- servers/hgfs/Makefile.inc | 13 +++ servers/hgfs/hgfs_server/Makefile | 11 ++ servers/hgfs/{ => hgfs_server}/const.h | 0 servers/hgfs/{ => hgfs_server}/dentry.c | 0 servers/hgfs/{ => hgfs_server}/glo.h | 0 servers/hgfs/{ => hgfs_server}/handle.c | 0 servers/hgfs/{ => hgfs_server}/inc.h | 2 +- servers/hgfs/{ => hgfs_server}/inode.c | 0 servers/hgfs/{ => hgfs_server}/inode.h | 0 servers/hgfs/{ => hgfs_server}/link.c | 0 servers/hgfs/{ => hgfs_server}/lookup.c | 0 servers/hgfs/{ => hgfs_server}/main.c | 0 servers/hgfs/{ => hgfs_server}/misc.c | 0 servers/hgfs/{ => hgfs_server}/mount.c | 0 servers/hgfs/{ => hgfs_server}/name.c | 0 servers/hgfs/{ => hgfs_server}/optset.c | 0 servers/hgfs/{ => hgfs_server}/optset.h | 0 servers/hgfs/{ => hgfs_server}/path.c | 0 servers/hgfs/{ => hgfs_server}/proto.h | 0 servers/hgfs/{ => hgfs_server}/read.c | 0 servers/hgfs/{ => hgfs_server}/stat.c | 0 servers/hgfs/{ => hgfs_server}/table.c | 0 servers/hgfs/{ => hgfs_server}/type.h | 0 servers/hgfs/{ => hgfs_server}/util.c | 0 servers/hgfs/{ => hgfs_server}/verify.c | 0 servers/hgfs/{ => hgfs_server}/write.c | 0 servers/hgfs/libhgfs/Makefile | 24 +--- servers/hgfs/libhgfs/backdoor.S | 14 +-- servers/inet/Makefile | 53 +++------ servers/inet/qp.c | 2 +- servers/inet/{minix3 => }/queryparam.c | 2 +- servers/inet/{minix3 => }/queryparam.h | 0 servers/init/Makefile | 38 ++----- servers/ipc/Makefile | 30 ++--- servers/is/Makefile | 44 ++------ servers/iso9660fs/Makefile | 39 ++----- servers/mfs/Makefile | 47 ++------ servers/pfs/Makefile | 35 ++---- servers/pm/Makefile | 46 ++------ servers/rs/Makefile | 50 ++------- servers/rs/service/Makefile | 11 ++ servers/rs/{ => service}/service.c | 0 servers/vfs/Makefile | 44 +++----- servers/vm/Makefile | 40 +++---- servers/vm/{ => arch}/i386/arch_pagefaults.c | 6 +- servers/vm/{ => arch}/i386/arch_vmproc.h | 0 servers/vm/{ => arch}/i386/memory.h | 0 servers/vm/{ => arch}/i386/pagefaults.h | 0 servers/vm/{ => arch}/i386/pagetable.c | 10 +- servers/vm/{ => arch}/i386/pagetable.h | 2 +- servers/vm/arch/i386/util.S | 24 ++++ servers/vm/{ => arch}/i386/vm.c | 6 +- servers/vm/i386/Makefile | 17 --- servers/vm/i386/util.s | 23 ---- tools/Makefile | 18 +-- 182 files changed, 685 insertions(+), 1827 deletions(-) create mode 100644 drivers/audio/Makefile.inc create mode 100644 drivers/audio/common/Makefile rename drivers/audio/{framework => common}/audio_fw.c (100%) rename drivers/audio/{framework => common}/audio_fw.h (99%) rename drivers/audio/{framework => common}/liveupdate.c (100%) rename drivers/audio/{ => es1370}/AC97.h (100%) delete mode 100644 drivers/audio/framework/Makefile delete mode 100644 drivers/libdriver/Makefile delete mode 100644 drivers/memory/imgrd_s.s create mode 100644 drivers/memory/memory_driver/Makefile rename drivers/memory/{ => memory_driver}/imgrd.c (84%) rename drivers/memory/{ => memory_driver}/local.h (100%) rename drivers/memory/{ => memory_driver}/memory.c (98%) create mode 100644 drivers/sb16/Makefile.inc create mode 100644 drivers/sb16/common/Makefile rename drivers/sb16/{ => common}/sb16.c (100%) rename drivers/sb16/{ => common}/sb16.h (99%) create mode 100644 drivers/sb16/dsp/Makefile rename drivers/sb16/{ => dsp}/sb16_dsp.c (100%) rename drivers/sb16/{ => dsp}/sb16_dsp_liveupdate.c (100%) create mode 100644 drivers/sb16/mixer/Makefile rename drivers/sb16/{ => mixer}/sb16_mixer.c (100%) create mode 100644 drivers/tty/keymaps/Makefile.inc rename {drivers/libdriver => include/minix}/driver.h (100%) rename {drivers => include/minix}/drivers.h (90%) rename {drivers/libdriver => include/minix}/drvlib.h (100%) create mode 100644 lib/libdriver/Makefile rename {drivers => lib}/libdriver/driver.c (99%) rename {drivers => lib}/libdriver/drvlib.c (99%) rename {drivers => lib}/libdriver/mq.c (100%) create mode 100644 servers/hgfs/Makefile.inc create mode 100644 servers/hgfs/hgfs_server/Makefile rename servers/hgfs/{ => hgfs_server}/const.h (100%) rename servers/hgfs/{ => hgfs_server}/dentry.c (100%) rename servers/hgfs/{ => hgfs_server}/glo.h (100%) rename servers/hgfs/{ => hgfs_server}/handle.c (100%) rename servers/hgfs/{ => hgfs_server}/inc.h (96%) rename servers/hgfs/{ => hgfs_server}/inode.c (100%) rename servers/hgfs/{ => hgfs_server}/inode.h (100%) rename servers/hgfs/{ => hgfs_server}/link.c (100%) rename servers/hgfs/{ => hgfs_server}/lookup.c (100%) rename servers/hgfs/{ => hgfs_server}/main.c (100%) rename servers/hgfs/{ => hgfs_server}/misc.c (100%) rename servers/hgfs/{ => hgfs_server}/mount.c (100%) rename servers/hgfs/{ => hgfs_server}/name.c (100%) rename servers/hgfs/{ => hgfs_server}/optset.c (100%) rename servers/hgfs/{ => hgfs_server}/optset.h (100%) rename servers/hgfs/{ => hgfs_server}/path.c (100%) rename servers/hgfs/{ => hgfs_server}/proto.h (100%) rename servers/hgfs/{ => hgfs_server}/read.c (100%) rename servers/hgfs/{ => hgfs_server}/stat.c (100%) rename servers/hgfs/{ => hgfs_server}/table.c (100%) rename servers/hgfs/{ => hgfs_server}/type.h (100%) rename servers/hgfs/{ => hgfs_server}/util.c (100%) rename servers/hgfs/{ => hgfs_server}/verify.c (100%) rename servers/hgfs/{ => hgfs_server}/write.c (100%) rename servers/inet/{minix3 => }/queryparam.c (99%) rename servers/inet/{minix3 => }/queryparam.h (100%) create mode 100644 servers/rs/service/Makefile rename servers/rs/{ => service}/service.c (100%) rename servers/vm/{ => arch}/i386/arch_pagefaults.c (92%) rename servers/vm/{ => arch}/i386/arch_vmproc.h (100%) rename servers/vm/{ => arch}/i386/memory.h (100%) rename servers/vm/{ => arch}/i386/pagefaults.h (100%) rename servers/vm/{ => arch}/i386/pagetable.c (99%) rename servers/vm/{ => arch}/i386/pagetable.h (98%) create mode 100644 servers/vm/arch/i386/util.S rename servers/vm/{ => arch}/i386/vm.c (98%) delete mode 100644 servers/vm/i386/Makefile delete mode 100644 servers/vm/i386/util.s diff --git a/Makefile b/Makefile index 1e9699b5e..a036544b5 100644 --- 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 diff --git a/commands/pax/Makefile b/commands/pax/Makefile index 255f70e15..7a7c2ad2c 100644 --- a/commands/pax/Makefile +++ b/commands/pax/Makefile @@ -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 diff --git a/drivers/Makefile b/drivers/Makefile index b72054051..fdcd2dce9 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -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 -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 diff --git a/drivers/amddev/Makefile b/drivers/amddev/Makefile index 7a10e6156..6ea1e8c27 100644 --- a/drivers/amddev/Makefile +++ b/drivers/amddev/Makefile @@ -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 diff --git a/drivers/at_wini/Makefile b/drivers/at_wini/Makefile index b8494e1dc..e7a0e64b8 100644 --- a/drivers/at_wini/Makefile +++ b/drivers/at_wini/Makefile @@ -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 diff --git a/drivers/at_wini/at_wini.h b/drivers/at_wini/at_wini.h index 4f7fbd8ea..8654f9781 100644 --- a/drivers/at_wini/at_wini.h +++ b/drivers/at_wini/at_wini.h @@ -1,6 +1,6 @@ -#include "../drivers.h" -#include "../libdriver/driver.h" -#include "../libdriver/drvlib.h" +#include +#include +#include #define VERBOSE 0 /* display identify messages during boot */ #define ENABLE_ATAPI 1 /* add ATAPI cd-rom support to driver */ diff --git a/drivers/atl2/Makefile b/drivers/atl2/Makefile index f3f392874..94b3b208e 100644 --- a/drivers/atl2/Makefile +++ b/drivers/atl2/Makefile @@ -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 diff --git a/drivers/atl2/atl2.c b/drivers/atl2/atl2.c index 8e8f6f2d4..3190117e3 100644 --- a/drivers/atl2/atl2.c +++ b/drivers/atl2/atl2.c @@ -4,7 +4,7 @@ * heavily on the official Linux driver; this driver is based heavily on both. */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/audio/Makefile b/drivers/audio/Makefile index 8e2b62e2c..2b765b0c6 100644 --- a/drivers/audio/Makefile +++ b/drivers/audio/Makefile @@ -1,9 +1,7 @@ # Makefile for all audio drivers. -MAKE = exec make -$(MAKEFLAGS) -build: all +.include -all install depend clean: - cd ./es1370 && $(MAKE) $@ - cd ./es1371 && $(MAKE) $@ +SUBDIR= common .WAIT es1370 es1371 sb16 +.include diff --git a/drivers/audio/Makefile.inc b/drivers/audio/Makefile.inc new file mode 100644 index 000000000..8bc08c94f --- /dev/null +++ b/drivers/audio/Makefile.inc @@ -0,0 +1,13 @@ +.include + +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/audio/README b/drivers/audio/README index eb0d63311..a7f79249e 100644 --- a/drivers/audio/README +++ b/drivers/audio/README @@ -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 index 000000000..7e3f2e779 --- /dev/null +++ b/drivers/audio/common/Makefile @@ -0,0 +1,8 @@ +# Makefile for the common audio framework + +LIBISPRIVATE= yes + +LIB= common +SRCS= audio_fw.c liveupdate.c + +.include diff --git a/drivers/audio/framework/audio_fw.c b/drivers/audio/common/audio_fw.c similarity index 100% rename from drivers/audio/framework/audio_fw.c rename to drivers/audio/common/audio_fw.c diff --git a/drivers/audio/framework/audio_fw.h b/drivers/audio/common/audio_fw.h similarity index 99% rename from drivers/audio/framework/audio_fw.h rename to drivers/audio/common/audio_fw.h index ea3b6e7a1..dd18704c4 100644 --- a/drivers/audio/framework/audio_fw.h +++ b/drivers/audio/common/audio_fw.h @@ -1,7 +1,7 @@ #ifndef AUDIO_FW_H #define AUDIO_FW_H -#include "../../drivers.h" +#include #include diff --git a/drivers/audio/framework/liveupdate.c b/drivers/audio/common/liveupdate.c similarity index 100% rename from drivers/audio/framework/liveupdate.c rename to drivers/audio/common/liveupdate.c diff --git a/drivers/audio/AC97.h b/drivers/audio/es1370/AC97.h similarity index 100% rename from drivers/audio/AC97.h rename to drivers/audio/es1370/AC97.h diff --git a/drivers/audio/es1370/Makefile b/drivers/audio/es1370/Makefile index c6f2d6a34..eb237c596 100644 --- a/drivers/audio/es1370/Makefile +++ b/drivers/audio/es1370/Makefile @@ -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 diff --git a/drivers/audio/es1370/ak4531.h b/drivers/audio/es1370/ak4531.h index 561da2ec7..a5e4e4ee3 100644 --- a/drivers/audio/es1370/ak4531.h +++ b/drivers/audio/es1370/ak4531.h @@ -2,7 +2,7 @@ #define AK4531_H /* best viewed with tabsize=4 */ -#include "../../drivers.h" +#include #include _PROTOTYPE( int ak4531_init, (u16_t base, u16_t status_reg, u16_t bit, diff --git a/drivers/audio/es1370/es1370.c b/drivers/audio/es1370/es1370.c index aacfad3fe..bcef008e2 100644 --- a/drivers/audio/es1370/es1370.c +++ b/drivers/audio/es1370/es1370.c @@ -17,7 +17,7 @@ #include -#include "../framework/audio_fw.h" +#include "audio_fw.h" #include "es1370.h" #include "ak4531.h" #include "pci_helper.h" diff --git a/drivers/audio/es1370/es1370.h b/drivers/audio/es1370/es1370.h index faabee25b..41a6a2e45 100644 --- a/drivers/audio/es1370/es1370.h +++ b/drivers/audio/es1370/es1370.h @@ -3,7 +3,7 @@ /* best viewed with tabsize=4 */ #include -#include "../../drivers.h" +#include #include diff --git a/drivers/audio/es1370/pci_helper.c b/drivers/audio/es1370/pci_helper.c index 8707f10eb..d985e550a 100644 --- a/drivers/audio/es1370/pci_helper.c +++ b/drivers/audio/es1370/pci_helper.c @@ -1,6 +1,6 @@ /* best viewed with tabsize 4 */ -#include "../../drivers.h" +#include #include #include diff --git a/drivers/audio/es1371/Makefile b/drivers/audio/es1371/Makefile index 8b6f2fdce..4e7016127 100644 --- a/drivers/audio/es1371/Makefile +++ b/drivers/audio/es1371/Makefile @@ -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 diff --git a/drivers/audio/es1371/es1371.c b/drivers/audio/es1371/es1371.c index 63dbda91c..a65a6d1c4 100644 --- a/drivers/audio/es1371/es1371.c +++ b/drivers/audio/es1371/es1371.c @@ -22,7 +22,7 @@ #include -#include "../framework/audio_fw.h" +#include "audio_fw.h" #include "es1371.h" #include "AC97.h" #include "sample_rate_converter.h" diff --git a/drivers/audio/es1371/es1371.h b/drivers/audio/es1371/es1371.h index c3df78793..0395cbc19 100644 --- a/drivers/audio/es1371/es1371.h +++ b/drivers/audio/es1371/es1371.h @@ -3,7 +3,7 @@ /* best viewed with tabsize=4 */ #include -#include "../../drivers.h" +#include #include #include diff --git a/drivers/audio/es1371/pci_helper.c b/drivers/audio/es1371/pci_helper.c index 50f7dabb2..f25df8661 100644 --- a/drivers/audio/es1371/pci_helper.c +++ b/drivers/audio/es1371/pci_helper.c @@ -1,6 +1,6 @@ /* best viewed with tabsize 4 */ -#include "../../drivers.h" +#include #include #include diff --git a/drivers/audio/es1371/wait.c b/drivers/audio/es1371/wait.c index 7c3497e89..97145abe5 100644 --- a/drivers/audio/es1371/wait.c +++ b/drivers/audio/es1371/wait.c @@ -1,4 +1,4 @@ -#include "../../drivers.h" +#include #include #include "pci_helper.h" diff --git a/drivers/audio/framework/Makefile b/drivers/audio/framework/Makefile deleted file mode 100644 index c210c8d13..000000000 --- a/drivers/audio/framework/Makefile +++ /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 diff --git a/drivers/audio/sb16/Makefile b/drivers/audio/sb16/Makefile index f95bbb7e6..415375223 100644 --- a/drivers/audio/sb16/Makefile +++ b/drivers/audio/sb16/Makefile @@ -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 diff --git a/drivers/audio/sb16/sb16.h b/drivers/audio/sb16/sb16.h index 75ae7e25d..38b184390 100644 --- a/drivers/audio/sb16/sb16.h +++ b/drivers/audio/sb16/sb16.h @@ -2,7 +2,7 @@ #define SB16_H #include -#include "../framework/audio_fw.h" +#include "audio_fw.h" #define AUDIO 0 #define MIXER 1 diff --git a/drivers/bios_wini/Makefile b/drivers/bios_wini/Makefile index 52ae04735..2e584ad2e 100644 --- a/drivers/bios_wini/Makefile +++ b/drivers/bios_wini/Makefile @@ -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 diff --git a/drivers/bios_wini/bios_wini.c b/drivers/bios_wini/bios_wini.c index 4088f607f..c9bb15143 100644 --- a/drivers/bios_wini/bios_wini.c +++ b/drivers/bios_wini/bios_wini.c @@ -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 +#include +#include #include #include #include diff --git a/drivers/dec21140A/Makefile b/drivers/dec21140A/Makefile index 873b05516..a22fb4df7 100644 --- a/drivers/dec21140A/Makefile +++ b/drivers/dec21140A/Makefile @@ -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 diff --git a/drivers/dec21140A/dec21140A.c b/drivers/dec21140A/dec21140A.c index cf5589dbe..e8074759f 100644 --- a/drivers/dec21140A/dec21140A.c +++ b/drivers/dec21140A/dec21140A.c @@ -9,7 +9,7 @@ * Created: Mar 2008 by Nicolas Tittley */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/dp8390/3c503.c b/drivers/dp8390/3c503.c index 6cda18a90..09d86b353 100644 --- a/drivers/dp8390/3c503.c +++ b/drivers/dp8390/3c503.c @@ -11,7 +11,7 @@ * I/O could be used as well but would result in poor performance. */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/dp8390/Makefile b/drivers/dp8390/Makefile index 79c33642f..68bd5eeea 100644 --- a/drivers/dp8390/Makefile +++ b/drivers/dp8390/Makefile @@ -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 diff --git a/drivers/dp8390/dp8390.c b/drivers/dp8390/dp8390.c index 08d458876..cd1694628 100644 --- a/drivers/dp8390/dp8390.c +++ b/drivers/dp8390/dp8390.c @@ -52,7 +52,7 @@ * Added support for 3c503 boards. */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/dp8390/ne2000.c b/drivers/dp8390/ne2000.c index 0b678d4ff..fc1c75126 100644 --- a/drivers/dp8390/ne2000.c +++ b/drivers/dp8390/ne2000.c @@ -7,7 +7,7 @@ specific code, the rest is in dp8390.c Created: March 15, 1994 by Philip Homburg */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/dp8390/rtl8029.c b/drivers/dp8390/rtl8029.c index f519868d5..e5885abc1 100644 --- a/drivers/dp8390/rtl8029.c +++ b/drivers/dp8390/rtl8029.c @@ -6,7 +6,7 @@ Initialization of PCI DP8390-based ethernet cards Created: April 2000 by Philip Homburg */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/dp8390/wdeth.c b/drivers/dp8390/wdeth.c index 52747f173..b5a54460e 100644 --- a/drivers/dp8390/wdeth.c +++ b/drivers/dp8390/wdeth.c @@ -4,7 +4,7 @@ wdeth.c Created: March 14, 1994 by Philip Homburg */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/dpeth/3c501.c b/drivers/dpeth/3c501.c index d2e802ea7..e5556fefb 100644 --- a/drivers/dpeth/3c501.c +++ b/drivers/dpeth/3c501.c @@ -11,7 +11,7 @@ ** $Id$ */ -#include "drivers.h" +#include #include #include #include diff --git a/drivers/dpeth/3c503.c b/drivers/dpeth/3c503.c index 631ce110f..71895eb40 100644 --- a/drivers/dpeth/3c503.c +++ b/drivers/dpeth/3c503.c @@ -11,7 +11,7 @@ ** $Id$ */ -#include "drivers.h" +#include #include #include #include "dp.h" diff --git a/drivers/dpeth/3c509.c b/drivers/dpeth/3c509.c index 98a753662..9811537ba 100644 --- a/drivers/dpeth/3c509.c +++ b/drivers/dpeth/3c509.c @@ -11,7 +11,7 @@ ** $Id$ */ -#include "drivers.h" +#include #include #include #include diff --git a/drivers/dpeth/8390.c b/drivers/dpeth/8390.c index 74f887b3c..d5e292627 100644 --- a/drivers/dpeth/8390.c +++ b/drivers/dpeth/8390.c @@ -13,7 +13,7 @@ ** $Id$ */ -#include "drivers.h" +#include #include #include #include diff --git a/drivers/dpeth/Makefile b/drivers/dpeth/Makefile index 60475181c..ba9e822dc 100644 --- a/drivers/dpeth/Makefile +++ b/drivers/dpeth/Makefile @@ -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 diff --git a/drivers/dpeth/devio.c b/drivers/dpeth/devio.c index a2a5349ca..b5c708a92 100644 --- a/drivers/dpeth/devio.c +++ b/drivers/dpeth/devio.c @@ -9,7 +9,7 @@ ** $Id$ */ -#include "drivers.h" +#include #include #include #include "dp.h" diff --git a/drivers/dpeth/dp.c b/drivers/dpeth/dp.c index 3f1eef207..37511e2e8 100644 --- a/drivers/dpeth/dp.c +++ b/drivers/dpeth/dp.c @@ -54,7 +54,7 @@ ** DL_STAT_REPLY) */ -#include "drivers.h" +#include #include #include #include diff --git a/drivers/dpeth/ne.c b/drivers/dpeth/ne.c index b347b926e..eac7100bf 100644 --- a/drivers/dpeth/ne.c +++ b/drivers/dpeth/ne.c @@ -14,7 +14,7 @@ ** $Id$ */ -#include "drivers.h" +#include #include #include #include "dp.h" diff --git a/drivers/dpeth/netbuff.c b/drivers/dpeth/netbuff.c index 2e40db004..1fade3134 100644 --- a/drivers/dpeth/netbuff.c +++ b/drivers/dpeth/netbuff.c @@ -9,7 +9,7 @@ ** $Id$ */ -#include "drivers.h" +#include #include #include #include "dp.h" diff --git a/drivers/dpeth/wd.c b/drivers/dpeth/wd.c index 6a7f156a5..5e0ad2dc8 100644 --- a/drivers/dpeth/wd.c +++ b/drivers/dpeth/wd.c @@ -14,7 +14,7 @@ ** $Id$ */ -#include "drivers.h" +#include #include #include #include "dp.h" diff --git a/drivers/e1000/Makefile b/drivers/e1000/Makefile index 127dfd88a..04650d9b8 100644 --- a/drivers/e1000/Makefile +++ b/drivers/e1000/Makefile @@ -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 diff --git a/drivers/e1000/e1000.c b/drivers/e1000/e1000.c index 117784a99..f53ea991c 100644 --- a/drivers/e1000/e1000.c +++ b/drivers/e1000/e1000.c @@ -5,7 +5,7 @@ * Gigabit Ethernet Controllers. */ -#include "../drivers.h" +#include #include #include #include diff --git a/drivers/e1000/e1000.h b/drivers/e1000/e1000.h index 81ca44521..75f1017ab 100644 --- a/drivers/e1000/e1000.h +++ b/drivers/e1000/e1000.h @@ -18,7 +18,7 @@ #ifndef __E1000_H #define __E1000_H -#include "../drivers.h" +#include #include #include #include diff --git a/drivers/filter/Makefile b/drivers/filter/Makefile index 6ae37a588..41425fede 100644 --- a/drivers/filter/Makefile +++ b/drivers/filter/Makefile @@ -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 diff --git a/drivers/floppy/Makefile b/drivers/floppy/Makefile index 5747b4633..9b9d5d87a 100644 --- a/drivers/floppy/Makefile +++ b/drivers/floppy/Makefile @@ -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 diff --git a/drivers/floppy/floppy.h b/drivers/floppy/floppy.h index 2bc0334b7..4853818fd 100644 --- a/drivers/floppy/floppy.h +++ b/drivers/floppy/floppy.h @@ -1,4 +1,4 @@ -#include "../drivers.h" -#include "../libdriver/driver.h" -#include "../libdriver/drvlib.h" +#include +#include +#include diff --git a/drivers/fxp/Makefile b/drivers/fxp/Makefile index af4a37e26..e26523fa7 100644 --- a/drivers/fxp/Makefile +++ b/drivers/fxp/Makefile @@ -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 diff --git a/drivers/fxp/fxp.c b/drivers/fxp/fxp.c index d7e943db3..f031261f6 100644 --- a/drivers/fxp/fxp.c +++ b/drivers/fxp/fxp.c @@ -52,7 +52,7 @@ * Created: Nov 2004 by Philip Homburg */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/fxp/mii.c b/drivers/fxp/mii.c index 39d65641f..b72765054 100644 --- a/drivers/fxp/mii.c +++ b/drivers/fxp/mii.c @@ -6,7 +6,7 @@ Created: Nov 2004 by Philip Homburg Media Independent (Ethernet) Interface functions */ -#include "../drivers.h" +#include #if __minix_vmd #include "config.h" #endif diff --git a/drivers/hello/Makefile b/drivers/hello/Makefile index addbc5f6c..e2fa502ab 100644 --- a/drivers/hello/Makefile +++ b/drivers/hello/Makefile @@ -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 diff --git a/drivers/hello/hello.c b/drivers/hello/hello.c index 129bceba5..dbcaff3f5 100644 --- a/drivers/hello/hello.c +++ b/drivers/hello/hello.c @@ -1,5 +1,5 @@ -#include "../drivers.h" -#include "../libdriver/driver.h" +#include +#include #include #include #include diff --git a/drivers/lance/Makefile b/drivers/lance/Makefile index ec7dd19b2..f2c13efc3 100644 --- a/drivers/lance/Makefile +++ b/drivers/lance/Makefile @@ -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 diff --git a/drivers/lance/lance.c b/drivers/lance/lance.c index 26d5456c8..fe4976dd5 100644 --- a/drivers/lance/lance.c +++ b/drivers/lance/lance.c @@ -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 #include #include diff --git a/drivers/libdriver/Makefile b/drivers/libdriver/Makefile deleted file mode 100644 index c9b944d9e..000000000 --- a/drivers/libdriver/Makefile +++ /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 - - diff --git a/drivers/log/Makefile b/drivers/log/Makefile index 672e18ad9..36f8b1445 100644 --- a/drivers/log/Makefile +++ b/drivers/log/Makefile @@ -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 diff --git a/drivers/log/log.h b/drivers/log/log.h index d18030507..6cc5e4a0a 100644 --- a/drivers/log/log.h +++ b/drivers/log/log.h @@ -1,6 +1,6 @@ /* Includes. */ -#include "../drivers.h" -#include "../libdriver/driver.h" +#include +#include #include #include #include diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile index b124a4db9..df986f13e 100644 --- a/drivers/memory/Makefile +++ b/drivers/memory/Makefile @@ -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 +SUBDIR= ramdisk .WAIT memory_driver +.include diff --git a/drivers/memory/imgrd_s.s b/drivers/memory/imgrd_s.s deleted file mode 100644 index 08e4e030f..000000000 --- a/drivers/memory/imgrd_s.s +++ /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 index 000000000..b14925465 --- /dev/null +++ b/drivers/memory/memory_driver/Makefile @@ -0,0 +1,17 @@ +# Makefile for memory driver (MEMORY) +.include + +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 +.include diff --git a/drivers/memory/imgrd.c b/drivers/memory/memory_driver/imgrd.c similarity index 84% rename from drivers/memory/imgrd.c rename to drivers/memory/memory_driver/imgrd.c index cc9bd8518..947b7ffc3 100644 --- a/drivers/memory/imgrd.c +++ b/drivers/memory/memory_driver/imgrd.c @@ -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); diff --git a/drivers/memory/local.h b/drivers/memory/memory_driver/local.h similarity index 100% rename from drivers/memory/local.h rename to drivers/memory/memory_driver/local.h diff --git a/drivers/memory/memory.c b/drivers/memory/memory_driver/memory.c similarity index 98% rename from drivers/memory/memory.c rename to drivers/memory/memory_driver/memory.c index 8eaad90e2..92c4822ee 100644 --- a/drivers/memory/memory.c +++ b/drivers/memory/memory_driver/memory.c @@ -15,15 +15,15 @@ * Apr 20, 1992 device dependent/independent split (Kees J. Bot) */ -#include "../drivers.h" -#include "../libdriver/driver.h" +#include +#include #include #include #include #include -#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 diff --git a/drivers/memory/ramdisk/Makefile b/drivers/memory/ramdisk/Makefile index ea7a043f5..ff9ee3a00 100644 --- a/drivers/memory/ramdisk/Makefile +++ b/drivers/memory/ramdisk/Makefile @@ -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 diff --git a/drivers/orinoco/Makefile b/drivers/orinoco/Makefile index 337dcc89d..3833e819a 100644 --- a/drivers/orinoco/Makefile +++ b/drivers/orinoco/Makefile @@ -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 diff --git a/drivers/orinoco/hermes.h b/drivers/orinoco/hermes.h index 9f43dd833..38a79be9b 100644 --- a/drivers/orinoco/hermes.h +++ b/drivers/orinoco/hermes.h @@ -19,7 +19,7 @@ #ifndef _HERMES_H #define _HERMES_H -#include "../drivers.h" +#include #include #include #include diff --git a/drivers/orinoco/orinoco.c b/drivers/orinoco/orinoco.c index ef5f24625..138f3733f 100644 --- a/drivers/orinoco/orinoco.c +++ b/drivers/orinoco/orinoco.c @@ -53,7 +53,7 @@ * */ -#include "../drivers.h" +#include #include #include #include diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index e655e56dc..ce07655b6 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile @@ -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 diff --git a/drivers/pci/main.c b/drivers/pci/main.c index f96349dac..d0b042546 100644 --- a/drivers/pci/main.c +++ b/drivers/pci/main.c @@ -2,7 +2,7 @@ main.c */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 5c8485c6e..3dfb20f0b 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -8,7 +8,7 @@ Configure devices on the PCI bus Created: Jan 2000 by Philip Homburg */ -#include "../drivers.h" +#include #include #include #include diff --git a/drivers/pci/pci_table.c b/drivers/pci/pci_table.c index 3f8702d5a..0291a7574 100644 --- a/drivers/pci/pci_table.c +++ b/drivers/pci/pci_table.c @@ -13,7 +13,7 @@ See the Linux PCI ID Repository . * 2004-08-08 (asw) add Intel 82371AB (0x8086, 0x7100) */ -#include "../drivers.h" +#include #include "pci.h" #if __minix_vmd #include "config.h" diff --git a/drivers/printer/Makefile b/drivers/printer/Makefile index 5150b8073..215ac7b89 100644 --- a/drivers/printer/Makefile +++ b/drivers/printer/Makefile @@ -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 diff --git a/drivers/printer/liveupdate.c b/drivers/printer/liveupdate.c index de040947e..d0666d548 100644 --- a/drivers/printer/liveupdate.c +++ b/drivers/printer/liveupdate.c @@ -1,4 +1,4 @@ -#include "../drivers.h" +#include /* State management variables. */ EXTERN int writing; diff --git a/drivers/printer/printer.c b/drivers/printer/printer.c index 152310a7d..6c25e49e7 100644 --- a/drivers/printer/printer.c +++ b/drivers/printer/printer.c @@ -33,7 +33,7 @@ */ #include -#include "../drivers.h" +#include /* Control bits (in port_base + 2). "+" means positive logic and "-" means * negative logic. Most of the signals are negative logic on the pins but diff --git a/drivers/random/Makefile b/drivers/random/Makefile index 81b52ec82..6287c5878 100644 --- a/drivers/random/Makefile +++ b/drivers/random/Makefile @@ -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 diff --git a/drivers/random/main.c b/drivers/random/main.c index 773e37848..712772968 100644 --- a/drivers/random/main.c +++ b/drivers/random/main.c @@ -3,8 +3,8 @@ * /dev/random - random number generator */ -#include "../drivers.h" -#include "../libdriver/driver.h" +#include +#include #include #include "assert.h" diff --git a/drivers/random/random.c b/drivers/random/random.c index ad81e3676..bab0d3307 100644 --- a/drivers/random/random.c +++ b/drivers/random/random.c @@ -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 #include "../../kernel/const.h" #include "assert.h" diff --git a/drivers/readclock/Makefile b/drivers/readclock/Makefile index 193631198..984cbe626 100644 --- a/drivers/readclock/Makefile +++ b/drivers/readclock/Makefile @@ -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 diff --git a/drivers/rtl8139/Makefile b/drivers/rtl8139/Makefile index f9b2469ba..b83e12dc6 100644 --- a/drivers/rtl8139/Makefile +++ b/drivers/rtl8139/Makefile @@ -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 diff --git a/drivers/rtl8139/rtl8139.h b/drivers/rtl8139/rtl8139.h index d7076ee56..c8a299a89 100644 --- a/drivers/rtl8139/rtl8139.h +++ b/drivers/rtl8139/rtl8139.h @@ -4,7 +4,7 @@ ibm/rtl8139.h Created: Aug 2003 by Philip Homburg */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/rtl8169/Makefile b/drivers/rtl8169/Makefile index a08159b27..dc1a68361 100644 --- a/drivers/rtl8169/Makefile +++ b/drivers/rtl8169/Makefile @@ -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 diff --git a/drivers/rtl8169/rtl8169.c b/drivers/rtl8169/rtl8169.c index 0dd7992b7..dfee1dddb 100644 --- a/drivers/rtl8169/rtl8169.c +++ b/drivers/rtl8169/rtl8169.c @@ -6,7 +6,7 @@ * */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/sb16/Makefile b/drivers/sb16/Makefile index 59e749b33..ac1aac5b3 100644 --- a/drivers/sb16/Makefile +++ b/drivers/sb16/Makefile @@ -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 +SUBDIR= common .WAIT dsp mixer +.include diff --git a/drivers/sb16/Makefile.inc b/drivers/sb16/Makefile.inc new file mode 100644 index 000000000..8bc08c94f --- /dev/null +++ b/drivers/sb16/Makefile.inc @@ -0,0 +1,13 @@ +.include + +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 index 000000000..8af3a809e --- /dev/null +++ b/drivers/sb16/common/Makefile @@ -0,0 +1,8 @@ +# Makefile for the Sound Blaster 16 (SB16) common + +LIBISPRIVATE= yes + +LIB= common +SRCS= sb16.c + +.include diff --git a/drivers/sb16/sb16.c b/drivers/sb16/common/sb16.c similarity index 100% rename from drivers/sb16/sb16.c rename to drivers/sb16/common/sb16.c diff --git a/drivers/sb16/sb16.h b/drivers/sb16/common/sb16.h similarity index 99% rename from drivers/sb16/sb16.h rename to drivers/sb16/common/sb16.h index 958da237b..0b1d4562f 100644 --- a/drivers/sb16/sb16.h +++ b/drivers/sb16/common/sb16.h @@ -1,7 +1,7 @@ #ifndef SB16_H #define SB16_H -#include "../drivers.h" +#include #include #include diff --git a/drivers/sb16/dsp/Makefile b/drivers/sb16/dsp/Makefile new file mode 100644 index 000000000..43e75c2ba --- /dev/null +++ b/drivers/sb16/dsp/Makefile @@ -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 diff --git a/drivers/sb16/sb16_dsp.c b/drivers/sb16/dsp/sb16_dsp.c similarity index 100% rename from drivers/sb16/sb16_dsp.c rename to drivers/sb16/dsp/sb16_dsp.c diff --git a/drivers/sb16/sb16_dsp_liveupdate.c b/drivers/sb16/dsp/sb16_dsp_liveupdate.c similarity index 100% rename from drivers/sb16/sb16_dsp_liveupdate.c rename to drivers/sb16/dsp/sb16_dsp_liveupdate.c diff --git a/drivers/sb16/mixer/Makefile b/drivers/sb16/mixer/Makefile new file mode 100644 index 000000000..28edb53d4 --- /dev/null +++ b/drivers/sb16/mixer/Makefile @@ -0,0 +1,9 @@ +# Makefile for the Sound Blaster 16 (SB16) mixer +PROG= sb16_mixer +SRCS= sb16_mixer.c + +MAN= + +BINDIR?= /usr/sbin + +.include diff --git a/drivers/sb16/sb16_mixer.c b/drivers/sb16/mixer/sb16_mixer.c similarity index 100% rename from drivers/sb16/sb16_mixer.c rename to drivers/sb16/mixer/sb16_mixer.c diff --git a/drivers/ti1225/Makefile b/drivers/ti1225/Makefile index 43e21e174..6ad5d59c6 100644 --- a/drivers/ti1225/Makefile +++ b/drivers/ti1225/Makefile @@ -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 diff --git a/drivers/ti1225/ti1225.c b/drivers/ti1225/ti1225.c index 4f50e3014..61c2a06e9 100644 --- a/drivers/ti1225/ti1225.c +++ b/drivers/ti1225/ti1225.c @@ -4,7 +4,7 @@ ti1225.c Created: Dec 2005 by Philip Homburg */ -#include "../drivers.h" +#include #include #include diff --git a/drivers/tty/Makefile b/drivers/tty/Makefile index ab7763371..468c7eefb 100644 --- a/drivers/tty/Makefile +++ b/drivers/tty/Makefile @@ -1,46 +1,21 @@ # Makefile for terminal driver (TTY) -DRIVER = tty -include /etc/make.conf +.include -# 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 +.include diff --git a/drivers/tty/console.c b/drivers/tty/console.c index 816bd6283..00d30adab 100644 --- a/drivers/tty/console.c +++ b/drivers/tty/console.c @@ -16,7 +16,7 @@ * and the scrolling function worries about wrapping. */ -#include +#include #include #include #include diff --git a/drivers/tty/keyboard.c b/drivers/tty/keyboard.c index 9fe9dd5be..bdf2e40d5 100644 --- a/drivers/tty/keyboard.c +++ b/drivers/tty/keyboard.c @@ -6,7 +6,7 @@ * Feb 04, 1994 loadable keymaps (Marcus Hampel) */ -#include +#include #include #include #include diff --git a/drivers/tty/keymaps/Makefile b/drivers/tty/keymaps/Makefile index dfaf1b29a..7cffe9162 100644 --- a/drivers/tty/keymaps/Makefile +++ b/drivers/tty/keymaps/Makefile @@ -1,101 +1,12 @@ # Generate binary keymaps. -LK = /usr/lib/keymaps +.include -.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 diff --git a/drivers/tty/keymaps/Makefile.inc b/drivers/tty/keymaps/Makefile.inc new file mode 100644 index 000000000..b6885d4aa --- /dev/null +++ b/drivers/tty/keymaps/Makefile.inc @@ -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} diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 3949a7015..025c27245 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -16,7 +16,7 @@ * end are to be read at the other end and vice-versa. */ -#include "../drivers.h" +#include #include #include #include diff --git a/drivers/tty/rs232.c b/drivers/tty/rs232.c index 649962627..f6fc7332e 100644 --- a/drivers/tty/rs232.c +++ b/drivers/tty/rs232.c @@ -4,7 +4,7 @@ * Added support for Atari ST M68901 and YM-2149 --kub * *---------------------------------------------------------------------------*/ -#include "../drivers.h" +#include #include #include #include "tty.h" diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index 3cbec48e6..af47414a6 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -57,7 +57,7 @@ * Jul 13, 2004 support for function key observers (Jorrit N. Herder) */ -#include +#include #include #include #include diff --git a/etc/mk/minix.lib.mk b/etc/mk/minix.lib.mk index 9c893fbe6..ebcf24c5d 100644 --- a/etc/mk/minix.lib.mk +++ b/etc/mk/minix.lib.mk @@ -6,6 +6,8 @@ # Pull in here so we can override its .c.o rule .include +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 +.include +.include .include .if ${COMPILER_TYPE} == "ack" diff --git a/etc/mk/minix.own.mk b/etc/mk/minix.own.mk index f58cb0514..642ff0940 100644 --- a/etc/mk/minix.own.mk +++ b/etc/mk/minix.own.mk @@ -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 diff --git a/etc/mk/minix.prog.mk b/etc/mk/minix.prog.mk index fa9026899..51c55daaf 100644 --- a/etc/mk/minix.prog.mk +++ b/etc/mk/minix.prog.mk @@ -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 diff --git a/etc/mk/minix.sys.mk b/etc/mk/minix.sys.mk index 0bc0fb102..d7cb479ed 100644 --- a/etc/mk/minix.sys.mk +++ b/etc/mk/minix.sys.mk @@ -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?= diff --git a/etc/mk/sys.mk b/etc/mk/sys.mk index 87112fb4b..98167a076 100644 --- a/etc/mk/sys.mk +++ b/etc/mk/sys.mk @@ -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?= diff --git a/include/Makefile b/include/Makefile index d23e024be..f49bd609a 100644 --- a/include/Makefile +++ b/include/Makefile @@ -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 \ diff --git a/drivers/libdriver/driver.h b/include/minix/driver.h similarity index 100% rename from drivers/libdriver/driver.h rename to include/minix/driver.h diff --git a/drivers/drivers.h b/include/minix/drivers.h similarity index 90% rename from drivers/drivers.h rename to include/minix/drivers.h index 8da9f5260..b68b447fb 100644 --- a/drivers/drivers.h +++ b/include/minix/drivers.h @@ -24,8 +24,8 @@ #include #include /* IRQ vectors and miscellaneous ports */ -#include /* BIOS index numbers */ -#include /* Well-known ports */ +#include /* BIOS index numbers */ +#include /* Well-known ports */ #include #include diff --git a/drivers/libdriver/drvlib.h b/include/minix/drvlib.h similarity index 100% rename from drivers/libdriver/drvlib.h rename to include/minix/drvlib.h diff --git a/lib/Makefile b/lib/Makefile index 41a1a4700..2b3f8b1ef 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,6 +1,7 @@ .include -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 index 000000000..86c269bca --- /dev/null +++ b/lib/libdriver/Makefile @@ -0,0 +1,7 @@ +# Makefile for libdriver + +LIB= driver + +SRCS= driver.c drvlib.c mq.c + +.include diff --git a/drivers/libdriver/driver.c b/lib/libdriver/driver.c similarity index 99% rename from drivers/libdriver/driver.c rename to lib/libdriver/driver.c index 8e3f7385b..5b9a88e4f 100644 --- a/drivers/libdriver/driver.c +++ b/lib/libdriver/driver.c @@ -36,11 +36,11 @@ */ -#include "../drivers.h" +#include #include #include #include -#include "driver.h" +#include /* Claim space for variables. */ u8_t *tmp_buf = NULL; /* the DMA buffer eventually */ diff --git a/drivers/libdriver/drvlib.c b/lib/libdriver/drvlib.c similarity index 99% rename from drivers/libdriver/drvlib.c rename to lib/libdriver/drvlib.c index 3f9f795bd..38f4ce033 100644 --- a/drivers/libdriver/drvlib.c +++ b/lib/libdriver/drvlib.c @@ -4,8 +4,8 @@ * partition: partition a disk to the partition table(s) on it. */ -#include "driver.h" -#include "drvlib.h" +#include +#include #include /* Extended partition? */ diff --git a/drivers/libdriver/mq.c b/lib/libdriver/mq.c similarity index 100% rename from drivers/libdriver/mq.c rename to lib/libdriver/mq.c diff --git a/servers/Makefile b/servers/Makefile index 3da04d36c..1e251c75b 100644 --- a/servers/Makefile +++ b/servers/Makefile @@ -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 -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 diff --git a/servers/ds/Makefile b/servers/ds/Makefile index a99761000..3fc6b1c35 100644 --- a/servers/ds/Makefile +++ b/servers/ds/Makefile @@ -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 diff --git a/servers/hgfs/Makefile b/servers/hgfs/Makefile index 98b7d5e6a..483c9b51e 100644 --- a/servers/hgfs/Makefile +++ b/servers/hgfs/Makefile @@ -1,31 +1,7 @@ # Makefile for VMware Host/Guest File System (HGFS) server -SERVER=hgfs -LIBHGFSDIR=./libhgfs -LIBHGFS=$(LIBHGFSDIR)/libhgfs.a +.include -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 diff --git a/servers/hgfs/Makefile.inc b/servers/hgfs/Makefile.inc new file mode 100644 index 000000000..4229a0154 --- /dev/null +++ b/servers/hgfs/Makefile.inc @@ -0,0 +1,13 @@ +.include + +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 index 000000000..ce98eb49b --- /dev/null +++ b/servers/hgfs/hgfs_server/Makefile @@ -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 diff --git a/servers/hgfs/const.h b/servers/hgfs/hgfs_server/const.h similarity index 100% rename from servers/hgfs/const.h rename to servers/hgfs/hgfs_server/const.h diff --git a/servers/hgfs/dentry.c b/servers/hgfs/hgfs_server/dentry.c similarity index 100% rename from servers/hgfs/dentry.c rename to servers/hgfs/hgfs_server/dentry.c diff --git a/servers/hgfs/glo.h b/servers/hgfs/hgfs_server/glo.h similarity index 100% rename from servers/hgfs/glo.h rename to servers/hgfs/hgfs_server/glo.h diff --git a/servers/hgfs/handle.c b/servers/hgfs/hgfs_server/handle.c similarity index 100% rename from servers/hgfs/handle.c rename to servers/hgfs/hgfs_server/handle.c diff --git a/servers/hgfs/inc.h b/servers/hgfs/hgfs_server/inc.h similarity index 96% rename from servers/hgfs/inc.h rename to servers/hgfs/hgfs_server/inc.h index 01b77c660..5f983a598 100644 --- a/servers/hgfs/inc.h +++ b/servers/hgfs/hgfs_server/inc.h @@ -27,7 +27,7 @@ #include #include -#include "libhgfs/hgfs.h" +#include "hgfs.h" #include "type.h" #include "const.h" diff --git a/servers/hgfs/inode.c b/servers/hgfs/hgfs_server/inode.c similarity index 100% rename from servers/hgfs/inode.c rename to servers/hgfs/hgfs_server/inode.c diff --git a/servers/hgfs/inode.h b/servers/hgfs/hgfs_server/inode.h similarity index 100% rename from servers/hgfs/inode.h rename to servers/hgfs/hgfs_server/inode.h diff --git a/servers/hgfs/link.c b/servers/hgfs/hgfs_server/link.c similarity index 100% rename from servers/hgfs/link.c rename to servers/hgfs/hgfs_server/link.c diff --git a/servers/hgfs/lookup.c b/servers/hgfs/hgfs_server/lookup.c similarity index 100% rename from servers/hgfs/lookup.c rename to servers/hgfs/hgfs_server/lookup.c diff --git a/servers/hgfs/main.c b/servers/hgfs/hgfs_server/main.c similarity index 100% rename from servers/hgfs/main.c rename to servers/hgfs/hgfs_server/main.c diff --git a/servers/hgfs/misc.c b/servers/hgfs/hgfs_server/misc.c similarity index 100% rename from servers/hgfs/misc.c rename to servers/hgfs/hgfs_server/misc.c diff --git a/servers/hgfs/mount.c b/servers/hgfs/hgfs_server/mount.c similarity index 100% rename from servers/hgfs/mount.c rename to servers/hgfs/hgfs_server/mount.c diff --git a/servers/hgfs/name.c b/servers/hgfs/hgfs_server/name.c similarity index 100% rename from servers/hgfs/name.c rename to servers/hgfs/hgfs_server/name.c diff --git a/servers/hgfs/optset.c b/servers/hgfs/hgfs_server/optset.c similarity index 100% rename from servers/hgfs/optset.c rename to servers/hgfs/hgfs_server/optset.c diff --git a/servers/hgfs/optset.h b/servers/hgfs/hgfs_server/optset.h similarity index 100% rename from servers/hgfs/optset.h rename to servers/hgfs/hgfs_server/optset.h diff --git a/servers/hgfs/path.c b/servers/hgfs/hgfs_server/path.c similarity index 100% rename from servers/hgfs/path.c rename to servers/hgfs/hgfs_server/path.c diff --git a/servers/hgfs/proto.h b/servers/hgfs/hgfs_server/proto.h similarity index 100% rename from servers/hgfs/proto.h rename to servers/hgfs/hgfs_server/proto.h diff --git a/servers/hgfs/read.c b/servers/hgfs/hgfs_server/read.c similarity index 100% rename from servers/hgfs/read.c rename to servers/hgfs/hgfs_server/read.c diff --git a/servers/hgfs/stat.c b/servers/hgfs/hgfs_server/stat.c similarity index 100% rename from servers/hgfs/stat.c rename to servers/hgfs/hgfs_server/stat.c diff --git a/servers/hgfs/table.c b/servers/hgfs/hgfs_server/table.c similarity index 100% rename from servers/hgfs/table.c rename to servers/hgfs/hgfs_server/table.c diff --git a/servers/hgfs/type.h b/servers/hgfs/hgfs_server/type.h similarity index 100% rename from servers/hgfs/type.h rename to servers/hgfs/hgfs_server/type.h diff --git a/servers/hgfs/util.c b/servers/hgfs/hgfs_server/util.c similarity index 100% rename from servers/hgfs/util.c rename to servers/hgfs/hgfs_server/util.c diff --git a/servers/hgfs/verify.c b/servers/hgfs/hgfs_server/verify.c similarity index 100% rename from servers/hgfs/verify.c rename to servers/hgfs/hgfs_server/verify.c diff --git a/servers/hgfs/write.c b/servers/hgfs/hgfs_server/write.c similarity index 100% rename from servers/hgfs/write.c rename to servers/hgfs/hgfs_server/write.c diff --git a/servers/hgfs/libhgfs/Makefile b/servers/hgfs/libhgfs/Makefile index c482560cd..d7947cdfd 100644 --- a/servers/hgfs/libhgfs/Makefile +++ b/servers/hgfs/libhgfs/Makefile @@ -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 diff --git a/servers/hgfs/libhgfs/backdoor.S b/servers/hgfs/libhgfs/backdoor.S index 870419d3c..e33ae487c 100644 --- a/servers/hgfs/libhgfs/backdoor.S +++ b/servers/hgfs/libhgfs/backdoor.S @@ -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 diff --git a/servers/inet/Makefile b/servers/inet/Makefile index 356e91293..1285617e1 100644 --- a/servers/inet/Makefile +++ b/servers/inet/Makefile @@ -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 diff --git a/servers/inet/qp.c b/servers/inet/qp.c index 439097021..c6bc310ca 100644 --- a/servers/inet/qp.c +++ b/servers/inet/qp.c @@ -10,7 +10,7 @@ Created: June 1995 by Philip Homburg #include "generic/assert.h" #include -#include +#include "queryparam.h" #include "generic/buf.h" #include "generic/clock.h" diff --git a/servers/inet/minix3/queryparam.c b/servers/inet/queryparam.c similarity index 99% rename from servers/inet/minix3/queryparam.c rename to servers/inet/queryparam.c index 3fb164786..26bf5d7f4 100644 --- a/servers/inet/minix3/queryparam.c +++ b/servers/inet/queryparam.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "queryparam.h" #if EXAMPLE struct stat st[2]; diff --git a/servers/inet/minix3/queryparam.h b/servers/inet/queryparam.h similarity index 100% rename from servers/inet/minix3/queryparam.h rename to servers/inet/queryparam.h diff --git a/servers/init/Makefile b/servers/init/Makefile index 6815e791a..9490587d2 100644 --- a/servers/init/Makefile +++ b/servers/init/Makefile @@ -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 diff --git a/servers/ipc/Makefile b/servers/ipc/Makefile index e8152c7a4..e98a9fbbd 100644 --- a/servers/ipc/Makefile +++ b/servers/ipc/Makefile @@ -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 diff --git a/servers/is/Makefile b/servers/is/Makefile index fb8de4aaa..d6ce20a29 100644 --- a/servers/is/Makefile +++ b/servers/is/Makefile @@ -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 diff --git a/servers/iso9660fs/Makefile b/servers/iso9660fs/Makefile index 51540fb88..c776b6675 100644 --- a/servers/iso9660fs/Makefile +++ b/servers/iso9660fs/Makefile @@ -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 diff --git a/servers/mfs/Makefile b/servers/mfs/Makefile index 4f8f2692b..fcdcab9a8 100644 --- a/servers/mfs/Makefile +++ b/servers/mfs/Makefile @@ -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 diff --git a/servers/pfs/Makefile b/servers/pfs/Makefile index cee68f7b9..a5fc8f799 100644 --- a/servers/pfs/Makefile +++ b/servers/pfs/Makefile @@ -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 diff --git a/servers/pm/Makefile b/servers/pm/Makefile index c48759275..bdf1aab60 100644 --- a/servers/pm/Makefile +++ b/servers/pm/Makefile @@ -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 diff --git a/servers/rs/Makefile b/servers/rs/Makefile index 20b8d6dde..841692f93 100644 --- a/servers/rs/Makefile +++ b/servers/rs/Makefile @@ -1,46 +1,18 @@ # Makefile for Reincarnation Server (RS) -SERVER = rs -UTIL = service +.include -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 +.include diff --git a/servers/rs/service/Makefile b/servers/rs/service/Makefile new file mode 100644 index 000000000..03e23fc8c --- /dev/null +++ b/servers/rs/service/Makefile @@ -0,0 +1,11 @@ +# Makefile for service +.include + +PROG= service +SRCS= service.c + +MAN= + +BINDIR?= /bin + +.include diff --git a/servers/rs/service.c b/servers/rs/service/service.c similarity index 100% rename from servers/rs/service.c rename to servers/rs/service/service.c diff --git a/servers/vfs/Makefile b/servers/vfs/Makefile index 4373a9bc6..490d9dfc7 100644 --- a/servers/vfs/Makefile +++ b/servers/vfs/Makefile @@ -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 diff --git a/servers/vm/Makefile b/servers/vm/Makefile index defbdd8bb..587d92d6d 100644 --- a/servers/vm/Makefile +++ b/servers/vm/Makefile @@ -1,34 +1,22 @@ # Makefile for VM server -SERVER = vm +.include -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 diff --git a/servers/vm/i386/arch_pagefaults.c b/servers/vm/arch/i386/arch_pagefaults.c similarity index 92% rename from servers/vm/i386/arch_pagefaults.c rename to servers/vm/arch/i386/arch_pagefaults.c index 83c38723b..918420e8b 100644 --- a/servers/vm/i386/arch_pagefaults.c +++ b/servers/vm/arch/i386/arch_pagefaults.c @@ -22,9 +22,9 @@ #include #include -#include "../glo.h" -#include "../proto.h" -#include "../util.h" +#include "glo.h" +#include "proto.h" +#include "util.h" /*===========================================================================* * arch_handle_pagefaults * diff --git a/servers/vm/i386/arch_vmproc.h b/servers/vm/arch/i386/arch_vmproc.h similarity index 100% rename from servers/vm/i386/arch_vmproc.h rename to servers/vm/arch/i386/arch_vmproc.h diff --git a/servers/vm/i386/memory.h b/servers/vm/arch/i386/memory.h similarity index 100% rename from servers/vm/i386/memory.h rename to servers/vm/arch/i386/memory.h diff --git a/servers/vm/i386/pagefaults.h b/servers/vm/arch/i386/pagefaults.h similarity index 100% rename from servers/vm/i386/pagefaults.h rename to servers/vm/arch/i386/pagefaults.h diff --git a/servers/vm/i386/pagetable.c b/servers/vm/arch/i386/pagetable.c similarity index 99% rename from servers/vm/i386/pagetable.c rename to servers/vm/arch/i386/pagetable.c index 1d9d8a999..66e28c520 100644 --- a/servers/vm/i386/pagetable.c +++ b/servers/vm/arch/i386/pagetable.c @@ -27,11 +27,11 @@ #include #include -#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" diff --git a/servers/vm/i386/pagetable.h b/servers/vm/arch/i386/pagetable.h similarity index 98% rename from servers/vm/i386/pagetable.h rename to servers/vm/arch/i386/pagetable.h index 4d17e798b..c1eacc8a2 100644 --- a/servers/vm/i386/pagetable.h +++ b/servers/vm/arch/i386/pagetable.h @@ -5,7 +5,7 @@ #include #include -#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 index 000000000..fd65e26a4 --- /dev/null +++ b/servers/vm/arch/i386/util.S @@ -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 diff --git a/servers/vm/i386/vm.c b/servers/vm/arch/i386/vm.c similarity index 98% rename from servers/vm/i386/vm.c rename to servers/vm/arch/i386/vm.c index f23534e7a..3df08eb28 100644 --- a/servers/vm/i386/vm.c +++ b/servers/vm/arch/i386/vm.c @@ -20,9 +20,9 @@ #include #include -#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 index 7f97f1341..000000000 --- a/servers/vm/i386/Makefile +++ /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 index 7b3122731..000000000 --- a/servers/vm/i386/util.s +++ /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 diff --git a/tools/Makefile b/tools/Makefile index 803367f44..c01eff574 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -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 -- 2.44.0