#
# Makefile for replacement beeper
#

KERNEL_SOUND_SRC_DIR	=	/usr/src/linux/drivers/sound

CC				=	gcc
CFLAGS			=	-m486 -Wall -O3 -D__KERNEL__ -DLINUX -I$(KERNEL_SOUND_SRC_DIR) -DMODULE -DMODVERSIONS -include /usr/include/linux/modversions.h
BEEP_SRC		=	beep.c
BEEP_OBJ		=	beep.o

all:			check-sound-dir Beep.o

check-sound-dir:
	@if [ ! -d $(KERNEL_SOUND_SRC_DIR) ]; then \
		echo 'You need to modify the Makefile: the default kernel sound' ; \
		echo 'drivers source directory ($(KERNEL_SOUND_SRC_DIR)) is wrong.' ; \
		exit 1 ; \
	fi

Beep.o:		$(BEEP_OBJ)
	$(LD) -r -o $@ $^

install:	
	install ./Beep.o /usr/src/linux/modules
		echo 'Don''t forget to do "make modules_install" in /usr/src/linux and'
		echo 'depmod -a !'
