Makefile.leon.rtems_posix 3.16 KB
Newer Older
jdelange's avatar
jdelange committed
1
2
3
4
5
6
## 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

jdelange's avatar
jdelange committed
7
## This file has been built for a generic RTEMS integration
jdelange's avatar
jdelange committed
8

yoogx's avatar
yoogx committed
9
10
MANAGERS = all
LIBS = -lrtemsall -lc
jdelange's avatar
jdelange committed
11

12
13
14
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
jdelange's avatar
jdelange committed
15
16
17
18
19
20

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

21
22
CC                           = $(CC_FOR_TARGET)
CPP                          = $(CXX_FOR_TARGET)
jdelange's avatar
jdelange committed
23
LD                           = $(LD_FOR_TARGET)
jdelange's avatar
jdelange committed
24
25
GPROF                        = sparc-rtems-gprof

26
TARGET_SOURCES               =
jdelange's avatar
jdelange committed
27
#TARGET_TRANSPORT_SOURCES     = $(RUNTIME_PATH)/config/leon-rtems/config.c
28
TARGET_TRANSPORT_SOURCES     =
jdelange's avatar
jdelange committed
29

30
31
TARGET_CFLAGS                = -DRTEMS_POSIX -DLEON_RTEMS $(GCC_GENERIC_FLAGS) $(CPU_FLAGS) $(AM_FLAGS) $(GCCSPECS)

32
TARGET_INCLUDE               =
jdelange's avatar
jdelange committed
33

34
TARGET_LDFLAGS               = -lrtemsbsp -lc -lm
jdelange's avatar
jdelange committed
35

yoogx's avatar
yoogx committed
36
37
38
39
40
41
42
##############################################################################
# RTEMS_API is defined as part of RTEMS BSP Makefile. It reports the
# version of RTEMS used
#
# The following adjusts the configuration of PolyORB-HI/C for each
# variant of RTEMS.

jdelange's avatar
jdelange committed
43
44
ifndef RTEMS_API
   TARGET_CFLAGS                +=  -DRTEMS48
45
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.8/ -lm
jdelange's avatar
jdelange committed
46
47
endif

48
ifeq ($(RTEMS_API),4.8)
49
   TARGET_CFLAGS                +=  -DRTEMS48
jdelange's avatar
jdelange committed
50
51
endif

52
53
54
55
ifeq ($(RTEMS_API),4.10)
   TARGET_CFLAGS                +=  -DRTEMS410
endif

56
ifeq ($(RTEMS_API),4.11)
57
   TARGET_CFLAGS                +=  -DRTEMS411
58
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.11/ -lm
jdelange's avatar
jdelange committed
59
60
endif

61
62
63
ifeq ($(RTEMS_API),4.12)
   TARGET_CFLAGS                +=  -DRTEMS412
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
jdelange's avatar
jdelange committed
64
65
endif

yoogx's avatar
yoogx committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
ifeq ($(RTEMS_API),5)
   TARGET_CFLAGS                +=  -DRTEMS412
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
endif

##############################################################################
# RTEMS_BSP is defined as part of RTEMS BSP Makefile. It reports the
# BSP used.
#
# Depending on the BSP, we select specific variant of the drivers API

# GRLEON3: PolyORB-HI/C variant of the driver
# LEON3: RCC 1.3 macro to enables LEON3 peripherals.

yoogx's avatar
yoogx committed
80
81
82
83
ifeq ($(RTEMS_BSP),gr740)
   TARGET_CFLAGS                +=  -DGRLEON3
endif

yoogx's avatar
yoogx committed
84
ifeq ($(RTEMS_BSP),leon3)
yoogx's avatar
yoogx committed
85
86
87
88
89
90
   TARGET_CFLAGS                +=  -DGRLEON3 -DLEON3
endif

# leon3_sf is provided by RCC 1.3
ifeq ($(RTEMS_BSP),leon3_sf)
   TARGET_CFLAGS                +=  -DGRLEON3 -DLEON3
yoogx's avatar
yoogx committed
91
endif
jdelange's avatar
jdelange committed
92

yoogx's avatar
yoogx committed
93
94
95
ifeq ($(RTEMS_BSP),leon2)
   TARGET_CFLAGS                +=  -DGRLEON2
endif
96

jdelange's avatar
jdelange committed
97
98
99
ifdef USE_GPROF
TARGET_LDFLAGS+=-Wl,--wrap,Clock_isr -pg
EXTERNAL_OBJECTS+=po_hi_gprof_rtems_leon.o
100
TARGET_INCLUDE+=-I$(RTEMS_MAKEFILE_PATH)/lib/include/
jdelange's avatar
jdelange committed
101
102
103
104
105
106
107

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:
endif

jdelange's avatar
jdelange committed
108
109
LINK_LIBS+=-lm

jdelange's avatar
jdelange committed
110
111
112
113
emulate-qemu: $(BINARY)
	qemu-system-sparc -M at697 -nographic -kernel $(BINARY).exe


114
target-clean: