Makefile.leon.rtems_posix 2.26 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
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

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


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

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

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

32
33
TARGET_CFLAGS                = -DRTEMS_POSIX -DLEON_RTEMS $(GCC_GENERIC_FLAGS) $(CPU_FLAGS) $(AM_FLAGS) $(GCCSPECS)

jdelange's avatar
jdelange committed
34
35
TARGET_INCLUDE               = -I $(RUNTIME_PATH)/config/leon-rtems/

36
TARGET_LDFLAGS               = -lrtemsbsp -lc -lm
jdelange's avatar
jdelange committed
37

jdelange's avatar
jdelange committed
38
39
ifndef RTEMS_API
   TARGET_CFLAGS                +=  -DRTEMS48
40
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.8/ -lm
jdelange's avatar
jdelange committed
41
42
endif

43
ifeq ($(RTEMS_API),4.8)
44
   TARGET_CFLAGS                +=  -DRTEMS48
jdelange's avatar
jdelange committed
45
46
endif

47
48
49
50
ifeq ($(RTEMS_API),4.10)
   TARGET_CFLAGS                +=  -DRTEMS410
endif

51
ifeq ($(RTEMS_API),4.11)
52
   TARGET_CFLAGS                +=  -DRTEMS411
53
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.11/ -lm
jdelange's avatar
jdelange committed
54
55
endif

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

yoogx's avatar
yoogx committed
61
62
63
ifeq ($(RTEMS_BSP),leon3)
   TARGET_CFLAGS                +=  -DGRLEON3
endif
jdelange's avatar
jdelange committed
64

yoogx's avatar
yoogx committed
65
66
67
ifeq ($(RTEMS_BSP),leon2)
   TARGET_CFLAGS                +=  -DGRLEON2
endif
68

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

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
80
81
LINK_LIBS+=-lm

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


86
target-clean: