Commit 08681ab8 authored by yoogx's avatar yoogx

* Add makefile for AIR

	For openaadl/ocarina#160
parent b4d826dc
## 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:
EXTRA_DIST=$(builddir)/Makefile.common $(srcdir)/Makefile.leon3-xm3 \
$(srcdir)/Makefile.leon3-scoc3 \
$(srcdir)/Makefile.leon3-xtratum \
$(srcdir)/Makefile.leon.rtems \
$(srcdir)/Makefile.leon.rtems_posix \
$(srcdir)/Makefile.compcert $(srcdir)/Makefile.bench \
$(srcdir)/Makefile.linux32 \
$(srcdir)/Makefile.linux32-xenomai-native \
$(srcdir)/Makefile.linux32-xenomai-posix \
$(srcdir)/Makefile.linux64 $(srcdir)/Makefile.win32 \
$(srcdir)/Makefile.x86.linuxtaste \
$(srcdir)/Makefile.template $(srcdir)/Makefile.freertos
$(srcdir)/Makefile.leon3-scoc3 \
$(srcdir)/Makefile.leon3-xtratum \
$(srcdir)/Makefile.leon.rtems \
$(srcdir)/Makefile.leon.rtems_posix \
$(srcdir)/Makefile.compcert $(srcdir)/Makefile.bench \
$(srcdir)/Makefile.linux32 \
$(srcdir)/Makefile.linux32-xenomai-native \
$(srcdir)/Makefile.linux32-xenomai-posix \
$(srcdir)/Makefile.linux64 $(srcdir)/Makefile.win32 \
$(srcdir)/Makefile.x86.linuxtaste \
$(srcdir)/Makefile.template $(srcdir)/Makefile.freertos \
$(srcdir)/Makefile.air
CLEANFILES = *~
......
......@@ -255,7 +255,7 @@ endif
compile-node: $(BINARY)
ifeq ($(TARGET), $(filter $(TARGET), leon3-scoc3 leon.rtems leon.rtems_posix))
ifeq ($(TARGET), $(filter $(TARGET), leon3-scoc3 leon.rtems leon.rtems_posix air))
OBJS = $(USER_OBJS) $(PO_HI_OBJS) $(GENERATED_OBJS) $(EXTERNAL_OBJECTS)
$(BINARY):
if [ x"$$RTEMS_MAKEFILE_PATH" = x"" ]; then \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment