Commit b4d826dc authored by yoogx's avatar yoogx

* Change TARGET_CFLAGS to POHI_CFLAGS to avoid collision with RTOS macro

	  Clean-up of RTEMS makefile to use existing macros

	For openaadl/ocarina#161
parent d0a40f10
TARGET_CFLAGS = -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE $(GCC_GENERIC_FLAGS) -D__PO_HI_USE_VCD
POHI_CFLAGS = -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE $(GCC_GENERIC_FLAGS) -D__PO_HI_USE_VCD
TARGET_LDFLAGS = -lpthread -lrt -L$(RUNTIME_PATH)/libs/linux32/ -L$(RUNTIME_PATH)/libs/linux64/ -llua -lm
SIMULINK_LDFLAGS = -lm
CC = gcc
......
......@@ -51,7 +51,7 @@ ifneq ($(USER_LD),)
LD=$(USER_LD)
endif
CFLAGS=$(TARGET_CFLAGS) $(USER_CFLAGS) $(GCC_GENERIC_CFLAGS)
CFLAGS=$(POHI_CFLAGS) $(USER_CFLAGS) $(GCC_GENERIC_CFLAGS)
CPPFLAGS=$(CFLAGS) $(USER_CPPFLAGS)
LDFLAGS=$(TARGET_LDFLAGS) $(USER_LDFLAGS)
......@@ -183,7 +183,7 @@ check-linuxtaste:
ifeq ($(MONITORING), true)
MONITORING_OBJS = trace_manager.o
MONITORING_OBJS = trace_manager.o
PO_HI_OBJS += $(MONITORING_OBJS)
CFLAGS += -DMONITORING
INCLUDE += -I$(LOCAL_RUNTIME_PATH)/src \
......@@ -261,21 +261,26 @@ $(BINARY):
if [ x"$$RTEMS_MAKEFILE_PATH" = x"" ]; then \
echo "Please define the RTEMS_MAKEFILE_PATH variable, exiting" ; \
else \
$(MAKE) generate-asn1-deployment compile-c-files compile-cpp-files compile-ada-files target-objects compile-po-hi $(USER_OBJS) $(GENERATED_OBJS) ; \
$(CC) -o $(BINARY) $(EXTERNAL_OBJECTS) $(PO_HI_OBJS) $(GENERATED_OBJS) $(USER_OBJS) $(LDFLAGS) $(CFLAGS) ; \
$(MAKE) generate-asn1-deployment compile-c-files compile-cpp-files compile-ada-files target-objects compile-po-hi $(USER_OBJS) $(GENERATED_OBJS) $(BINARY).exe ;\
fi
$(BINARY).exe:
$(make-exe)
endif
### The following is to be revisited
ifeq ($(TARGET), leon3-xm3)
OBJS = $(USER_OBJS) $(PO_HI_OBJS) $(GENERATED_OBJS) $(EXTERNAL_OBJECTS)
$(BINARY):
if [ x"$(shell which sparc-rtems-gcc)" = x ]; then \
echo "XtratuM not installed, exiting" ; \
else \
$(MAKE) generate-asn1-deployment target-objects compile-po-hi $(USER_OBJS) $(GENERATED_OBJS); \
fi
@echo XtratuM target disabled
endif
#if [ x"$(shell which sparc-rtems-gcc)" = x ]; then \
# echo "XtratuM not installed, exiting" ; \
# else \
# $(MAKE) generate-asn1-deployment target-objects compile-po-hi $(USER_OBJS) $(GENERATED_OBJS); \
# fi
ifeq ($(TARGET), $(filter $(TARGET), x86.rtems x86.rtems_posix))
......@@ -343,12 +348,14 @@ endif
ifeq ($(TARGET), $(filter $(TARGET), linux32-xenomai-posix linux32-xenomai-native))
EXE=$(BINARY)
$(BINARY):
@if [ x"$(shell which xeno-config)" = x ]; then \
echo "Xenomai is not installed in your system, exiting" ; \
else \
$(MAKE) generate-asn1-deployment target-objects compile-c-files compile-ada-files compile-po-hi $(USER_OBJS) $(GENERATED_OBJS) $(TARGET_OBJECTS) ; \
$(LD) -o $(EXE) $(EXTERNAL_OBJECTS) $(PO_HI_OBJS) $(GENERATED_OBJS) $(USER_OBJS) $(LDFLAGS) ; \
fi
@echo Xenomai target disabled
#@if [ x"$(shell which xeno-config)" = x ]; then \
# echo "Xenomai is not installed in your system, exiting" ; \
# else \
# $(MAKE) generate-asn1-deployment target-objects compile-c-files compile-ada-files compile-po-hi $(USER_OBJS) $(GENERATED_OBJS) $(TARGET_OBJECTS) ; \
# $(LD) -o $(EXE) $(EXTERNAL_OBJECTS) $(PO_HI_OBJS) $(GENERATED_OBJS) $(USER_OBJS) $(LDFLAGS) ; \
# fi
endif
ifeq ($(TARGET), arm.dslinux)
......@@ -457,7 +464,7 @@ sonarproperties:
CPPCHECK_FLAGS= -v --enable=all --xml-version=2 --std=c99 --platform=unix64 --rule-file=gnu.cfg --rule-file=std.cfg --rule-file=posix.cfg
cppcheck:
cppcheck $(CPPCHECK_FLAGS) $(INCLUDE) -I$(LOCAL_RUNTIME_PATH)/include $(TARGET_CFLAGS) $(USER_CFLAGS) $(LOCAL_RUNTIME_PATH)/src $(PWD) 2> cppcheck.xml
cppcheck $(CPPCHECK_FLAGS) $(INCLUDE) -I$(LOCAL_RUNTIME_PATH)/include $(POHI_CFLAGS) $(USER_CFLAGS) $(LOCAL_RUNTIME_PATH)/src $(PWD) 2> cppcheck.xml
################################################################################
# valgrind: run the valgrind binary analyser
......
TARGET_CFLAGS = -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -DCOMPCERT
POHI_CFLAGS = -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -DCOMPCERT
TARGET_LDFLAGS = -lpthread -lrt -L$(RUNTIME_PATH)/libs/linux32/ -L$(RUNTIME_PATH)/libs/linux64/ -llua -lm
SIMULINK_LDFLAGS = -lm
CC = ccomp
......
......@@ -21,55 +21,46 @@ endef
MANAGERS = all
LIBS = -lrtemsall -lc
CC = $(CC_FOR_TARGET)
CPP = $(CXX_FOR_TARGET)
LD = $(LD_FOR_TARGET)
GPROF = sparc-rtems-gprof
TARGET_SOURCES =
#TARGET_TRANSPORT_SOURCES = $(RUNTIME_PATH)/config/leon-rtems/config.c
TARGET_TRANSPORT_SOURCES =
TARGET_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DLEON_RTEMS $(GCC_GENERIC_FLAGS) $(CPU_FLAGS) $(AM_FLAGS) $(GCCSPECS)
POHI_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DLEON_RTEMS $(GCC_GENERIC_FLAGS)
TARGET_INCLUDE = -I$(RUNTIME_PATH)/config/leon-rtems/
TARGET_LDFLAGS = -lrtemsbsp -lc -lm
ifndef RTEMS_API
TARGET_CFLAGS += -DRTEMS48
POHI_CFLAGS += -DRTEMS48
TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.8/ -lm
endif
ifeq ($(RTEMS_API),4.8)
TARGET_CFLAGS += -DRTEMS48
POHI_CFLAGS += -DRTEMS48
TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.8/ -lm
endif
ifeq ($(RTEMS_API),4.10)
TARGET_CFLAGS += -DRTEMS410
POHI_CFLAGS += -DRTEMS410
endif
ifeq ($(RTEMS_API),4.11)
TARGET_CFLAGS += -DRTEMS411
POHI_CFLAGS += -DRTEMS411
TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.11/ -lm
endif
ifeq ($(RTEMS_API),4.12)
TARGET_CFLAGS += -DRTEMS412
POHI_CFLAGS += -DRTEMS412
TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
endif
ifeq ($(RTEMS_API),5)
TARGET_CFLAGS += -DRTEMS412
POHI_CFLAGS += -DRTEMS412
TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
endif
ifeq ($(RTEMS_BSP),leon3)
TARGET_CFLAGS += -DGRLEON3
POHI_CFLAGS += -DGRLEON3
endif
ifeq ($(RTEMS_BSP),leon2)
TARGET_CFLAGS += -DGRLEON2
POHI_CFLAGS += -DGRLEON2
endif
......
......@@ -13,25 +13,7 @@ LIBS = -lrtemsall -lc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
define bsp-post-link
$(NM) -g -n $@ > $(basename $@).num
$(SIZE) $@
endef
CC = $(CC_FOR_TARGET)
CPP = $(CXX_FOR_TARGET)
LD = $(LD_FOR_TARGET)
GPROF = sparc-rtems-gprof
TARGET_SOURCES =
#TARGET_TRANSPORT_SOURCES = $(RUNTIME_PATH)/config/leon-rtems/config.c
TARGET_TRANSPORT_SOURCES =
TARGET_CFLAGS = -DRTEMS_POSIX -DLEON_RTEMS $(GCC_GENERIC_FLAGS) $(CPU_FLAGS) $(AM_FLAGS) $(GCCSPECS)
TARGET_INCLUDE =
TARGET_LDFLAGS = -lrtemsbsp -lc -lm
POHI_CFLAGS = -DRTEMS_POSIX -DLEON_RTEMS $(GCC_GENERIC_FLAGS)
##############################################################################
# RTEMS_API is defined as part of RTEMS BSP Makefile. It reports the
......@@ -41,30 +23,30 @@ TARGET_LDFLAGS = -lrtemsbsp -lc -lm
# variant of RTEMS.
ifndef RTEMS_API
TARGET_CFLAGS += -DRTEMS48
POHI_CFLAGS += -DRTEMS48
TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.8/ -lm
endif
ifeq ($(RTEMS_API),4.8)
TARGET_CFLAGS += -DRTEMS48
POHI_CFLAGS += -DRTEMS48
endif
ifeq ($(RTEMS_API),4.10)
TARGET_CFLAGS += -DRTEMS410
POHI_CFLAGS += -DRTEMS410
endif
ifeq ($(RTEMS_API),4.11)
TARGET_CFLAGS += -DRTEMS411
POHI_CFLAGS += -DRTEMS411
TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.11/ -lm
endif
ifeq ($(RTEMS_API),4.12)
TARGET_CFLAGS += -DRTEMS412
POHI_CFLAGS += -DRTEMS412
TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
endif
ifeq ($(RTEMS_API),5)
TARGET_CFLAGS += -DRTEMS412
POHI_CFLAGS += -DRTEMS412
TARGET_LDFLAGS += -L$(RUNTIME_PATH)/libs/leon-rtems4.12/ -lm
endif
......@@ -78,20 +60,20 @@ endif
# LEON3: RCC 1.3 macro to enables LEON3 peripherals.
ifeq ($(RTEMS_BSP),gr740)
TARGET_CFLAGS += -DGRLEON3
POHI_CFLAGS += -DGRLEON3
endif
ifeq ($(RTEMS_BSP),leon3)
TARGET_CFLAGS += -DGRLEON3 -DLEON3
POHI_CFLAGS += -DGRLEON3 -DLEON3
endif
# leon3_sf is provided by RCC 1.3
ifeq ($(RTEMS_BSP),leon3_sf)
TARGET_CFLAGS += -DGRLEON3 -DLEON3
POHI_CFLAGS += -DGRLEON3 -DLEON3
endif
ifeq ($(RTEMS_BSP),leon2)
TARGET_CFLAGS += -DGRLEON2
POHI_CFLAGS += -DGRLEON2
endif
ifdef USE_GPROF
......@@ -110,5 +92,4 @@ LINK_LIBS+=-lm
emulate-qemu: $(BINARY)
qemu-system-sparc -M at697 -nographic -kernel $(BINARY).exe
target-clean:
......@@ -27,12 +27,12 @@ TARGET_SOURCES =
#TARGET_TRANSPORT_SOURCES = $(RUNTIME_PATH)/config/leon-rtems/config.c
TARGET_TRANSPORT_SOURCES =
TARGET_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DLEON_RTEMS $(GCC_GENERIC_FLAGS) $(CPU_FLAGS) $(AM_FLAGS) $(GCCSPECS)
POHI_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DLEON_RTEMS $(GCC_GENERIC_FLAGS) $(CPU_FLAGS) $(AM_FLAGS) $(GCCSPECS)
TARGET_INCLUDE = -I $(RUNTIME_PATH)/config/leon-rtems/
TARGET_LDFLAGS = -lrtemsbsp -lc -lm
TARGET_CFLAGS += -DRTEMS410
POHI_CFLAGS += -DRTEMS410
target-clean:
......
......@@ -21,7 +21,7 @@ GPROF = sparc-rtems-gprof
TARGET_SOURCES =
TARGET_TRANSPORT_SOURCES =
TARGET_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DSPARC_RTEMS -mcpu=v8 -I$(XTRATUM_PATH)/include -B$(RTEMS_PATH)/sparc-rtems/leon3xm3/lib --include xm_inc/config.h --include xm_inc/arch/arch_types.h -DXM_SRC -DXM3_RTEMS_MODE $(GCC_GENERIC_FLAGS)
POHI_CFLAGS = -D__PO_HI_RTEMS_CLASSIC_API -DSPARC_RTEMS -mcpu=v8 -I$(XTRATUM_PATH)/include -B$(RTEMS_PATH)/sparc-rtems/leon3xm3/lib --include xm_inc/config.h --include xm_inc/arch/arch_types.h -DXM_SRC -DXM3_RTEMS_MODE $(GCC_GENERIC_FLAGS)
LD = sparc-rtems-gcc
TARGET_LDFLAGS = -lrtemsbsp -lc -lm -mcpu=v8 -msoft-float -qrtems -L$(XTRATUM_PATH)/lib -Wl,--defsym=PARTITION_START=$(call xpathstart,$(BINARY),../$(MAINAPP)_xtratum-conf.xml),--defsym=PARTITION_SIZE=$(call xpathsize,$(BINARY),../$(MAINAPP_xtratum-conf.xml)) -Ttext=$(call xpathstart,$(BINARY),../$(MAINAPP)_xtratum-conf.xml)
......
TARGET_CFLAGS = -DPOSIX -m32 -D_POSIX_SOURCE -D_GNU_SOURCE $(GCC_GENERIC_FLAGS)
POHI_CFLAGS = -DPOSIX -m32 -D_POSIX_SOURCE -D_GNU_SOURCE $(GCC_GENERIC_FLAGS)
TARGET_LDFLAGS = -lpthread -lrt -m32 -L$(RUNTIME_PATH)/libs/linux32/ -llua -lm
SIMULINK_LDFLAGS = -lm
CC = gcc
......
XENOVER=$(shell xeno-config --version)
ifeq ($(XENOVER),2.4.4)
TARGET_CFLAGS = `xeno-config --xeno-cflags` -DXENO_NATIVE -D_POSIX_SOURCE -D_GNU_SOURCE -m32 $(GCC_GENERIC_FLAGS)
POHI_CFLAGS = `xeno-config --xeno-cflags` -DXENO_NATIVE -D_POSIX_SOURCE -D_GNU_SOURCE -m32 $(GCC_GENERIC_FLAGS)
TARGET_LDFLAGS = `xeno-config --xeno-ldflags` -m32
else
TARGET_CFLAGS = `xeno-config --skin native --cflags` -DXENO_NATIVE -D_POSIX_SOURCE -D_GNU_SOURCE -m32 $(GCC_GENERIC_FLAGS)
POHI_CFLAGS = `xeno-config --skin native --cflags` -DXENO_NATIVE -D_POSIX_SOURCE -D_GNU_SOURCE -m32 $(GCC_GENERIC_FLAGS)
TARGET_LDFLAGS = `xeno-config --skin native --ldflags` -m32
endif
......
XENOVER=$(shell xeno-config --version)
ifeq ($(XENOVER),2.4.4)
TARGET_CFLAGS = `xeno-config --posix-cflags` -DXENO_POSIX -D_POSIX_SOURCE -D_GNU_SOURCE -m32 $(GCC_GENERIC_FLAGS)
POHI_CFLAGS = `xeno-config --posix-cflags` -DXENO_POSIX -D_POSIX_SOURCE -D_GNU_SOURCE -m32 $(GCC_GENERIC_FLAGS)
TARGET_LDFLAGS = `xeno-config --posix-ldflags` -m32
else
TARGET_CFLAGS = `xeno-config --skin posix --cflags` -DXENO_POSIX -D_POSIX_SOURCE -D_GNU_SOURCE -m32 $(GCC_GENERIC_FLAGS)
POHI_CFLAGS = `xeno-config --skin posix --cflags` -DXENO_POSIX -D_POSIX_SOURCE -D_GNU_SOURCE -m32 $(GCC_GENERIC_FLAGS)
TARGET_LDFLAGS = `xeno-config --skin posix --ldflags` -m32
endif
......
TARGET_CFLAGS = -DPOSIX -m64 -D_POSIX_SOURCE -D_GNU_SOURCE $(GCC_GENERIC_FLAGS)
POHI_CFLAGS = -DPOSIX -m64 -D_POSIX_SOURCE -D_GNU_SOURCE $(GCC_GENERIC_FLAGS)
TARGET_LDFLAGS = -lpthread -lrt -m64 -L$(RUNTIME_PATH)/libs/linux64/ -llua -lm
SIMULINK_LDFLAGS = -lm
CC = gcc
......
TARGET_CFLAGS = @NATIVE_CFLAGS@
POHI_CFLAGS = @NATIVE_CFLAGS@
TARGET_LDFLAGS = @NATIVE_LDFLAGS@ -lm
SIMULINK_LDFLAGS = @SIMULINK_LDFLAGS@
CC = gcc
......
TARGET_CFLAGS = -D_WIN32 -D_GNU_SOURCE $(GCC_GENERIC_FLAGS) -std=c99 -m32
POHI_CFLAGS = -D_WIN32 -D_GNU_SOURCE $(GCC_GENERIC_FLAGS) -std=c99 -m32
TARGET_LDFLAGS = -m32
SIMULINK_LDFLAGS = -lm
CC = i686-w64-mingw32-gcc
......
......@@ -12,7 +12,7 @@ GPROF =
TARGET_SOURCES =
TARGET_TRANSPORT_SOURCES =
TARGET_CFLAGS = -I$(LINUXTASTE_PATH)/output/target/usr/local/include -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -D__PO_HI_PLATFORM_LINUXTASTE $(GCC_GENERIC_FLAGS)
POHI_CFLAGS = -I$(LINUXTASTE_PATH)/output/target/usr/local/include -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE -D__PO_HI_PLATFORM_LINUXTASTE $(GCC_GENERIC_FLAGS)
TARGET_INCLUDE =
......
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