Makefile.air 2.89 KB
Newer Older
yoogx's avatar
yoogx committed
1
2
3
4
5
6
7
8
## This file is a part of PolyORB-HI-C software.
## It sets some variables useful to compile generated
## code for the AIR hypervisor

## To use and compile RTEMS, visit http://www.rtems.com

## This file has been built for a generic RTEMS integration

9
10
11
MANAGERS = sem rtmon msg timer io
LIBS = #-lrtemsall -lc
RTEMS_USES_NEWLIB = no
yoogx's avatar
yoogx committed
12

13
# PolyORB-HI/C specific flags
yoogx's avatar
yoogx committed
14
15
16
POHI_CFLAGS = -DRTEMS_POSIX -DLEON_RTEMS $(GCC_GENERIC_FLAGS)

# RTEMS/AIR specific flags
17
18
19
20
21
POHI_CFLAGS += -DAIR_HYPERVISOR -I$(AIR_ROOT)/pmk/core/include		\
-I$(AIR_ROOT)/pmk/arch/sparc/include					\
-I$(AIR_ROOT)/install/libs/imaspex/include/ -I./ -B./ -I../common/	\
-B../common/ -DRTEMS5 -B$(AIR_LIBS)/imaspex/ -B$(AIR_LIBS)/libprintf/	\
-B$(AIR_LIBS)/libair/
yoogx's avatar
yoogx committed
22

23
LD_LIBS = $(AIR_LIBS)/libprintf/libprintf.a			\
yoogx's avatar
yoogx committed
24
25
26
27
28
$(AIR_LIBS)/libair/libair.a $(AIR_LIBS)/imaspex/imaspex.a

LINK_LIBS += $(AIR_LIBS)/libprintf/libprintf.a \
$(AIR_LIBS)/libair/libair.a $(AIR_LIBS)/imaspex/imaspex.a

29
30
31
# The RTEMS_MAKEFILE_PATH is defined by the user for the specific CPU and BSP
RTEMS_MAKEFILE_PATH=$(AIR_POS)/rtems5/rtems5-install/sparc-rtems5/leon3

yoogx's avatar
yoogx committed
32
33
34
35
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg

36
37
38
CPPFLAGS += -DAIR_HYPERVISOR./ -I./ -B./ -I../common/ -B../common/	\
-DRTEMS5 -B$(AIR_LIBS)/imaspex/ -B$(AIR_LIBS)/libprintf/		\
-B$(AIR_LIBS)/libair/
yoogx's avatar
yoogx committed
39

40
41
TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--wrap=printf -Wl,--wrap=puts	\
-Wl,--wrap=putchar
yoogx's avatar
yoogx committed
42
43
44
45
46
47
48
49
50

##############################################################################
# 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.

ifndef RTEMS_API
yoogx's avatar
yoogx committed
51
52
   POHI_CFLAGS    +=  -DRTEMS48
   TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.8/ -lm
yoogx's avatar
yoogx committed
53
54
55
endif

ifeq ($(RTEMS_API),4.8)
yoogx's avatar
yoogx committed
56
   POHI_CFLAGS    +=  -DRTEMS48
yoogx's avatar
yoogx committed
57
58
59
endif

ifeq ($(RTEMS_API),4.10)
yoogx's avatar
yoogx committed
60
   POHI_CFLAGS    +=  -DRTEMS410
yoogx's avatar
yoogx committed
61
62
63
endif

ifeq ($(RTEMS_API),4.11)
yoogx's avatar
yoogx committed
64
65
   POHI_CFLAGS    +=  -DRTEMS411
   TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.11/ -lm
yoogx's avatar
yoogx committed
66
67
68
endif

ifeq ($(RTEMS_API),4.12)
yoogx's avatar
yoogx committed
69
70
   POHI_CFLAGS    +=  -DRTEMS412
   TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
yoogx's avatar
yoogx committed
71
72
73
endif

ifeq ($(RTEMS_API),5)
74
75
   POHI_CFLAGS    +=  -DRTEMS5
   TARGET_LDFLAGS +=  -lm
yoogx's avatar
yoogx committed
76
77
78
79
80
81
82
83
84
85
86
87
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.

ifeq ($(RTEMS_BSP),gr740)
yoogx's avatar
yoogx committed
88
   POHI_CFLAGS   +=
yoogx's avatar
yoogx committed
89
90
91
endif

ifeq ($(RTEMS_BSP),leon3)
yoogx's avatar
yoogx committed
92
   POHI_CFLAGS   +=   -DLEON3
yoogx's avatar
yoogx committed
93
94
95
96
endif

# leon3_sf is provided by RCC 1.3
ifeq ($(RTEMS_BSP),leon3_sf)
yoogx's avatar
yoogx committed
97
   POHI_CFLAGS   +=   -DLEON3
yoogx's avatar
yoogx committed
98
99
100
endif

ifeq ($(RTEMS_BSP),leon2)
yoogx's avatar
yoogx committed
101
   POHI_CFLAGS   +=  -DGRLEON2
yoogx's avatar
yoogx committed
102
103
104
105
106
endif

LINK_LIBS+=-lm

target-clean:
107
108

target-objects: