# Makefile for 680x0 Linux chr_drv 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
SRCS    = tty_io.c console.c keyboard.c tty_ioctl.c pty.c vt.c mem.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
SRCS := $(SRCS) lp.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_serial.o atari_MFPser.o atari_SCC.o
SRCS := $(SRCS) atari_serial.c atari_MFPser.c atari_SCC.c
else
OBJS := $(OBJS) serial.o
SRCS := $(SRCS) serial.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
