examples/AppliSlave_HCS12/Makefile.in
author etisserant
Tue, 13 Feb 2007 17:21:19 +0100
changeset 92 0d84d95790d9
parent 40 ddeeb217ed71
permissions -rw-r--r--
- Some fixes in Makefile.in
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
OPT_CFLAGS = -Os
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
INCLUDES = -I../../include -I../../include/hcs12
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    35
MEMORY_X = ../../include/hcs12/board/arch
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    36
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    37
OBJCOPY = $(BINUTILS_PREFIX)objcopy
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    38
OBJCOPY_FLAGS = --only-section=.text --only-section=.rodata --only-section=.vectors --only-section=.data
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    39
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    40
PROGDEFINES = -mnoshort -Wall -Wmissing-prototypes -fno-strict-aliasing -g
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    41
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    42
PGR=AppliSlave
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    43
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    44
SLAVE_OBJS = objdict.o appli.o vectors.o
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    45
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    46
OBJS = ../../src/hc12_pdo.o ../../src/hc12_sdo.o ../../src/hc12_init.o ../../src/hc12_sync.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    47
       ../../src/hc12_objacces.o ../../src/hc12_lifegrd.o ../../src/hc12_timer.o ../../src/hc12_nmtSlave.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    48
       ../../drivers/hc12/canOpenDriver.o ../../drivers/hc12/ports.o ../../drivers/hc12/interrupt.o\
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    49
       ../../drivers/hc12/timerhw.o ../../drivers/hc12/variahw.o $(SLAVE_OBJS)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    50
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    51
LDFLAGS= -Wl,-m,m68hc12elfb  -L$(MEMORY_X)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    52
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    53
all: $(PGR).elf $(PGR).s19 $(PGR).b $(PGR).s MSG
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    54
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    55
%o: %c
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    56
	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -c -o $@ $<
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    57
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    58
%o: %s
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    59
	$(CC)  -c -x assembler-with-cpp $(PROG_CFLAGS) -o  $@ $<
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    60
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    61
$(PGR).elf: $(OBJS)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    62
	$(CC) $(CFLAGS) $(LDFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    63
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    64
$(PGR).s19: $(PGR).elf
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    65
	$(OBJCOPY) --output-target=srec $(OBJCOPY_FLAGS) $< $@
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    66
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    67
$(PGR).b: $(PGR).elf
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    68
	$(OBJCOPY) --output-target=binary --gap-fill=255 --only-section=.data $(OBJCOPY_FLAGS) $< $@
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    69
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    70
$(PGR).s: $(PGR).elf
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    71
	@echo "Desassemble"
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    72
	$(BINUTILS_PREFIX)objdump -D $(PGR).elf > $(PGR).s
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    73
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    74
MSG:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    75
	$(BINUTILS_PREFIX)readelf -S $(PGR).elf
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    76
	@echo
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    77
	$(BINUTILS_PREFIX)size $(PGR).elf
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    78
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    79
clean:
40
ddeeb217ed71 Updated configure and fixes in Makefiles.in for cygwin compiling.
etisserant
parents: 0
diff changeset
    80
	rm -f $(SLAVE_OBJS)
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    81
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    82
mrproper: clean
40
ddeeb217ed71 Updated configure and fixes in Makefiles.in for cygwin compiling.
etisserant
parents: 0
diff changeset
    83
	rm -f $(PGR).elf $(PGR).s19 $(PGR).b $(PGR).s
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    84