edouard@629: #! gmake edouard@629: edouard@629: # edouard@629: # Copyright (C) 2010 Cosateq GmbH & Co.KG edouard@629: # http://www.cosateq.com/ edouard@629: # http://www.scale-rt.com/ edouard@629: # edouard@629: # This file is part of canfestival, a library implementing the canopen edouard@629: # stack edouard@629: # edouard@629: # This library is free software; you can redistribute it and/or edouard@629: # modify it under the terms of the GNU Lesser General Public edouard@629: # License as published by the Free Software Foundation; either edouard@629: # version 2.1 of the License, or (at your option) any later version. edouard@629: # edouard@629: # This library is distributed in the hope that it will be useful, edouard@629: # but WITHOUT ANY WARRANTY; without even the implied warranty of edouard@629: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU edouard@629: # Lesser General Public License for more details. edouard@629: # edouard@629: # You should have received a copy of the GNU Lesser General Public edouard@629: # License along with this library; if not, write to the Free Software edouard@629: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA edouard@629: # edouard@629: edouard@629: CC = SUB_CC edouard@629: OPT_CFLAGS = -O2 edouard@629: CFLAGS = SUB_OPT_CFLAGS edouard@629: PROG_CFLAGS = SUB_PROG_CFLAGS edouard@629: PREFIX = SUB_PREFIX edouard@629: TARGET = SUB_TARGET edouard@629: CAN_DRIVER = SUB_CAN_DRIVER edouard@629: TIMERS_DRIVER = SUB_TIMERS_DRIVER edouard@629: ENABLE_DLL_DRIVERS=SUB_ENABLE_DLL_DRIVERS edouard@629: CAN_DLL_CFLAGS=SUB_CAN_DLL_CFLAGS edouard@629: edouard@629: INCLUDES = -I../../include -I../../include/$(TARGET) -I../../include/$(CAN_DRIVER) edouard@629: edouard@629: OBJS = $(CAN_DRIVER).o edouard@629: edouard@629: ifeq ($(ENABLE_DLL_DRIVERS),1) edouard@629: CFLAGS += -fPIC edouard@629: DRIVER = libcanfestival_$(CAN_DRIVER).so edouard@629: else edouard@629: DRIVER = $(OBJS) edouard@629: endif edouard@629: s@790: TARGET_SOFILES = $(DESTDIR)$(PREFIX)/lib/$(DRIVER) edouard@629: edouard@629: all: driver edouard@629: edouard@629: driver: $(DRIVER) edouard@629: Christian@658: %.o: %.c edouard@629: $(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $< edouard@629: edouard@629: libcanfestival_$(CAN_DRIVER).so: $(OBJS) edouard@629: $(CC) -shared -Wl,-soname,libcanfestival_$(CAN_DRIVER).so $(CAN_DLL_CFLAGS) -o $@ $< edouard@629: edouard@629: install: libcanfestival_$(CAN_DRIVER).so s@790: mkdir -p $(DESTDIR)$(PREFIX)/lib/ s@790: cp $< $(DESTDIR)$(PREFIX)/lib/ edouard@629: edouard@629: uninstall: edouard@629: rm -f $(TARGET_SOFILES) edouard@629: edouard@629: clean: edouard@629: rm -f $(OBJS) edouard@629: edouard@629: mrproper: clean