drivers/unix/Makefile.in
author edouard
Mon, 05 Oct 2009 14:31:55 +0200
changeset 599 b2d2c3fab094
parent 391 7802a7d5584f
child 629 b9274b595650
permissions -rw-r--r--
Added timeout for waiting timer thread end on windows.
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
     1
#! gmake
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
     2
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
     3
#
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
     4
# Copyright (C) 2006 Laurent Bessard
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
     5
# 
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
     6
# This file is part of canfestival, a library implementing the canopen
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
     7
# stack
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
     8
# 
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
     9
# This library is free software; you can redistribute it and/or
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    10
# modify it under the terms of the GNU Lesser General Public
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    11
# License as published by the Free Software Foundation; either
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    12
# version 2.1 of the License, or (at your option) any later version.
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    13
# 
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    14
# This library is distributed in the hope that it will be useful,
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    17
# Lesser General Public License for more details.
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    18
# 
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    19
# You should have received a copy of the GNU Lesser General Public
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    20
# License along with this library; if not, write to the Free Software
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    21
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    22
# 
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    23
391
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    24
#ifneq ($(KERNELRELEASE),)
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    25
# Kbuild part of Makefile
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    26
obj-m := libcanfestival_$(TARGET).o
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    27
libcanfestival_$(TARGET)-objs := $(OBJS)
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    28
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    29
#else
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    30
# Normal Makefile
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    31
CC = SUB_CC
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    32
OPT_CFLAGS = -O2
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    33
PROG_CFLAGS = SUB_PROG_CFLAGS
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    34
OS_NAME = SUB_OS_NAME
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    35
ARCH_NAME = SUB_ARCH_NAME
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    36
PREFIX = SUB_PREFIX
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    37
TARGET = SUB_TARGET
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    38
CAN_DRIVER = SUB_CAN_DRIVER
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    39
TIMERS_DRIVER = SUB_TIMERS_DRIVER
145
e747d2e26af0 Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents: 94
diff changeset
    40
ENABLE_DLL_DRIVERS = SUB_ENABLE_DLL_DRIVERS
354
396ac66670ad Various configure and build enhancements:
etisserant
parents: 145
diff changeset
    41
BINUTILS_PREFIX = SUB_BINUTILS_PREFIX
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    42
145
e747d2e26af0 Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents: 94
diff changeset
    43
INCLUDES = -I../../include -I../../include/$(TARGET) -I../../include/$(TIMERS_DRIVER)
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    44
145
e747d2e26af0 Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents: 94
diff changeset
    45
OBJS = $(TARGET).o
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    46
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    47
# add timers driver if any
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    48
ifneq ($(TIMERS_DRIVER),timers_)
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    49
OBJS += ../$(TIMERS_DRIVER)/$(TIMERS_DRIVER).o
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    50
endif
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    51
145
e747d2e26af0 Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents: 94
diff changeset
    52
SRC_HFILES = ../../include/$(TARGET)/applicfg.h ../../include/$(TARGET)/canfestival.h
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    53
145
e747d2e26af0 Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents: 94
diff changeset
    54
TARGET_HFILES = $(PREFIX)/include/$(TARGET)/applicfg.h $(PREFIX)/include/$(TARGET)/canfestival.h
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    55
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    56
all: driver
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    57
391
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    58
ifeq ($(TIMERS_DRIVER), timers_kernel)
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    59
OBJS := $(shell echo $(OBJS) | sed "s:$(TARGET)_::g")
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    60
EXTRA_CFLAGS := $(shell echo $(INCLUDES) | sed "s:-I:-I$(src)/:g")
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    61
EXTRA_CFLAGS += $(PROG_CFLAGS)
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    62
KERNELDIR := SUB_KERNELDIR
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    63
export TARGET
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    64
export OBJS
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    65
export EXTRA_CFLAGS
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    66
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    67
driver: libcanfestival_$(TARGET)
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    68
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    69
libcanfestival_$(TARGET):
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    70
	@echo Building [libcanfestival_$(TARGET).o]
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    71
	$(MAKE) -C $(KERNELDIR) M=$(shell pwd) modules
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    72
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    73
clean:
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    74
	$(MAKE) -C $(KERNELDIR) M=$(shell pwd) clean
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    75
	rm -f Module.symvers
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    76
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    77
install:
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    78
	
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    79
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    80
else
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    81
CFLAGS = SUB_OPT_CFLAGS
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
    82
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    83
driver: $(OBJS)
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    84
145
e747d2e26af0 Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents: 94
diff changeset
    85
%o: %c
e747d2e26af0 Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents: 94
diff changeset
    86
	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
e747d2e26af0 Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents: 94
diff changeset
    87
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    88
#../$(TIMERS_DRIVER)/$(TIMERS_DRIVER).o:
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    89
#	$(MAKE) -C ../$(TIMERS_DRIVER) driver
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    90
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    91
#../$(CAN_DRIVER)/$(CAN_DRIVER).o:
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    92
#	$(MAKE) -C ../$(CAN_DRIVER) driver
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    93
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    94
libcanfestival_$(TARGET).a: $(OBJS)
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    95
	@echo Building [libcanfestival_$(TARGET).a]
354
396ac66670ad Various configure and build enhancements:
etisserant
parents: 145
diff changeset
    96
	$(BINUTILS_PREFIX)ar rc $@ $(OBJS)
396ac66670ad Various configure and build enhancements:
etisserant
parents: 145
diff changeset
    97
	$(BINUTILS_PREFIX)ranlib $@
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    98
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
    99
install: libcanfestival_$(TARGET).a
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   100
	mkdir -p $(PREFIX)/lib/
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   101
	mkdir -p $(PREFIX)/include/canfestival
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   102
	cp libcanfestival_$(TARGET).a $(PREFIX)/lib/
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   103
	cp $(SRC_HFILES) $(PREFIX)/include/canfestival
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   104
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   105
uninstall:
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   106
	rm -f $(PREFIX)/lib/libcanfestival_$(TARGET).a
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   107
	rm -f $(TARGET_HFILES)
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   108
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   109
clean:
145
e747d2e26af0 Win32 Native support and dynamicaly loaded CAN drivers for Linux, Cygwin and Win32.
etisserant
parents: 94
diff changeset
   110
	rm -f $(OBJS)
40
ddeeb217ed71 Updated configure and fixes in Makefiles.in for cygwin compiling.
etisserant
parents: 24
diff changeset
   111
	rm -f libcanfestival_$(TARGET).a
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   112
391
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
   113
endif
24
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   114
mrproper: clean
a9543d2ccd56 Linux and BSD now use "unix" target. Generic is for driverless compilation.
etisserant
parents:
diff changeset
   115
391
7802a7d5584f Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents: 354
diff changeset
   116
#endif