#
# Can-Driver for Softing Can-Card
# Copyright (C) 2008, Softing AG, Gunnar Larisch
#
# See file CREDITS for list of people who contributed to this
# project.
# 
# 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.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
#
# email: support.automation@softing.com
# Softing AG, Richard-Reitzner-Allee 6, 85540 Haar, Germany
#
# $Id: Makefile.pci,v 1.1 2003/11/13 12:45:14 kno Exp $
#

# This Makefile has been simplified as much as possible, by putting all
# generic material, independent of this specific directory, into
# Rules.make. Read that file for details



MODULE_NAME  = canpro_usb
FW=../../firmware
CF=../../common

$(MODULE_NAME)-objs = 	canprousb.o can_driver.o can_card.o \
		        $(CF)/canpro_device.o $(CF)/can_proc.o\
			$(FW)/layer2Usb.o

#CFLAGS += -I/home/kno/CANL2/canL2/include
EXTRA_CFLAGS += -I$(src)/../../include -g -DCANDEBUG -DINDEPENDENT_CHANNEL -D_CANPROUSB_ -DDEBUGLEVEL=_PRINT_ERROR

ifneq ($(KERNELRELEASE),)
obj-m := $(MODULE_NAME).o

else
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)


	
endif

default:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

all:
	$(MAKE) -C $(KDIR) M=$(PWD) modules

candriver:
	$(MAKE) -C $(KDIR) M=$(PWD) modules
	
clean:
	$(MAKE) -C $(KDIR) M=$(PWD) clean
	$(MAKE) -C $(FW) clean

install:
	$(MAKE) -C $(KDIR) M=$(PWD) modules_install
	depmod -a

cross:
	$(MAKE) -C $(KDIR) M=$(PWD) modules
	install -c $(MODULE_NAME).ko /share


	





