# Makefile for 680x0 Linux drivers/char source directory
#
# Copyright 1993 by Hamish Macdonald
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "README.legal" in the main directory of this archive
# for more details.

include ../../.config
include ../../MakeVars

OBJS	= tty_io.o console.o keyboard.o tty_ioctl.o pty.o vt.o mem.o serial.o fbmem.o
SRCS    = tty_io.c console.c keyboard.c tty_ioctl.c pty.c vt.c mem.c serial.c fbmem.c

ifdef CONFIG_AMIGAMOUSE
M = y
OBJS := $(OBJS) amigamouse.o
SRCS := $(SRCS) amigamouse.c
endif

ifdef CONFIG_ATARIMOUSE
M = y
OBJS := $(OBJS) atarimouse.o
SRCS := $(SRCS) atarimouse.c
endif

ifdef CONFIG_ATIXL_BUSMOUSE
M = y
OBJS := $(OBJS) atixlmouse.o
SRCS := $(SRCS) atixlmouse.c
endif

ifdef CONFIG_BUSMOUSE
M = y
OBJS := $(OBJS) busmouse.o
SRCS := $(SRCS) busmouse.c
endif

ifdef CONFIG_PRINTER
OBJS := $(OBJS) lp.o lp_intern.o
SRCS := $(SRCS) lp.c lp_intern.c
endif

ifdef CONFIG_MS_BUSMOUSE
M = y
OBJS := $(OBJS) msbusmouse.o
SRCS := $(SRCS) msbusmouse.c
endif

ifdef CONFIG_82C710_MOUSE
CONFIG_PSMOUSE = CONFIG_PSMOUSE
endif

ifdef CONFIG_PSMOUSE
M = y
OBJS := $(OBJS) psaux.o
SRCS := $(SRCS) psaux.c
endif

ifdef CONFIG_TAPE_QIC02
OBJS := $(OBJS) tpqic02.o 
SRCS := $(SRCS) tpqic02.c
endif

ifdef M
OBJS := $(OBJS) mouse.o
SRCS := $(SRCS) mouse.c
endif

ifdef CONFIG_ATARI
OBJS := $(OBJS) atari_MFPser.o atari_SCC.o atari_MIDI.o
SRCS := $(SRCS) atari_MFPser.c atari_SCC.c atari_MIDI.c
endif

ifdef CONFIG_AMIGA
OBJS := $(OBJS) amiga_ser.o
SRCS := $(SRCS) amiga_ser.c
endif

ifdef CONFIG_GVPIOEXT
OBJS := $(OBJS) io-extender.o
SRCS := $(SRCS) io-extender.c
endif

all: char.a

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

clean:
	$(RM) $(RMFLAGS) *.o *.a

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

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