#
# Can-Lib - Softing Library for API of CAN interfaces
# Copyright (C) 2003-2006, 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.
# 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,v 1.1.1.1 2003/10/24 16:11:00 la Exp $
#

# Makefile for libSoftingCan.so

CAN_OPTIONS=-I../../include -g -O -Wall -fPIC -shared
CANL2_VERSION=-version-number 5:18:1

LDFLAGS = -shared

LIB=libSoftingCan.la

all: $(LIB)

$(LIB): canlib.c
	libtool --mode=compile gcc -c $(CAN_OPTIONS) canlib.c	
	libtool --mode=link gcc  $(CAN_OPTIONS) $(CANL2_VERSION) -export-symbols symfile.sym -o libSoftingCan.la canlib.lo -lc -lpthread -rpath /usr/local/lib
	cp ./.libs/libSoftingCan.so .
	

install:$(LIB)
	echo "Installing libSoftingCan.so to /usr/local/lib! Adding /usr/local/lib to libray search path!"
	install -c libSoftingCan.so /usr/local/lib
	ldconfig /usr/local/lib


clean:
	rm -f *.o *~ $(LIB)
	rm -f -r .libs
	rm -f libSoftingCan.so
