Makefile.leon.rtems 2.12 KB
Newer Older
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 generit RTEMS integration
8
9


10
11
12
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
jdelange's avatar
jdelange committed
13

14
15
16
17
18
19
20
21

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


MANAGERS = all
yoogx's avatar
yoogx committed
22
LIBS = -lrtemsall -lc
23

24
POHI_CFLAGS                = -D__PO_HI_RTEMS_CLASSIC_API -DLEON_RTEMS $(GCC_GENERIC_FLAGS)
yoogx's avatar
yoogx committed
25
TARGET_INCLUDE               = -I$(RUNTIME_PATH)/config/leon-rtems/
26

jdelange's avatar
jdelange committed
27
TARGET_LDFLAGS               = -lrtemsbsp -lc -lm
jdelange's avatar
jdelange committed
28

jdelange's avatar
jdelange committed
29
ifndef RTEMS_API
30
   POHI_CFLAGS                +=  -DRTEMS48
31
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.8/ -lm
jdelange's avatar
jdelange committed
32
33
endif

34
ifeq ($(RTEMS_API),4.8)
35
   POHI_CFLAGS                +=  -DRTEMS48
36
37
38
39
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.8/  -lm
endif

ifeq ($(RTEMS_API),4.10)
40
   POHI_CFLAGS                +=  -DRTEMS410
jdelange's avatar
jdelange committed
41
42
endif

43
ifeq ($(RTEMS_API),4.11)
44
   POHI_CFLAGS                +=  -DRTEMS411
45
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.11/ -lm
jdelange's avatar
jdelange committed
46
47
endif

48
ifeq ($(RTEMS_API),4.12)
49
   POHI_CFLAGS                +=  -DRTEMS412
50
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
jdelange's avatar
jdelange committed
51
52
endif

yoogx's avatar
yoogx committed
53
ifeq ($(RTEMS_API),5)
54
   POHI_CFLAGS                +=  -DRTEMS412
yoogx's avatar
yoogx committed
55
56
57
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
endif

yoogx's avatar
yoogx committed
58
ifeq ($(RTEMS_BSP),leon3)
59
   POHI_CFLAGS                +=  -DGRLEON3
yoogx's avatar
yoogx committed
60
endif
yoogx's avatar
yoogx committed
61

yoogx's avatar
yoogx committed
62
ifeq ($(RTEMS_BSP),leon2)
63
   POHI_CFLAGS                +=  -DGRLEON2
yoogx's avatar
yoogx committed
64
endif
65

66

67
68
target-clean:

69
ifdef USE_GPROF
70
71
TARGET_LDFLAGS+=-Wl,--wrap,Clock_isr -pg
EXTERNAL_OBJECTS+=po_hi_gprof_rtems_leon.o
72
TARGET_INCLUDE+=-I$(RTEMS_MAKEFILE_PATH)/lib/include/
73
74
75
76
77

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
emulate-qemu: $(BINARY)
	qemu-system-sparc -M at697 -nographic -kernel $(BINARY).exe