#
# 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..
#

.c.s:
	$(CC) $(CFLAGS) -S $<
.s.o:
	$(AS) -c -o $*.o $<
.c.o:
	$(CC) $(CFLAGS) -c $<

OBJS  = tty_io.o console.o keyboard.o serial.o \
	tty_ioctl.o pty.o vt.o mem.o \
	defkeymap.o mouse.o

#

SRCS  = tty_io.c console.c keyboard.c serial.c \
	tty_ioctl.c pty.c vt.c mem.c \
	defkeymap.c mouse.c


ifdef CONFIG_ATIXL_BUSMOUSE
ifeq ($(CONFIG_ATIXL_BUSMOUSE),CONFIG_ATIXL_BUSMOUSE)
OBJS := $(OBJS) atixlmouse.o
else
LOADOBJS := $(LOADOBJS) atixlmouse.o
endif
SRCS := $(SRCS) atixlmouse.c
endif

ifdef CONFIG_BUSMOUSE
ifeq ($(CONFIG_BUSMOUSE),CONFIG_BUSMOUSE)
OBJS := $(OBJS) busmouse.o
else
LOADOBJS := $(LOADOBJS) busmouse.o
endif
SRCS := $(SRCS) busmouse.c
endif

ifdef CONFIG_PRINTER
ifeq ($(CONFIG_PRINTER),CONFIG_PRINTER)
OBJS := $(OBJS) lp.o
else
LOADOBJS := $(LOADOBJS) lp.o
endif
SRCS := $(SRCS) lp.c
endif

ifdef CONFIG_MS_BUSMOUSE
ifeq ($(CONFIG_MS_BUSMOUSE),CONFIG_MS_BUSMOUSE)
OBJS := $(OBJS) msbusmouse.o
else
LOADOBJS := $(LOADOBJS) msbusmouse.o
endif
SRCS := $(SRCS) msbusmouse.c
endif

ifdef CONFIG_QUICKPORT_MOUSE
ifeq ($(CONFIG_QUICKPORT_BUSMOUSE),CONFIG_QUICKPORT_BUSMOUSE)
CONFIG_PSMOUSE = CONFIG_PSMOUSE
else
CONFIG_PSMOUSE = LOAD
endif
endif

ifdef CONFIG_PSMOUSE
ifeq ($(CONFIG_PSMOUSE),CONFIG_PSMOUSE)
OBJS := $(OBJS) psaux.o
else
LOADOBJS := $(LOADOBJS) psaux.o
endif
SRCS := $(SRCS) psaux.c
endif

ifdef CONFIG_TAPE_QIC02
ifeq ($(CONFIG_TAPE_QIC02),CONFIG_TAPE_QIC02)
OBJS := $(OBJS) tpqic02.o 
else
LOADOBJS := $(LOADOBJS) tpqic02.o 
endif
SRCS := $(SRCS) tpqic02.c
endif

all: char.a

char.a: $(OBJS) $(LOADOBJS)
	$(AR) rcs char.a $(OBJS)
	sync	

dep:
	$(CPP) -M $(SRCS) > .depend

dummy:

#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
