etisserant@391: #! gmake etisserant@391: etisserant@391: # etisserant@391: # Copyright (C) 2006 Laurent Bessard etisserant@391: # etisserant@391: # This file is part of canfestival, a library implementing the canopen etisserant@391: # stack etisserant@391: # etisserant@391: # This library is free software; you can redistribute it and/or etisserant@391: # modify it under the terms of the GNU Lesser General Public etisserant@391: # License as published by the Free Software Foundation; either etisserant@391: # version 2.1 of the License, or (at your option) any later version. etisserant@391: # etisserant@391: # This library is distributed in the hope that it will be useful, etisserant@391: # but WITHOUT ANY WARRANTY; without even the implied warranty of etisserant@391: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU etisserant@391: # Lesser General Public License for more details. etisserant@391: # etisserant@391: # You should have received a copy of the GNU Lesser General Public etisserant@391: # License along with this library; if not, write to the Free Software etisserant@391: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA etisserant@391: # etisserant@391: etisserant@391: #ifneq ($(KERNELRELEASE),) etisserant@391: # Kbuild part of Makefile etisserant@391: TARGET = SUB_TARGET etisserant@391: CAN_DRIVER = SUB_CAN_DRIVER etisserant@391: TIMERS_DRIVER = SUB_TIMERS_DRIVER etisserant@391: etisserant@391: EXTRA_CFLAGS := -I$(src)/../../include etisserant@391: EXTRA_CFLAGS += -I$(src)/../../include/$(TARGET) etisserant@391: EXTRA_CFLAGS += -I$(src)/../../include/$(CAN_DRIVER) etisserant@391: EXTRA_CFLAGS += -I$(src)/../../include/$(TIMERS_DRIVER) etisserant@391: EXTRA_CFLAGS += SUB_PROG_CFLAGS etisserant@391: etisserant@391: OBJS := kernel_module.o etisserant@391: OBJS += TestSlave.o etisserant@391: OBJS += TestMaster.o etisserant@391: OBJS += Slave.o etisserant@391: OBJS += Master.o etisserant@391: OBJS += TestMasterSlave.o etisserant@391: etisserant@391: obj-m := canf_ktest.o etisserant@391: canf_ktest-objs := $(OBJS) etisserant@391: etisserant@391: #else etisserant@391: # Normal Makefile etisserant@391: CC = SUB_CC etisserant@391: PREFIX = SUB_PREFIX etisserant@391: KERNELDIR := SUB_KERNELDIR etisserant@391: etisserant@391: all: canf_ktest etisserant@391: etisserant@391: canf_ktest: canf_ktest_console TestSlave.c TestMaster.c etisserant@391: cat ../../drivers/can_virtual_kernel/Module.symvers > Module.symvers etisserant@391: cat ../../src/Module.symvers >> Module.symvers etisserant@391: $(MAKE) -C $(KERNELDIR) M=$(shell pwd) modules etisserant@391: etisserant@391: clean: etisserant@391: $(MAKE) -C $(KERNELDIR) M=$(shell pwd) clean etisserant@391: rm -f Module.symvers etisserant@391: rm -f console/canf_ktest_console etisserant@391: etisserant@391: mrproper: clean etisserant@391: rm -f TestSlave.c etisserant@391: rm -f TestMaster.c etisserant@391: etisserant@391: install: etisserant@391: $(MAKE) -C $(KERNELDIR) M=$(shell pwd) modules_install etisserant@391: mkdir -p $(PREFIX)/bin/ etisserant@391: cp console/canf_ktest_console $(PREFIX)/bin/ etisserant@391: /bin/sh insert.sh etisserant@391: etisserant@391: uninstall: etisserant@391: rm -f $(PREFIX)/bin/canf_ktest_console etisserant@391: etisserant@391: canf_ktest_console: console/console.c console/console.h etisserant@391: $(CC) console/console.c -o console/canf_ktest_console etisserant@391: etisserant@391: TestSlave.c: TestSlave.od etisserant@391: $(MAKE) -C ../../objdictgen gnosis etisserant@391: python ../../objdictgen/objdictgen.py TestSlave.od TestSlave.c etisserant@391: etisserant@391: TestMaster.c: TestMaster.od etisserant@391: $(MAKE) -C ../../objdictgen gnosis etisserant@391: python ../../objdictgen/objdictgen.py TestMaster.od TestMaster.c etisserant@391: etisserant@391: #endif