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