Makefile.air 2.94 KB
Newer Older
yoogx's avatar
yoogx committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
## 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

MANAGERS = all
LIBS = -lrtemsall -lc

-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg

# PolyORb-HI/C specific flags
POHI_CFLAGS = -DRTEMS_POSIX -DLEON_RTEMS $(GCC_GENERIC_FLAGS)

# RTEMS/AIR specific flags
POHI_CFLAGS += -DAIR_HYPERVISOR -I$(AIR_ROOT)/pmk/core/include -I$(AIR_ROOT)/pmk/arch/sparc/include

include $(AIR_ROOT)/Makefile.inc

LD_LIBS = $(AIR_LIBS)/libprintf/libprintf.a $(AIR_LIBS)/libair/libair.a

CPPFLAGS += -DAIR_HYPERVISOR./ -I./ -B./ -I../common/ -B../common/ -B$(AIR_LIBS)/libprintf/ -B$(AIR_LIBS)/libair/

##############################################################################
# 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
   POHI_CFLAGS                +=  -DRTEMS48
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.8/ -lm
endif

ifeq ($(RTEMS_API),4.8)
   POHI_CFLAGS                +=  -DRTEMS48
endif

ifeq ($(RTEMS_API),4.10)
   POHI_CFLAGS                +=  -DRTEMS410
endif

ifeq ($(RTEMS_API),4.11)
   POHI_CFLAGS                +=  -DRTEMS411
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.11/ -lm
endif

ifeq ($(RTEMS_API),4.12)
   POHI_CFLAGS                +=  -DRTEMS412
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
endif

ifeq ($(RTEMS_API),5)
   POHI_CFLAGS                +=  -DRTEMS412
   TARGET_LDFLAGS               += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
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)
   POHI_CFLAGS                +=  -DGRLEON3
endif

ifeq ($(RTEMS_BSP),leon3)
   POHI_CFLAGS                +=  -DGRLEON3 -DLEON3
endif

# leon3_sf is provided by RCC 1.3
ifeq ($(RTEMS_BSP),leon3_sf)
   POHI_CFLAGS                +=  -DGRLEON3 -DLEON3
endif

ifeq ($(RTEMS_BSP),leon2)
   POHI_CFLAGS                +=  -DGRLEON2
endif

ifdef USE_GPROF
TARGET_LDFLAGS+=-Wl,--wrap,Clock_isr -pg
EXTERNAL_OBJECTS+=po_hi_gprof_rtems_leon.o
TARGET_INCLUDE+=-I$(RTEMS_MAKEFILE_PATH)/lib/include/

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

LINK_LIBS+=-lm

emulate-qemu: $(BINARY)
	qemu-system-sparc -M at697 -nographic -kernel $(BINARY).exe

target-clean: