#
# Makefile for the kernel character device drivers.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now inherited from the
# parent makes..
#
#
# FIXME: The audio stuff should be made optional in the kernel
# configuration tool! -- Erik Mouw (J.A.K.Mouw@its.tudelft.nl),
# 26-apr-2000

# Links to make
LK = pc_keyb.c defkeymap.c

L_TARGET	:= special.a
L_OBJS		:= 
LX_OBJS		:= 

# Sort out all the architecture stuff...

ifeq ($(CONFIG_VT),y)
  ifeq ($(CONFIG_FOOTBRIDGE),y)
    L_OBJS += defkeymap.o pc_keyb.o
  endif
  ifeq ($(CONFIG_ARCH_SA1100),y)
    L_OBJS += defkeymap.o
  endif
endif

ifdef CONFIG_SA1100_BRUTUS
  L_OBJS  += audio-sa1100-mcp.o
  LX_OBJS += mcp_common.o
endif

ifdef CONFIG_SA1100_LART
  L_OBJS  += audio-sa1100-mcp.o
  LX_OBJS += mcp_common.o
endif

ifdef CONFIG_SA1100_TIFON
  L_OBJS  += audio-sa1100-mcp.o
  LX_OBJS += mcp_common.o
endif

# Common dependencies

all: links first_rule

fastdep: links

include $(TOPDIR)/Rules.make

.PHONY: links
links:
	-@for f in $(LK); do \
		if [ ! -e $$f ]; then \
			echo "ln -s ../../../drivers/char/$$f .";\
			ln -s ../../../drivers/char/$$f .; \
		fi; \
	done

mrproper:
	-@for f in $(LK); do \
		if [ -L $$f ]; then \
			echo $(RM) $$f; \
			$(RM) $$f; \
		elif [ -f $$f ]; then \
			echo not removing $$f; \
		fi; \
	done
	$(RM) conmakehash
