
#.PATH:	${.CURDIR}/../../dev/getb
KMOD	= if_getb
VGET_SRCS = if_getb.c if_getb.h velocity_hw.c velocity_hw.h osdep.h
VGET_SRCS += velocity_mac.h velocity_mii.h velocity_desc.h if_getb_cfg.h if_getb_dbg.h
SRCS	= ${VGET_SRCS} opt_bdg.h device_if.h bus_if.h pci_if.h

VGET_DIR=/usr/src/sys/dev/getb
VGET_MOD=/usr/src/sys/modules/getb

install_getb: install_getb_mod
	@mkdir -p ${VGET_DIR}
	@cat ./if_getb.c | sed 's/\"if_getb.h\"/<dev\/getb\/if_getb.h>/' > ${VGET_DIR}/if_getb.c
	@cp ./if_getb.h ./if_getb.h.old
	@cat ./if_getb.h | sed 's/\"velocity_hw.h\"/<dev\/getb\/velocity_hw.h>/' > ./if_getb.h.new
	@cp ./if_getb.h.new ./if_getb.h
	@cat ./if_getb.h | sed 's/\"velocity_mii.h\"/<dev\/getb\/velocity_mii.h>/' > ./if_getb.h.new
	@cp ./if_getb.h.new ./if_getb.h
	@cat ./if_getb.h | sed 's/\"velocity_mac.h\"/<dev\/getb\/velocity_mac.h>/' > ./if_getb.h.new
	@cp ./if_getb.h.new ./if_getb.h
	@cat ./if_getb.h | sed 's/\"velocity_desc.h\"/<dev\/getb\/velocity_desc.h>/' > ./if_getb.h.new
	@cp ./if_getb.h.new ./if_getb.h
	@cat ./if_getb.h | sed 's/\"if_getb_cfg.h\"/<dev\/getb\/if_getb_cfg.h>/' > ./if_getb.h.new
	@cp ./if_getb.h.new ./if_getb.h
	@cat ./if_getb.h | sed 's/\"if_getb_dbg.h\"/<dev\/getb\/if_getb_dbg.h>/' > ./if_getb.h.new
	@cp ./if_getb.h.new ${VGET_DIR}/if_getb.h
	@cp ./if_getb.h.old ./if_getb.h
	@rm ./if_getb.h.old
	@rm ./if_getb.h.new
	@cp ./velocity_hw.c ./velocity_hw.c.old
	@cat ./velocity_hw.c | sed 's/\"velocity_hw.h\"/<dev\/getb\/velocity_hw.h>/' > ./velocity_hw.c.new
	@cp ./velocity_hw.c.new ./velocity_hw.c
	@cat ./velocity_hw.c | sed 's/\"velocity_mii.h\"/<dev\/getb\/velocity_mii.h>/' > ./velocity_hw.c.new
	@cp ./velocity_hw.c.new ./velocity_hw.c
	@cat ./velocity_hw.c | sed 's/\"velocity_mac.h\"/<dev\/getb\/velocity_mac.h>/' > ./velocity_hw.c.new
	@cp ./velocity_hw.c.new ./velocity_hw.c
	@cat ./velocity_hw.c | sed 's/\"velocity_desc.h\"/<dev\/getb\/velocity_desc.h>/' > ./velocity_hw.c.new
	@cp ./velocity_hw.c.new ${VGET_DIR}/velocity_hw.c
	@cp ./velocity_hw.c.old ./velocity_hw.c
	@rm ./velocity_hw.c.old
	@rm ./velocity_hw.c.new
	@cp ./velocity_hw.h ./velocity_hw.h.old
	@cat ./velocity_hw.h | sed 's/\"osdep.h\"/<dev\/getb\/osdep.h>/' > ./velocity_hw.h.new
	@cp ./velocity_hw.h.new ./velocity_hw.h
	@cat ./velocity_hw.h | sed 's/\"velocity_desc.h\"/<dev\/getb\/velocity_desc.h>/' > ./velocity_hw.h.new
	@cp ./velocity_hw.h.new ./velocity_hw.h
	@cat ./velocity_hw.h | sed 's/\"velocity_mac.h\"/<dev\/getb\/velocity_mac.h>/' > ./velocity_hw.h.new
	@cp ./velocity_hw.h.new ${VGET_DIR}/velocity_hw.h
	@cp ./velocity_hw.h.old ./velocity_hw.h
	@rm ./velocity_hw.h.old
	@rm ./velocity_hw.h.new
	@cat ./velocity_desc.h | sed 's/\"osdep.h\"/<dev\/getb\/osdep.h>/' > ${VGET_DIR}/velocity_desc.h
	@cat ./velocity_mii.h | sed 's/\"osdep.h\"/<dev\/getb\/osdep.h>/' > ${VGET_DIR}/velocity_mii.h
	@cat ./velocity_mac.h | sed 's/\"osdep.h\"/<dev\/getb\/osdep.h>/' > ${VGET_DIR}/velocity_mac.h
	@cp ./osdep.h ${VGET_DIR}/osdep.h
	@cp ./if_getb_cfg.h ${VGET_DIR}/if_getb_cfg.h
	@cp ./if_getb_dbg.h ${VGET_DIR}/if_getb_dbg.h
install_getb_mod:
!if __FreeBSD_version >= 400000
	@mkdir -p ${VGET_MOD}
	@cat ./Makefile | sed 's/#.PATH/.PATH/' > ${VGET_MOD}/Makefile
!endif
.include <bsd.kmod.mk>
