Makefile.leon.rtems_posix 2 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
13
include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
include $(RTEMS_CUSTOM)
include $(PROJECT_ROOT)/make/leaf.cfg

jdelange's avatar
jdelange committed
14
15
16
17
18
19
20
21
22

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


MANAGERS = all

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
28
29
30
31
GPROF                        = sparc-rtems-gprof

TARGET_SOURCES               = 
#TARGET_TRANSPORT_SOURCES     = $(RUNTIME_PATH)/config/leon-rtems/config.c
TARGET_TRANSPORT_SOURCES     = 

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/

jdelange's avatar
jdelange committed
36
37
TARGET_LDFLAGS               = -lrtemsbsp -lc -lm 
EXTERNAL_OBJECTS             += -L$(RUNTIME_PATH)/libs/leon/ -llua -lm
jdelange's avatar
jdelange committed
38

39
40
41
RTEMS410=$(shell grep VERSION $$RTEMS_MAKEFILE_PATH/lib/include/rtems/score/cpuopts.h|grep 4.10)
RTEMS411=$(shell grep VERSION $$RTEMS_MAKEFILE_PATH/lib/include/rtems/score/cpuopts.h|grep 4.11)
RTEMS48=$(shell grep VERSION $$RTEMS_MAKEFILE_PATH/lib/include/rtems/score/cpuopts.h|grep 4.8)
jdelange's avatar
jdelange committed
42
43

ifneq ($(RTEMS48),)
44
   TARGET_CFLAGS                +=  -DRTEMS48
jdelange's avatar
jdelange committed
45
46
47
endif

ifneq ($(RTEMS411),)
48
   TARGET_CFLAGS                +=  -DRTEMS411
jdelange's avatar
jdelange committed
49
50
51
endif

ifneq ($(RTEMS410),)
52
   TARGET_CFLAGS                +=  -DRTEMS410
jdelange's avatar
jdelange committed
53
54
endif

jdelange's avatar
jdelange committed
55
56
57
58
59
60
61
62
63
64
65

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

jdelange's avatar
jdelange committed
66
67
LINK_LIBS+=-lm

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


72
target-clean: