#
# Makefile for replacement beeper
#

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

CC			=	gcc
CFLAGS			=	-Wall -O3 -D__KERNEL__ -I/usr/src/linux/include -DMODULE -DMODVERSIONS -include /usr/include/linux/modversions.h -DLINUX -I$(KERNEL_SOUND_SRC_DIR)
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

install:
	install -m 644 beep.o /lib/modules/boot

clean:
	rm -f beep.o
