examples/DS401_Slave_Gui/Makefile.in
changeset 246 d635cfc520ee
child 329 7717252e3ed9
equal deleted inserted replaced
245:d43ebbed895f 246:d635cfc520ee
       
     1 #! gmake
       
     2 
       
     3 #
       
     4 # Copyright (C) 2006 Laurent Bessard
       
     5 # 
       
     6 # This file is part of canfestival, a library implementing the canopen
       
     7 # stack
       
     8 # 
       
     9 # This library is free software; you can redistribute it and/or
       
    10 # modify it under the terms of the GNU Lesser General Public
       
    11 # License as published by the Free Software Foundation; either
       
    12 # version 2.1 of the License, or (at your option) any later version.
       
    13 # 
       
    14 # This library is distributed in the hope that it will be useful,
       
    15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    17 # Lesser General Public License for more details.
       
    18 # 
       
    19 # You should have received a copy of the GNU Lesser General Public
       
    20 # License along with this library; if not, write to the Free Software
       
    21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    22 # 
       
    23 
       
    24 CC = SUB_CC
       
    25 OPT_CFLAGS = -O2
       
    26 CFLAGS = SUB_OPT_CFLAGS
       
    27 PROG_CFLAGS = SUB_PROG_CFLAGS
       
    28 EXE_CFLAGS = SUB_EXE_CFLAGS
       
    29 OS_NAME = SUB_OS_NAME
       
    30 ARCH_NAME = SUB_ARCH_NAME
       
    31 PREFIX = SUB_PREFIX
       
    32 TARGET = SUB_TARGET
       
    33 CAN_DRIVER = SUB_CAN_DRIVER
       
    34 TIMERS_DRIVER = SUB_TIMERS_DRIVER
       
    35 
       
    36 
       
    37 # Détermine le nom du fichier exécutable.
       
    38 EXEC = main
       
    39 # Détermine la liste des fichiers sources.
       
    40 SRCS = $(wildcard *.cpp)
       
    41 # Détermine le nom du fichier qui contiendra les dépendances.
       
    42 DEPFILE = .depend
       
    43 # Construit la liste des fichiers temporaires à partir de la liste des fichiers
       
    44 # sources.
       
    45 
       
    46 CPP_OBJS = $(SRCS:%.cpp=%.o)
       
    47 
       
    48 
       
    49 INCLUDES = -I../../include -I../../include/$(TARGET) -I../../include/$(CAN_DRIVER) -I../../include/$(TIMERS_DRIVER)
       
    50 
       
    51 OBJS = ObjDict.o ../../src/libcanfestival.a ../../drivers/$(TARGET)/libcanfestival_$(TARGET).a
       
    52 
       
    53 ifeq ($(TIMERS_DRIVER),timers_xeno)
       
    54 	PROGDEFINES = -DUSE_XENO
       
    55 endif
       
    56 
       
    57 all: DS401_Slave_Gui
       
    58 
       
    59 ../../drivers/$(TARGET)/libcanfestival_$(TARGET).a:
       
    60 	$(MAKE) -C ../../drivers/$(TARGET) libcanfestival_$(TARGET).a
       
    61 
       
    62 
       
    63 DS401_Slave_Gui: ObjDict.c $(OBJS) $(CPP_OBJS)
       
    64 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) `wx-config --libs` $(OBJS) $(CPP_OBJS) $(EXE_CFLAGS) -o $@
       
    65 
       
    66 %o: %c
       
    67 	$(CC) -c $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) $< -o $@
       
    68 
       
    69 ObjDict.c: ObjDict.od
       
    70 	$(MAKE) -C ../../objdictgen gnosis
       
    71 	python ../../objdictgen/objdictgen.py ObjDict.od ObjDict.c
       
    72 
       
    73 .cpp.o:
       
    74 	g++ -c $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) `wx-config --cxxflags` $< -o $@
       
    75 
       
    76 clean:
       
    77 	rm -f $(MASTER_OBJS)
       
    78 	rm -f DS401_Slave_Gui
       
    79 	rm -f *~ *.o \#*
       
    80 
       
    81 mrproper: clean
       
    82 	rm -f ObjDict.c
       
    83 	rm -f ObjDict.h
       
    84 	$(RM) $(EXEC) $(DEPEND_FILE)
       
    85 	
       
    86 install: DS401_Slave_Gui
       
    87 	mkdir -p $(PREFIX)/bin/
       
    88 	cp $< $(PREFIX)/bin/
       
    89 	
       
    90 uninstall:
       
    91 	rm -f $(PREFIX)/bin/DS401_Slave_Gui
       
    92 
       
    93 $(EXEC): $(OBJS)
       
    94 	g++ $(OBJS) `wx-config --libs` -o $(EXEC)
       
    95 
       
    96 -include $(DEPFILE)
       
    97 
       
    98 
       
    99 
       
   100 
       
   101