| 1 |
# -*- Makefile -*- |
| 2 |
# VxWorks 7 |
| 3 |
|
| 4 |
# Building ACE for VxWorks 7 |
| 5 |
# |
| 6 |
# Unlike earlier versions, VxWorks 7 requires a VSB before application code |
| 7 |
# can be compiled (either kernel mode or RTP). See the VxWorks documentation |
| 8 |
# for information on creating a VSB (VxWorks Source Build). |
| 9 |
# |
| 10 |
# Create the file ace/config.h containing #include "ace/config-vxworks.h" |
| 11 |
# Create the file include/makeinclude/platform_macros.GNU containing... |
| 12 |
# VSB_DIR = <<absolute path to the VSB directory for the target system>> |
| 13 |
# TOOL = gnu |
| 14 |
# HOST_ROOT = <<location of host tools if using tao_idl, etc.>> |
| 15 |
# << add other build settings here (debug, optimize, inline, rtp) >> |
| 16 |
# include $(ACE_ROOT)/include/makeinclude/platform_vxworks.GNU |
| 17 |
# |
| 18 |
# Use the wrenv script for your host system to start a VxWorks development shell |
| 19 |
# and build ACE from that shell using the normal procedure (set ACE_ROOT, |
| 20 |
# generate makefiles if necessary, etc.). |
| 21 |
# |
| 22 |
# Not all configurations supported on VxWorks 6.x have been brought forward |
| 23 |
# to this file. If you are building a configuration that has not yet been |
| 24 |
# attempted on VxWorks 7, this file may need to be changed. |
| 25 |
VXWORKS = 1 |
| 26 |
CROSS-COMPILE = 1 |
| 27 |
|
| 28 |
debug ?= 1 |
| 29 |
optimize ?= 1 |
| 30 |
threads ?= 1 |
| 31 |
rtp ?= 1 |
| 32 |
pthread ?= $(if $(findstring 1,$(rtp)),1,0) |
| 33 |
xerces ?= 0 |
| 34 |
aio ?= 0 |
| 35 |
versioned_so ?= 0 |
| 36 |
footprint ?= 0 |
| 37 |
rwho = 0 |
| 38 |
templates ?= automatic |
| 39 |
build_tao_idl_be = 0 |
| 40 |
|
| 41 |
ifeq (,$(WIND_BASE)) |
| 42 |
default: |
| 43 |
@ERROR: you must set your WIND_BASE environment variable |
| 44 |
endif # WIND_BASE |
| 45 |
|
| 46 |
ifeq (,$(WIND_HOST_TYPE)) |
| 47 |
default: |
| 48 |
@ERROR: you must set your WIND_HOST_TYPE environment variable |
| 49 |
endif # WIND_HOST_TYPE |
| 50 |
|
| 51 |
ifeq ($(WIND_HOST_TYPE),x86-win32) |
| 52 |
vxworks_ntbuild ?= 0 |
| 53 |
mingw32 ?= 1 |
| 54 |
lacks_touch ?= 0 |
| 55 |
PWD = $(subst \,/,$(shell pwd)) |
| 56 |
ACE_ROOT := $(subst \,/,$(ACE_ROOT)) |
| 57 |
TAO_ROOT := $(subst \,/,$(TAO_ROOT)) |
| 58 |
HOST_ROOT := $(subst \,/,$(HOST_ROOT)) |
| 59 |
override RM = rm -f |
| 60 |
HOST_EXE_EXT = .exe |
| 61 |
endif # x86-win32 |
| 62 |
|
| 63 |
ifneq (,$(HOST_ROOT)) |
| 64 |
TAO_IDLFLAGS += -g $(HOST_ROOT)/bin/ace_gperf |
| 65 |
TAO_IDL = $(HOST_ROOT)/bin/tao_idl$(HOST_EXE_EXT) |
| 66 |
TAO_IDL_DEP = $(TAO_IDL) |
| 67 |
else |
| 68 |
# Append the HOST_EXE_EXT if it's not already there |
| 69 |
TAO_IDL_DEP = $(TAO_IDL:$(HOST_EXE_EXT)=)$(HOST_EXE_EXT) |
| 70 |
endif |
| 71 |
|
| 72 |
VXWORKS_VERSION_FLAG ?= -DACE_VXWORKS=0x700 |
| 73 |
CPPFLAGS += $(VXWORKS_VERSION_FLAG) |
| 74 |
|
| 75 |
ifneq ($(WIND_RELEASE_ID), ) |
| 76 |
CPPFLAGS += -DACE_VXWORKS_RELEASE=0x$(subst .,,$(WIND_RELEASE_ID)) |
| 77 |
endif |
| 78 |
|
| 79 |
ifeq ($(pthread),1) |
| 80 |
CPPFLAGS += -DACE_HAS_PTHREADS |
| 81 |
endif |
| 82 |
|
| 83 |
ifeq ($(rtp),0) |
| 84 |
VSHDIR = $(VDIR) |
| 85 |
|
| 86 |
ifneq ($(shared_libs_only),1) |
| 87 |
DKM_LIBS = $(if $(findstring 1,$(static_libs)$(static_libs_only)),$(LDLIBS)) |
| 88 |
endif |
| 89 |
|
| 90 |
IFILE = $(VDIR)$(notdir $(basename $(1))) |
| 91 |
define LINK.cc.override |
| 92 |
$(LD) -r -nostdlib $(LDFLAGS) -o $(call IFILE,$@)_partial.o $(filter %.o,$^) $(DKM_LIBS) |
| 93 |
$(NM) $(call IFILE,$@)_partial.o | $(MUNCH) > $(call IFILE,$@)_ctdt.c |
| 94 |
$(COMPILE.c) -o $(call IFILE,$@)_ctdt.o $(call IFILE,$@)_ctdt.c |
| 95 |
$(LD) -r -nostdlib -X $(LD_SCRIPT_DOWNLOAD) -o $@ $(call IFILE,$@)_ctdt.o $(call IFILE,$@)_partial.o $(DKM_FINAL_LIBS) |
| 96 |
endef |
| 97 |
|
| 98 |
SOLINK.cc.override = $(LINK.cc.override) |
| 99 |
CLEANUP_OBJS += $(foreach x,_ctdt.c _ctdt.o _partial.o,$(addsuffix $(x),$(VDIR)$(notdir $(basename $(if $(LIB_NAME),$(VLIB),$(VBIN)))))) |
| 100 |
endif |
| 101 |
|
| 102 |
ace_vx_mk_dir = $(if $(findstring 1,$(rtp)),$(WIND_USR_MK),$(WIND_KRNL_MK)) |
| 103 |
include $(ace_vx_mk_dir)/defs.library.mk |
| 104 |
|
| 105 |
ifneq ($(rtp),0) |
| 106 |
## If we are building rtp and using the llvm (clang) compiler, we need to |
| 107 |
## use the linker directly to create shared libraries and executables. |
| 108 |
ifeq ($(TOOL),llvm) |
| 109 |
LLD = $(__WRS_TOOL_PATH)/ld$(TOOLENV) |
| 110 |
define LINK.cc.override |
| 111 |
$(LLD) $(LDFLAGS) $(LD_EMULATION) --allow-shlib-undefined -EL $(VSB_DIR)/usr/lib/common/crt0.o -o $@ $(filter %.o,$^) --start-group --as-needed $(LDLIBS) -lc -lc_internal -lllvm -lcplusplus -lllvmcplus -lnet -ldl --end-group |
| 112 |
endef |
| 113 |
define SOLINK.cc.override |
| 114 |
$(LLD) $(LDFLAGS) $(LD_EMULATION) -shared --exclude-libs libc_internal.a -u __init -u __fini -o $@ $(filter %.o,$^) --start-group --as-needed $(ACE_SHLIBS) -lc -lc_internal -lcplusplus -lnet --end-group |
| 115 |
endef |
| 116 |
endif |
| 117 |
endif |
| 118 |
|
| 119 |
dkm_libstdcpp ?= $(if $(findstring y,$(_WRS_CONFIG_PRI_diab)),1,0) |
| 120 |
ifeq ($(dkm_libstdcpp),1) |
| 121 |
DKM_LIBS += -L$(VSB_DIR)/krnl/gnu_standard --start-group -lstl -lgnucplus --end-group |
| 122 |
DKM_FINAL_LIBS = -L$(VSB_DIR)/krnl/gnu_standard -lgnucplus |
| 123 |
endif |
| 124 |
|
| 125 |
CCFLAGS += $(C++FLAGS) |
| 126 |
PIC += $(OPTION_SHARED_CODE) |
| 127 |
|
| 128 |
OCFLAGS += $(CC_OPTIM_NORMAL) |
| 129 |
OCCFLAGS += $(CC_OPTIM_NORMAL) |
| 130 |
CC_OPTIM = |
| 131 |
|
| 132 |
DCFLAGS += -g |
| 133 |
DCCFLAGS += -g |
| 134 |
|
| 135 |
DLD = $(LD) |
| 136 |
LDFLAGS += $(LDFLAGS_COMMON) |
| 137 |
|
| 138 |
EXEEXT = $(if $(findstring 1,$(rtp)),.vxe,.out) |
| 139 |
|
| 140 |
SO_NAME = $(SHLIB) |
| 141 |
SOFLAGS += $(C++_COMPILER) $(OPTION_SHARED_CODE) $(LD_SHARED_LIB) \ |
| 142 |
$(LD_OPTION_SONAME) |
| 143 |
|
| 144 |
ifeq ($(rtp),1) |
| 145 |
LD = $(CXX) |
| 146 |
LDFLAGS := $(filter-out -X -N,$(LDFLAGS)) |
| 147 |
LDFLAGS += -L$(VSB_DIR)/usr/lib/common$(if $(filter library,$(PRJ_TYPE)),/PIC -L$(VSB_DIR)/usr/lib/common) |
| 148 |
endif |
| 149 |
|
| 150 |
LIBS_CPLUSPLUS = $(foreach lib,$(LIBCPLUS), -l$(lib)) |
| 151 |
LIBS += $(LIBS_CPLUSPLUS) |
| 152 |
|
| 153 |
build_nonstatic = $(if $(findstring 1,$(shared_libs)$(shared_libs_only)),$(if $(filter 1,$(static_libs_only)),,1)) |
| 154 |
LDFLAGS += $(if $(build_nonstatic),$(LDFLAGS_DYNAMIC),-static $(LDFLAGS_STATIC)) |