# vi: ts=8 sw=8
#
# TI USB 3410/5052 Makefile
#
# Copyright (C) 2004 Texas Instruments
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# For questions or problems with this driver, contact Texas Instruments
# technical support, or Al Borchers <alborchers@steinerpoint.com>, or
# Peter Berger <pberger@brimson.com>.
# 
# $Id: Makefile,v 1.18 2004/12/10 00:19:03 borchers Exp $
#

DEVICE_NAME=/dev/ttyTIUSB
DEVICE_COUNT=16
DEVICE_GROUP=
DEVICE_PERMISSIONS=0600

.PHONY: modules install uninstall clean clobber ti_usb_devices \
	release configure rcsdiff ci rcs-n

modules:
	$(MAKE) -C src

install:
	$(MAKE) -C src install
	install -m 0755 -d /etc/ti_usb
	install -m 0644 ti_usb_release_notes-*.txt /etc/ti_usb

install_rpm:
	$(MAKE) -C src install_rpm
	install -m 0755 -d $(TI_USB_BUILDROOT)/etc/ti_usb
	install -m 0644 ti_usb_release_notes-*.txt $(TI_USB_BUILDROOT)/etc/ti_usb

uninstall:
	$(MAKE) -C src uninstall
	rm -rf /etc/ti_usb

clean:
	-$(MAKE) -C release clean
	-$(MAKE) -C src clean

clobber: clean
	rm -rf configure *.cache *.log *.status
	-$(MAKE) -C release clobber
	-$(MAKE) -C src clobber

ti_usb_devices:
	$(MAKE) -C src ti_usb_devices DEVICE_NAME=$(DEVICE_NAME) \
		DEVICE_COUNT=$(DEVICE_COUNT) \
		DEVICE_GROUP=$(DEVICE_GROUP) \
		DEVICE_PERMISSIONS=$(DEVICE_PERMISSIONS)

release:
	$(MAKE) -C release

configure:
	$(MAKE) -C release ../configure

rcsdiff:
	( rcsdiff RCS/*; true )
	( cd src; rcsdiff RCS/*; true )
	( cd release; rcsdiff RCS/*; true )
	( cd docs; rcsdiff RCS/*; true )
	( cd linux_patches; rcsdiff RCS/*; true )

ci:
	( ci -l RCS/* )
	( cd src; ci -l RCS/* )
	( cd release; ci -l Makefile ti_usb.spec )
	( cd docs; ci -l RCS/* )
	( cd linux_patches; ci -l RCS/* )

rcs-n:
ifdef NAME
	( rcs -n$(NAME): RCS/* )
	( cd src; rcs -n$(NAME): RCS/* )
	( cd release; rcs -n$(NAME): RCS/* )
	( cd docs; rcs -n$(NAME): RCS/* )
	( cd linux_patches; rcs -n$(NAME): RCS/* )
else
	@echo No NAME given.
endif
