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