summaryrefslogtreecommitdiff
path: root/ecos/examples/build_Makefile
blob: 46d8c9af1940f21cec333699115396d28d8c143a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /bin/sh

# This script will create a generic Makefile template
# suitable for use with an installed eCos configuration.

# usage: <eCos_repository>/build_Makefile [<eCos_install_dir>]
# env:   ${SRCS} - the default list of source files
#        ${DST}  - the default target
ECOS_DIR=${1-`pwd`}

cat <<EOF >Makefile
#
# Makefile for eCos tests
#

# Platform specific setups
include Make.params

# Simple build rules

.c.o:
	\$(CC) -c \$(ACTUAL_CFLAGS) -I\$(PREFIX)/include \$*.c

.o:
	\$(CC) \$(ACTUAL_LDFLAGS) -L\$(PREFIX)/lib -Ttarget.ld \$*.o -o \$@

SRCS=${SRCS-source_file.c}
OBJS=\${SRCS:%.c=%.o}
DST=${DST-result_prog}

\${DST}: \${OBJS}

EOF

# Create actual parameters

`dirname $0`/build_Make.params ${ECOS_DIR}