examples/gene_SYNC_HCS12/Makefile.in
author Robert Lehmann <robert.lehmann@sitec-systems.de>
Tue, 28 Jul 2015 16:36:55 +0200
changeset 793 72e9e1064432
parent 658 7758d60e9260
permissions -rw-r--r--
timers_unix: Fix termination problem of WaitReceiveTaskEnd

The function pthread_kill sends the Signal thread and to the own process.
If you use this construct than the application which calls uses the
canfestival api will terminate at the call of canClose. To avoid that
use pthread_cancel instead of pthread_kill. To use the pthread_cancel call
you need to set the cancel ability in the thread function. That means
you need to call pthread_setcancelstate and pthread_setcanceltype.
For the termination of the thread at any time it is important to set the
cancel type to PTHREAD_CANCEL_ASYNCHRONOUS.
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     1
#! gmake
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     2
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     3
#
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     4
# Copyright (C) 2006 Laurent Bessard
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     5
# 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     6
# This file is part of canfestival, a library implementing the canopen
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     7
# stack
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     8
# 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     9
# This library is free software; you can redistribute it and/or
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    10
# modify it under the terms of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    11
# License as published by the Free Software Foundation; either
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    12
# version 2.1 of the License, or (at your option) any later version.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    13
# 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    14
# This library is distributed in the hope that it will be useful,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    17
# Lesser General Public License for more details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    18
# 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    19
# You should have received a copy of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    20
# License along with this library; if not, write to the Free Software
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    21
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    22
# 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    23
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    24
CC = SUB_CC
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    25
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    26
CFLAGS = SUB_OPT_CFLAGS
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    27
PROG_CFLAGS = SUB_PROG_CFLAGS
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    28
OS_NAME = SUB_OS_NAME
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    29
ARCH_NAME = SUB_ARCH_NAME
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    30
PREFIX = SUB_PREFIX
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    31
BINUTILS_PREFIX = SUB_BINUTILS_PREFIX
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    32
TARGET = SUB_TARGET
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    33
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    34
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    35
INCLUDES = -I../../include -I../../include/hcs12
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    36
MEMORY_X = ../../include/hcs12/board/arch
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    37
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    38
OBJCOPY = $(BINUTILS_PREFIX)objcopy
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    39
OBJCOPY_FLAGS = --only-section=.text --only-section=.rodata --only-section=.vectors --only-section=.data
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    40
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    41
PROGDEFINES = -mnoshort -Wall -Wmissing-prototypes -fno-strict-aliasing 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    42
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    43
PGR=geneSYNC
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    44
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    45
SYNC_OBJS = objdict.o appli.o vectors.o
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    46
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    47
OBJS = ../../src/$(TARGET)_pdo.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    48
       ../../src/$(TARGET)_sdo.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    49
       ../../src/$(TARGET)_states.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    50
       ../../src/$(TARGET)_sync.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    51
       ../../src/$(TARGET)_objacces.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    52
       ../../src/$(TARGET)_lifegrd.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    53
       ../../src/$(TARGET)_timer.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    54
       ../../src/$(TARGET)_nmtSlave.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    55
       ../../drivers/$(TARGET)/canOpenDriver.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    56
       ../../drivers/$(TARGET)/ports.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    57
       ../../drivers/$(TARGET)/interrupt.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    58
       $(SYNC_OBJS)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    59
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    60
LDFLAGS= -Wl,-m,m68hc12elfb  -L$(MEMORY_X)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    61
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    62
all: $(PGR).elf $(PGR).s19 $(PGR).b $(PGR).s MSG
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    63
658
7758d60e9260 FIXED: - changed make targets from "%o: %c" to "%.o: %.c" (Patch from irc <oleg_osov>)
Christian Taedcke
parents: 40
diff changeset
    64
%.o: %.c
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    65
	@echo " "
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    66
	@echo "*********************************************"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    67
	@echo "**Compiling $< -> $@"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    68
	@echo "*********************************************"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    69
	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -c -o $@ $<
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    70
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    71
%o: %s
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    72
	@echo " "
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    73
	@echo "*********************************************"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    74
	@echo "**Compiling $< -> $@"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    75
	@echo "*********************************************"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    76
	$(CC)  -c -x assembler-with-cpp $(PROG_CFLAGS) -o  $@ $<
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    77
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    78
$(PGR).elf: $(OBJS)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    79
	@echo " "
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    80
	@echo "============================================="
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    81
	@echo "**Linking :  $@"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    82
	@echo "============================================="
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    83
	$(CC) $(CFLAGS) $(LDFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    84
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    85
$(PGR).s19: $(PGR).elf
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    86
	@echo " "
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    87
	@echo "============================================="
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    88
	@echo "**Create s19 file :  $@"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    89
	@echo "============================================="
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    90
	$(OBJCOPY) --output-target=srec $(OBJCOPY_FLAGS) $< $@
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    91
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    92
$(PGR).b: $(PGR).elf
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    93
	@echo " "
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    94
	@echo "============================================="
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    95
	@echo "**Create binary file :  $@"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    96
	@echo "============================================="
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    97
	$(OBJCOPY) --output-target=binary --gap-fill=255 --only-section=.data $(OBJCOPY_FLAGS) $< $@
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    98
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    99
$(PGR).s: $(PGR).elf
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   100
	@echo " "
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   101
	@echo "============================================="
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   102
	@echo "**Create unassembled file : $@"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   103
	@echo "============================================="
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   104
	$(BINUTILS_PREFIX)objdump -D $(PGR).elf > $(PGR).s
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   105
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   106
MSG:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   107
	@echo " "
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   108
	@echo "---------------------------------------------"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   109
	@echo "**Informations on elf file : $(PGR).elf "
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   110
	@echo "---------------------------------------------"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   111
	$(BINUTILS_PREFIX)readelf -S $(PGR).elf
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   112
	@echo
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   113
	$(BINUTILS_PREFIX)size $(PGR).elf
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   114
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   115
clean:
40
ddeeb217ed71 Updated configure and fixes in Makefiles.in for cygwin compiling.
etisserant
parents: 0
diff changeset
   116
	rm -f $(SYNC_OBJS)
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   117
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   118
mrproper: clean
40
ddeeb217ed71 Updated configure and fixes in Makefiles.in for cygwin compiling.
etisserant
parents: 0
diff changeset
   119
	rm -f $(PGR).elf $(PGR).s19 $(PGR).b $(PGR).s
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   120