5 #### 1) This file requires that the WIND_BASE and WIND_HOST_TYPE environment
6 #### variables be set. If the target CPU is not SIMNT, then your CPU
7 #### environment variable must be set.
8 #### 2) If you have problems with munch output not being compilable
9 #### because it contains identifiers with ".", e.g., ".cpp", in them:
10 #### add a global variable or function to that .cpp file. See
11 #### ace/IOStream_T.cpp for an explanation and example.
12 #### 3) The TOOL environment variable may be set to "diab" (default is "gnu").
13 #### 4) If perl is not on your path, you'll also need to set your PERL_PATH
14 #### environment variable to the full path to perl.
32 ifeq ($(static_libs),1)
37 ifeq ($(static_libs_only),1)
41 # VxWorks doesn't have rwho
46 @ERROR: you must set your WIND_BASE environment variable
49 ifeq (,$(WIND_HOST_TYPE))
51 @ERROR: you must set your WIND_HOST_TYPE environment variable
52 endif # WIND_HOST_TYPE
54 ifeq ("$(WIND_HOST_TYPE)","x86-win32")
58 PWD=$(subst \,/,$(shell pwd))
59 ACE_ROOT:=$(subst \,/,$(ACE_ROOT))
60 TAO_ROOT:=$(subst \,/,$(TAO_ROOT))
61 HOST_ROOT:=$(subst \,/,$(HOST_ROOT))
66 TAO_IDLFLAGS += -g $(HOST_ROOT)/bin/ace_gperf
67 ifeq ("$(WIND_HOST_TYPE)","x86-win32")
68 TAO_IDL = $(HOST_ROOT)/bin/tao_idl.exe
70 TAO_IDL = $(HOST_ROOT)/bin/tao_idl
72 TAO_IDL_DEP = $(TAO_IDL)
75 HOST_DIR = $(WIND_BASE)/host/$(WIND_HOST_TYPE)
81 ifeq ($(VXWORKS_VERSION_FLAG),)
82 VXWORKS_VERSION_FLAG = -DACE_VXWORKS=0x620
83 endif # VXWORKS_VERSION_FLAG
88 override TOOL := $(TOOL)
90 ifeq ($(TOOL_FAMILY),)
91 ifeq ($(findstring gnu,$(TOOL)),gnu)
92 override TOOL_FAMILY := gnu
94 override TOOL_FAMILY := diab
98 ifeq ("$(TOOL_FAMILY)","gnu")
99 templates ?= automatic
103 ifeq ($(findstring PPC, $(CPU)), PPC)
104 CPPFLAGS += -mlongcall
110 TARGET_DIR = $(WIND_BASE)/target/usr
112 TARGET_DIR = $(WIND_BASE)/target/h
114 TGT_DIR = $(WIND_BASE)/target
120 override CPU := $(CPU)
123 ifeq ($(shared_libs),1)
126 ifeq ($(shared_libs_only),1)
131 ifeq ($(SHARED_LIBS),1)
133 #### There's no difference between non-shared and shared object code.
141 ifneq ("$(BIN_UNCHECKED)","")
144 ifeq ($(SHARED_LIBS),1)
145 ifneq ("$(SHLIB_UNCHECKED)","")
149 ifneq ($(VX_SO_BUILD),1)
154 ifneq ($(VX_LIB_BUILD),1)
158 ifeq ($(VX_APP_BUILD),1)
159 ## set variables for VxWorks linktarget identification
162 PRJ_FILE = $(basename $(notdir $(BIN_UNCHECKED))).vxworks
164 PRJ_FILE = $(basename $(notdir $(BIN_UNCHECKED))).vxe
166 VXE_DIR := $(OUTPUT_DIRECTORY)
167 EXE = $(BIN_UNCHECKED)
170 CLEANUP_OBJS := ctdt.c $(PRJ_DIR)/$(PRJ_FILE) $(CLEANUP_OBJS)
172 ## set variables for VxWorks .SO linktarget identification
173 PRJ_FILE = $(basename $(notdir $(SHLIB_UNCHECKED))).vxworks
175 CLEANUP_OBJS := ctdt.c $(PRJ_DIR)/$(PRJ_FILE) *.out $(CLEANUP_OBJS)
180 include $(WIND_USR)/make/defs.default
181 include $(WIND_USR)/make/defs.$(WIND_HOST_TYPE)
182 include $(WIND_USR)/tool/$(TOOL_FAMILY)/make.$(CPU)$(TOOL)
184 LDFLAGS := $(filter-out -X, $(LDFLAGS))
185 LDFLAGS := $(filter-out -N, $(LDFLAGS))
189 ifeq ($(SHARED_LIBS), 1))
190 ifeq ($(PRJ_TYPE),library)
195 ifeq ($(findstring *sf,*$(TOOL)),*sf)
196 LDFLAGS += -L$(WIND_USR)/lib/$(VX_CPU_FAMILY)/$(CPU)/sfcommon$(PICDIR)
198 LDFLAGS += -L$(WIND_USR)/lib/$(VX_CPU_FAMILY)/$(CPU)/common$(PICDIR)
203 include $(TGT_DIR)/h/make/defs.default
204 include $(TGT_DIR)/h/make/defs.$(WIND_HOST_TYPE)
205 include $(TGT_DIR)/h/make/defs.$(PRJ_TYPE)
206 include $(TGT_DIR)/h/tool/$(TOOL_FAMILY)/make.$(CPU)$(TOOL)
210 ifeq ($(no_cflags_ansi), 1)
211 ifeq ("$(TOOL_FAMILY)","gnu")
212 CC_COMPILER := $(filter-out -ansi, $(CC_COMPILER))
214 CC_COMPILER := $(filter-out -Xansi, $(CC_COMPILER))
219 ifeq ($(no_ccflags_ansi), 1)
220 ifeq ("$(TOOL_FAMILY)","gnu")
221 C++_COMPILER := $(filter-out -ansi, $(C++_COMPILER))
223 C++_COMPILER := $(filter-out -Xansi, $(C++_COMPILER))
227 ifeq ($(VXWORKSLINK),1)
228 # prevent possible clash with static LIB rules
229 # in VxWorks make includes and rules.lib.GNU
231 override LARGE_PROJECT =
232 PRJ_OBJS = $(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
233 ifeq ($(SHARED_LIBS),1)
234 ##LD_PARTIAL += -L$(ACE_ROOT)/lib -L./ $(LDLIBPATH) $(LD_LINK_PATH)
235 PRJ_OBJS_FOR_LD_PARTIAL=$(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
236 ifeq ($(VX_SO_BUILD),1)
237 ## Shared lib builds for VxWorks will also build 'import' libraries
238 LIB_INSTALL += $(VLIB:%=$(INSLIB)/%)
239 CLEANUP_INSTALL += $(CLEANUP_VLIB:%=$(INSLIB)/%)
240 REALCLEAN_FILES += $(CLEANUP_LIB:%=%) $(CLEANUP_LIB:%=%_debug) $(CLEANUP_LIB:%=%_profile) $(CLEANUP_LIB:%=%_optimize)
243 LD_PARTIAL += -L$(ACE_ROOT)/ace -L./ $(LDLIBPATH) $(LD_LINK_PATH) $(LD_PARTIALFLAGS)
244 PRJ_OBJS_FOR_LD_PARTIAL=$(addprefix $(VDIR), $(OBJS)) $(VSHOBJS) $(VLDLIBS) $(ACE_SHLIBS) $(LIBS)
246 PRJ_OBJS_FOR_LD=$(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
247 PRJ_OBJS_FOR_NM=$(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
248 PRJ_OBJS_FOR_AR=$(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
249 POST_BUILD_RULE = $(POSTLINK)
250 COMPILE_TRADITIONAL = $(CC) $(OPTION_OBJECT_ONLY) $(OPTION_DOLLAR_SYMBOLS)\
251 $(filter-out -ansi, $(CFLAGS))
253 ## make sure default target stays the ACE/TAO default target
259 CPPFLAGS += $(VXWORKS_VERSION_FLAG)
268 CPPFLAGS += -DACE_HAS_PTHREADS
271 ifeq ("$(TOOL_FAMILY)","gnu")
272 # Test for template instantiation, add to SOFLAGS if SONAME set,
273 # add -E to LDFLAGS if using GNU ld
274 include $(ACE_ROOT)/include/makeinclude/platform_g++_common.GNU
276 ifeq ("$(templates)","automatic")
278 ifeq ($(VXWORKSLINK),1)
279 ifeq ($(VX_APP_BUILD),1)
280 ifneq ($(SHARED_LIBS),1)
288 LINK.cc.override = $(LD_PARTIAL) -frepo -L$(ACE_ROOT)/ace -L$(INSLIB) -L./ $(LDLIBPATH) $(LD_LINK_PATH)
289 ifneq ($(SHARED_LIBS),1)
290 LDFLAGS = $(ACE_SHLIBS)
296 endif # TOOL_FAMILY == gnu
298 ifeq ("$(TOOL_FAMILY)","diab")
299 C++FLAGS += -Xexceptions
301 ifeq ("$(TOOL_FAMILY)","gnu")
302 C++FLAGS += -fexceptions
306 ifneq ($(findstring $(VX_CPU_FAMILY),ppc arm),)
307 ifeq ("$(TOOL_FAMILY)","diab")
308 C++FLAGS += -Xchar-signed
310 ifeq ("$(TOOL_FAMILY)","gnu")
311 C++FLAGS += -fsigned-char
317 override MUNCH_FLAGS := -asm $(TOOLENV)
320 ifneq ($(optimize),1)
324 CCFLAGS += $(C++FLAGS) $(FLAGS_C_CC)
329 ifeq ("$(TOOL)","diab")
332 ifeq ("$(TOOL)","gnu")
338 ifeq ($(VXWORKSLINK),1)
341 ifeq ($(SHARED_LIBS),1)
342 BACKUP_RPO_RULE = for %f in ($(basename $(addprefix $(VDIR), $(OBJS)) $(VSHOBJS))) do if exist %f.rpo mv %f.rpo %f.rpobak $(ACE_NUL_STDERR)
343 POST_BUILD_RULE = for %f in ($(basename $(addprefix $(VDIR), $(OBJS)) $(VSHOBJS))) do if exist %f.rpobak mv %f.rpobak %f.rpo $(ACE_NUL_STDERR)
347 .PHONY: $(PRJ_DIR)/$(PRJ_FILE)
348 ## special target to satisfy VxWorks dependencies for images
349 $(PRJ_DIR)/$(PRJ_FILE):
351 ifeq ($(SHARED_LIBS),1)
352 #### execute prelink step to make compiler instantiate all needed
353 #### templates; discard image and repo files (*.rpo) after linkstep
354 #### this step holds for both .SO as well as 'app' images so use both VSHOBJS and OBJS
355 -$(LD_PARTIAL) -frepo -L$(ACE_ROOT)/ace -L./ $(LDLIBPATH) $(LD_LINK_PATH)$(LINK_OUTPUT_FLAG) ace-templ_inst $? $(ACE_SHLIBS) $(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
356 -$(RM) ace-templ_inst
357 #### We need to backup the .RPO files or otherwise the link step of the final image will
358 #### start instantiating templates again even if we do not specify '-frepo'!
360 ifeq ($(VX_SO_BUILD),1)
361 #### build library of objects in .SO to use as a sort of import library for VxWorks
362 echo $(filter %.o, $(VSHOBJS)) | xargs $(AR) $(ARFLAGS) $(VLIB) $(AREXTRA)