#
# Makefile for ULTRA low level driver (Linux version)
# Copyright (c) 1994-98 by Jaroslav Kysela (Perex soft)
#

include ../Makefile.conf

TARGETS = ultra-cs4231.o
CS4231 = cs4231.o

.c.o:
	$(CC) $(COPTS) $(INCLUDE) -c -o $*.o $<

all: $(TARGETS)
	@echo
	@echo "ULTRA lowlevel modules were sucessfully compiled."
	@echo

ultra-cs4231.o: .depend $(CS4231)
	ld -dc -r -o $@ $(CS4231)
	ls -l $@

gcompile: $(TARGETS)

insert: $(TARGETS) remove
	sync		# for sure - debug versions may hang
	/sbin/insmod ultra-cs4231.o
	/sbin/lsmod

remove:
	sync		# for sure - debug versions may hang
	- /sbin/rmmod ultra-cs4231
	- /sbin/lsmod

clean:
	rm -f core .depend *.o *.orig ultra.map ultra.map? *~

.depend:
	$(CPP) $(COPTS) $(INCLUDE) -M *.c > .depend

dep:	.depend

dummy:

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