greg@267: #! gmake greg@267: greg@267: # greg@267: # Copyright (C) 2006 Laurent Bessard greg@267: # greg@267: # This file is part of canfestival, a library implementing the canopen greg@267: # stack greg@267: # greg@267: # This library is free software; you can redistribute it and/or greg@267: # modify it under the terms of the GNU Lesser General Public greg@267: # License as published by the Free Software Foundation; either greg@267: # version 2.1 of the License, or (at your option) any later version. greg@267: # greg@267: # This library is distributed in the hope that it will be useful, greg@267: # but WITHOUT ANY WARRANTY; without even the implied warranty of greg@267: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU greg@267: # Lesser General Public License for more details. greg@267: # greg@267: # You should have received a copy of the GNU Lesser General Public greg@267: # License along with this library; if not, write to the Free Software greg@267: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA greg@267: # greg@267: greg@329: CC = SUB_CC greg@329: CXX = SUB_CXX greg@329: LD = SUB_LD greg@267: OPT_CFLAGS = -O2 greg@267: CFLAGS = SUB_OPT_CFLAGS greg@267: PROG_CFLAGS = SUB_PROG_CFLAGS greg@267: OS_NAME = SUB_OS_NAME greg@267: ARCH_NAME = SUB_ARCH_NAME greg@267: PREFIX = SUB_PREFIX greg@267: TARGET = SUB_TARGET greg@267: CAN_DRIVER = SUB_CAN_DRIVER greg@267: TIMERS_DRIVER = SUB_TIMERS_DRIVER greg@267: ENABLE_DLL_DRIVERS = SUB_ENABLE_DLL_DRIVERS greg@267: greg@267: INCLUDES = -I../../include -I../../include/$(TARGET) -I../../include/$(TIMERS_DRIVER) greg@267: greg@267: OBJS = $(TARGET).o greg@267: greg@267: # add timers driver if any greg@267: ifneq ($(TIMERS_DRIVER),timers_) greg@267: OBJS += ../$(TIMERS_DRIVER)/$(TIMERS_DRIVER).o greg@267: endif greg@267: greg@267: SRC_HFILES = ../../include/$(TARGET)/applicfg.h ../../include/$(TARGET)/canfestival.h greg@267: greg@267: TARGET_HFILES = $(PREFIX)/include/$(TARGET)/applicfg.h $(PREFIX)/include/$(TARGET)/canfestival.h greg@267: greg@267: all: driver greg@267: greg@267: driver: $(OBJS) greg@267: greg@267: greg@267: %o: %cpp greg@329: $(CXX) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $< greg@267: greg@267: #../$(TIMERS_DRIVER)/$(TIMERS_DRIVER).o: greg@267: # $(MAKE) -C ../$(TIMERS_DRIVER) driver greg@267: greg@267: #../$(CAN_DRIVER)/$(CAN_DRIVER).o: greg@267: # $(MAKE) -C ../$(CAN_DRIVER) driver greg@267: greg@267: libcanfestival_$(TARGET).a: $(OBJS) greg@267: @echo Building [libcanfestival_$(TARGET).a] greg@267: ar rc $@ $(OBJS) greg@267: ranlib $@ greg@267: greg@267: install: libcanfestival_$(TARGET).a greg@267: mkdir -p $(PREFIX)/lib/ greg@267: mkdir -p $(PREFIX)/include/canfestival greg@267: cp libcanfestival_$(TARGET).a $(PREFIX)/lib/ greg@267: cp $(SRC_HFILES) $(PREFIX)/include/canfestival greg@267: greg@267: uninstall: greg@267: rm -f $(PREFIX)/lib/libcanfestival_$(TARGET).a greg@267: rm -f $(TARGET_HFILES) greg@267: greg@267: clean: greg@267: rm -f $(OBJS) greg@267: rm -f libcanfestival_$(TARGET).a greg@267: greg@267: mrproper: clean greg@267: greg@267: