4 # Building ACE for VxWorks 7
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).
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>>
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
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.).
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.
32 pthread ?= $(if $(findstring 1,$(rtp)),1,0)
38 templates ?= automatic
43 @ERROR: you must set your WIND_BASE environment variable
46 ifeq (,$(WIND_HOST_TYPE))
48 @ERROR: you must set your WIND_HOST_TYPE environment variable
49 endif # WIND_HOST_TYPE
51 ifeq ($(WIND_HOST_TYPE),x86-win32)
55 PWD = $(subst \,/,$(shell pwd))
56 ACE_ROOT := $(subst \,/,$(ACE_ROOT))
57 TAO_ROOT := $(subst \,/,$(TAO_ROOT))
58 HOST_ROOT := $(subst \,/,$(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)
68 # Append the HOST_EXE_EXT if it's not already there
69 TAO_IDL_DEP = $(TAO_IDL:$(HOST_EXE_EXT)=)$(HOST_EXE_EXT)
72 VXWORKS_VERSION_FLAG ?= -DACE_VXWORKS=0x700
73 CPPFLAGS += $(VXWORKS_VERSION_FLAG)
75 ifneq ($(WIND_RELEASE_ID), )
76 CPPFLAGS += -DACE_VXWORKS_RELEASE=0x$(subst .,,$(WIND_RELEASE_ID))
80 CPPFLAGS += -DACE_HAS_PTHREADS
86 ifneq ($(shared_libs_only),1)
87 DKM_LIBS = $(if $(findstring 1,$(static_libs)$(static_libs_only)),$(LDLIBS))
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)
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))))))
102 ace_vx_mk_dir = $(if $(findstring 1,$(rtp)),$(WIND_USR_MK),$(WIND_KRNL_MK))
103 include $(ace_vx_mk_dir)/defs.library.mk
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.
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
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
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
125 CCFLAGS += $(C++FLAGS)
126 PIC += $(OPTION_SHARED_CODE)
128 OCFLAGS += $(CC_OPTIM_NORMAL)
129 OCCFLAGS += $(CC_OPTIM_NORMAL)
136 LDFLAGS += $(LDFLAGS_COMMON)
138 EXEEXT = $(if $(findstring 1,$(rtp)),.vxe,.out)
141 SOFLAGS += $(C++_COMPILER) $(OPTION_SHARED_CODE) $(LD_SHARED_LIB) \
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)
150 LIBS_CPLUSPLUS = $(foreach lib,$(LIBCPLUS), -l$(lib))
151 LIBS += $(LIBS_CPLUSPLUS)
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))