|
168
|
1 #! /bin/sh |
|
|
2 |
|
|
3 # This script will create a generic Makefile template |
|
|
4 # suitable for use with an installed eCos configuration. |
|
|
5 |
|
|
6 # usage: <eCos_repository>/build_Makefile [<eCos_install_dir>] |
|
|
7 # env: ${SRCS} - the default list of source files |
|
|
8 # ${DST} - the default target |
|
|
9 |
|
|
10 HOME=${1-`pwd`} |
|
|
11 if [ ! -d ${HOME}/install ]; then |
|
|
12 echo "Not an eCos install tree" |
|
|
13 echo "usage: <eCos_repository>/build_Makefile [<eCos_install_dir>]" |
|
|
14 echo "env: \${SRCS} - the default list of source files" |
|
|
15 echo " \${DST} - the default target" |
|
|
16 exit |
|
|
17 fi |
|
|
18 |
|
|
19 cat <<EOF >Makefile |
|
|
20 # |
|
|
21 # Makefile for eCos tests |
|
|
22 # |
|
|
23 |
|
436
|
24 # Platform specific setups |
|
|
25 include Make.params |
|
168
|
26 |
|
|
27 # Simple build rules |
|
|
28 |
|
|
29 .c.o: |
|
|
30 \$(CC) -c \$(ECOS_GLOBAL_CFLAGS) -I\$(PREFIX)/include \$*.c |
|
|
31 |
|
|
32 .o: |
|
|
33 \$(CC) \$(ECOS_GLOBAL_LDFLAGS) -L\$(PREFIX)/lib -Ttarget.ld \$*.o -o \$@ |
|
|
34 |
|
|
35 SRCS=${SRCS-source_file.c} |
|
|
36 OBJS=\${SRCS:%.c=%.o} |
|
|
37 DST=${DST-result_prog} |
|
|
38 |
|
|
39 \${DST}: \${OBJS} |
|
|
40 |
|
|
41 EOF |
|
436
|
42 |
|
|
43 # Create actual parameters |
|
|
44 |
|
|
45 `dirname $0`/build_Make.params ${HOME} |
|
|
46 |
|
|
47 |