drivers/can_anagate_linux/Makefile
author Christian Taedcke <hacking@taedcke.com>
Mon, 23 Jan 2012 20:05:46 +0100
changeset 701 9e4ccb3cab96
parent 658 7758d60e9260
child 790 1936110171a2
permissions -rw-r--r--
Win32:
FIXED: - converted visual studio solution file back to 2008.
RENAMED: - solution file name and used project file names to project.vc9.vcproj
494
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
     1
#! gmake
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
     2
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
     3
#
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
     4
# Copyright (C) 2006 Laurent Bessard
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
     5
# 
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
     6
# This file is part of canfestival, a library implementing the canopen
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
     7
# stack
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
     8
# 
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
     9
# This library is free software; you can redistribute it and/or
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    10
# modify it under the terms of the GNU Lesser General Public
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    11
# License as published by the Free Software Foundation; either
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    12
# version 2.1 of the License, or (at your option) any later version.
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    13
# 
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    14
# This library is distributed in the hope that it will be useful,
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    17
# Lesser General Public License for more details.
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    18
# 
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    19
# You should have received a copy of the GNU Lesser General Public
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    20
# License along with this library; if not, write to the Free Software
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    21
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    22
# 
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    23
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    24
CC = gcc
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    25
OPT_CFLAGS = -O2
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    26
CFLAGS = $(OPT_CFLAGS)
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    27
PROG_CFLAGS = 
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    28
PREFIX = /usr/local
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    29
TARGET = unix
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    30
CAN_DRIVER = can_anagate_linux
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    31
TIMERS_DRIVER = timers_unix
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    32
ENABLE_DLL_DRIVERS=1
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    33
CAN_DLL_CFLAGS= -lAnaGateAPIDLL -lAnaCommon
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    34
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    35
INCLUDES = -I../../include -I../../include/$(TARGET) -I../../include/$(CAN_DRIVER)
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    36
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    37
OBJS = $(CAN_DRIVER).o
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    38
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    39
ifeq ($(ENABLE_DLL_DRIVERS),1)
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    40
CFLAGS += -fPIC
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    41
DRIVER = libcanfestival_$(CAN_DRIVER).so
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    42
else
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    43
DRIVER = $(OBJS)
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    44
endif
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    45
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    46
TARGET_SOFILES = $(PREFIX)/lib/$(DRIVER)
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    47
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    48
all: driver
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    49
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    50
driver: $(DRIVER)
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    51
658
7758d60e9260 FIXED: - changed make targets from "%o: %c" to "%.o: %.c" (Patch from irc <oleg_osov>)
Christian Taedcke
parents: 494
diff changeset
    52
%.o: %.c
494
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    53
	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    54
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    55
libcanfestival_$(CAN_DRIVER).so: $(OBJS)
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    56
	$(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $<
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    57
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    58
install: libcanfestival_$(CAN_DRIVER).so
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    59
	mkdir -p $(PREFIX)/lib/
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    60
	cp $< $(PREFIX)/lib/
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    61
		
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    62
uninstall:
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    63
	rm -f $(TARGET_SOFILES)
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    64
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    65
clean:
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    66
	rm -f $(OBJS)
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    67
aa36efce6e78 add anagate device support in CanFestival
greg
parents:
diff changeset
    68
mrproper: clean