Makefile.leon.rtems 1.98 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


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

14
15
16
17
18
19
20
21
22

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


MANAGERS = all

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

28
29
30
31
TARGET_SOURCES               = 
#TARGET_TRANSPORT_SOURCES     = $(RUNTIME_PATH)/config/leon-rtems/config.c
TARGET_TRANSPORT_SOURCES     = 

jdelange's avatar
jdelange committed
32
TARGET_CFLAGS                = -DRTEMS_PURE -DLEON_RTEMS $(GCC_GENERIC_FLAGS)  $(CPU_FLAGS) $(AM_FLAGS) $(GCCSPECS)
33
34
TARGET_INCLUDE               = -I $(RUNTIME_PATH)/config/leon-rtems/

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

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

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

47
48
ifeq ($(RTEMS_API),4.11)
   TARGET_CFLAGS                +=  -DRTEMS411
jdelange's avatar
jdelange committed
49
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.11/ -llua -lm
jdelange's avatar
jdelange committed
50
51
endif

52
53
ifeq ($(RTEMS_API),4.10)
   TARGET_CFLAGS                +=  -DRTEMS410
jdelange's avatar
jdelange committed
54
55
endif

56
   
57
58
target-clean:

59
ifdef USE_GPROF
60
61
62
63
64
65
66
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:
67
68
endif

jdelange's avatar
jdelange committed
69
70
LINK_LIBS+=-lm

jdelange's avatar
jdelange committed
71
72
73
emulate-qemu: $(BINARY)
	qemu-system-sparc -M at697 -nographic -kernel $(BINARY).exe

74