Makefile.leon.rtems 2.48 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
## This file is a part of PolyORB-HI-C software.
## It sets some variables useful to compile generated
## code to the LEON platform with the RTEMS operating system.

## To use and compile RTEMS, visit http://www.rtems.com

## This file has been built for RTEMS 4.8.0



define bsp-post-link
   $(NM) -g -n $@ > $(basename $@).num
   $(SIZE) $@
endef


MANAGERS = all

CC                           = sparc-rtems-gcc
CPP                          = sparc-rtems-g++

22
23
GPROF                        = sparc-rtems-gprof

24
25
26
27
TARGET_SOURCES               = 
#TARGET_TRANSPORT_SOURCES     = $(RUNTIME_PATH)/config/leon-rtems/config.c
TARGET_TRANSPORT_SOURCES     = 

jdelange's avatar
jdelange committed
28
TARGET_CFLAGS                = -DRTEMS_PURE -DLEON_RTEMS $(GCC_GENERIC_FLAGS)
29
30
TARGET_INCLUDE               = -I $(RUNTIME_PATH)/config/leon-rtems/

31
LD                           = sparc-rtems-ld
jdelange's avatar
jdelange committed
32
33
TARGET_LDFLAGS               = -lrtemsbsp -lc -lm $(RUNTIME_PATH)/libs/leon/liblua.a -lm -L$(RUNTIME_PATH)/libs/leon/ -llua -lm
EXTERNAL_OBJECTS             += -L$(RUNTIME_PATH)/libs/leon/ -llua -lm
jdelange's avatar
jdelange committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

RTEMS410=$(shell grep VERSION $$RTEMS_MAKEFILE_PATH_LEON/lib/include/rtems/score/cpuopts.h|grep 4.10)
RTEMS411=$(shell grep VERSION $$RTEMS_MAKEFILE_PATH_LEON/lib/include/rtems/score/cpuopts.h|grep 4.11)
RTEMS48=$(shell grep VERSION $$RTEMS_MAKEFILE_PATH_LEON/lib/include/rtems/score/cpuopts.h|grep 4.8)

ifneq ($(RTEMS48),)
   TARGET_CFLAGS                +=  -DRTEMS_VERSION=48
endif

ifneq ($(RTEMS411),)
   TARGET_CFLAGS                +=  -DRTEMS_VERSION=411
endif

ifneq ($(RTEMS410),)
   TARGET_CFLAGS                +=  -DRTEMS_VERSION=410
endif


52
53
54
55
56
57
58
59
60
61
			     
target-clean:

-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc

-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg

define bsp-link-c
   $(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
jdelange's avatar
jdelange committed
62
      -o $(BINARY) $(LINK_OBJS) $(LINK_LIBS) $(RUNTIME_PATH)/libs/leon/liblua.a -lm -L$(RUNTIME_PATH)/libs/leon/ -llua -lm
63
64
65
66
endef

define bsp-link-cxx
   $(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \
jdelange's avatar
jdelange committed
67
      -o $(BINARY) $(LINK_OBJS) $(LINK_LIBS) $(RUNTIME_PATH)/libs/leon/liblua.a -lm -L$(RUNTIME_PATH)/libs/leon/ -llua -lm
68
69
endef

70
ifdef USE_GPROF
71
72
73
74
75
76
77
TARGET_LDFLAGS+=-Wl,--wrap,Clock_isr -pg
EXTERNAL_OBJECTS+=po_hi_gprof_rtems_leon.o

target-objects:
	$(CC) $(INCLUDE) $(TARGET_INCLUDE) -D__PO_HI_USE_GPROF -Wall -c -o po_hi_gprof_rtems_leon.o $(RUNTIME_PATH)/src/po_hi_gprof_rtems_leon.c
else
target-objects:
78
79
endif

jdelange's avatar
jdelange committed
80
81
LINK_LIBS+=-lm

jdelange's avatar
jdelange committed
82
83
84
emulate-qemu: $(BINARY)
	qemu-system-sparc -M at697 -nographic -kernel $(BINARY).exe

85