-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile.rtems
More file actions
67 lines (55 loc) · 1.96 KB
/
Makefile.rtems
File metadata and controls
67 lines (55 loc) · 1.96 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# $Id: Makefile,v 1.1.1.1 2009/08/06 20:25:58 joel Exp $
#
#
# RTEMS_MAKEFILE_PATH is typically set in an environment variable
#
#RTEMS_MAKEFILE_PATH=../test/i386-rtems4.10/pc386
#RTEMS_MAKEFILE_PATH=../sparc/sparc-rtems4.10/sis
RTEMS_TOOL_PATH = /opt/rtems-4.10
GCC_VERSION = 4.4.1
PGM=${ARCH}/gsoc.exe
TARFILES = t.o
TAROBJ = ${ARCH}/tarfile.o
LDEP = tools/ldep/ldep
# optional managers required
MANAGERS=all
# C source names
CSRCS = init.c dlfcn.c linker.c demo.c
COBJS = $(CSRCS:%.c=${ARCH}/%.o)
include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
include $(RTEMS_CUSTOM)
include $(PROJECT_ROOT)/make/leaf.cfg
LD_LIBS = -lz
OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS) $(TAROBJ) $(ARCH)/symtab.o
ifeq ($(NOUSELDEP),1)
##
## build the ldep binary
##
$(LDEP):: tools/ldep/ldep.c
cc -O -o $@ $^
##
## Build the symbol table ( Dependancy list ) for CEXP
##
symtab.c:: $(LDEP)
$(NM) -g -fposix $(RTEMS_TOOL_PATH)/$(RTEMS_CPU)-rtems4.10/lib/libc.a > $(ARCH)/libc.nm
$(NM) -g -fposix $(RTEMS_TOOL_PATH)/$(RTEMS_CPU)-rtems4.10/lib/libm.a > $(ARCH)/libm.nm
$(NM) -g -fposix $(RTEMS_TOOL_PATH)/lib/gcc/$(RTEMS_CPU)-rtems4.10/$(GCC_VERSION)/libgcc.a > $(ARCH)/libgcc.nm
$(NM) -g -fposix $(RTEMS_MAKEFILE_PATH)/lib/librtemsbsp.a > $(ARCH)/librtemsbsp.nm
$(NM) -g -fposix $(RTEMS_MAKEFILE_PATH)/lib/librtemscpu.a > $(ARCH)/librtemscpu.nm
$(NM) -g -fposix $(ARCH)/demo.o > $(ARCH)/app.nm
$(LDEP) -F -l -u -x tools/ldep/libc.exc -x tools/ldep/librtemscpu.exc -C $@ $(ARCH)/app.nm $(ARCH)/librtemsbsp.nm $(ARCH)/librtemscpu.nm $(ARCH)/libc.nm > $(ARCH)/ldep.log
# $(LDEP) -F -l -u -C $@ $(ARCH)/app.nm $(ARCH)/librtemsbsp.nm $(ARCH)/librtemscpu.nm $(ARCH)/libc.nm > $(ARCH)/ldep.log
else
symtab.c: tools/config.example tools/mydeps
tools/mydeps tools/config.example $@
tools/mydeps: tools/mydeps.c
cc -o $@ $^
endif
$(TAROBJ): ${ARCH}/$(TARFILES)
tar -C ${ARCH} -cf tarfile $(TARFILES)
$(LD) -r --noinhibit-exec -o $@ -b binary tarfile
rm -f tarfile
all: ${ARCH} $(PGM)
$(PGM): $(OBJS)
$(make-exe)