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.
33 ifeq ($(static_libs),1)
38 ifeq ($(static_libs_only),1)
42 # VxWorks doesn't have rwho
47 @ERROR: you must set your WIND_BASE environment variable
50 ifeq (,$(WIND_HOST_TYPE))
52 @ERROR: you must set your WIND_HOST_TYPE environment variable
53 endif # WIND_HOST_TYPE
55 ifeq ("$(WIND_HOST_TYPE)","x86-win32")
59 PWD=$(subst \,/,$(shell pwd))
60 ACE_ROOT:=$(subst \,/,$(ACE_ROOT))
61 TAO_ROOT:=$(subst \,/,$(TAO_ROOT))
62 HOST_ROOT:=$(subst \,/,$(HOST_ROOT))
68 TAO_IDLFLAGS += -g $(HOST_ROOT)/bin/ace_gperf
69 TAO_IDL = $(HOST_ROOT)/bin/tao_idl$(HOST_EXE_EXT)
70 TAO_IDL_DEP = $(TAO_IDL)
72 # Append the HOST_EXE_EXT if it's not already there
73 TAO_IDL_DEP = $(TAO_IDL:$(HOST_EXE_EXT)=)$(HOST_EXE_EXT)
76 HOST_DIR = $(WIND_BASE)/host/$(WIND_HOST_TYPE)
82 ifeq ($(VXWORKS_VERSION_FLAG),)
83 VXWORKS_VERSION_FLAG = -DACE_VXWORKS=0x630
84 endif # VXWORKS_VERSION_FLAG
89 override TOOL := $(TOOL)
91 ifeq ($(TOOL_FAMILY),)
92 ifeq ($(findstring gnu,$(TOOL)),gnu)
93 override TOOL_FAMILY := gnu
95 override TOOL_FAMILY := diab
99 ifeq ("$(TOOL_FAMILY)","gnu")
100 templates ?= automatic
104 ifeq ($(findstring PPC,$(CPU)),PPC)
105 CPPFLAGS += -mlongcall
111 TARGET_DIR = $(WIND_BASE)/target/usr
113 TARGET_DIR = $(WIND_BASE)/target/h
115 TGT_DIR = $(WIND_BASE)/target
121 override CPU := $(CPU)
124 ifeq ($(shared_libs),1)
127 ifeq ($(shared_libs_only),1)
132 ifeq ($(SHARED_LIBS),1)
134 #### There's no difference between non-shared and shared object code.
142 ifneq ("$(BIN_UNCHECKED)","")
145 ifeq ($(SHARED_LIBS),1)
146 ifneq ("$(SHLIB_UNCHECKED)","")
150 ifneq ($(VX_SO_BUILD),1)
155 ifneq ($(VX_LIB_BUILD),1)
159 ifeq ($(VX_APP_BUILD),1)
160 ## set variables for VxWorks linktarget identification
163 PRJ_FILE = $(basename $(notdir $(BIN_UNCHECKED))).vxworks
165 PRJ_FILE = $(basename $(notdir $(BIN_UNCHECKED))).vxe
167 VXE_DIR := $(OUTPUT_DIRECTORY)
168 EXE = $(BIN_UNCHECKED)
171 CLEANUP_OBJS := ctdt.c $(PRJ_DIR)/$(PRJ_FILE) $(CLEANUP_OBJS)
173 ## set variables for VxWorks .SO linktarget identification
174 PRJ_FILE = $(basename $(notdir $(SHLIB_UNCHECKED))).vxworks
176 CLEANUP_OBJS := ctdt.c $(PRJ_DIR)/$(PRJ_FILE) *.out $(CLEANUP_OBJS)
181 include $(WIND_USR)/make/defs.default
182 include $(WIND_USR)/tool/$(TOOL_FAMILY)/make.$(CPU)$(TOOL)
183 include $(WIND_USR)/make/defs.$(WIND_HOST_TYPE)
184 ifeq ("$(TOOL_FAMILY)","gnu")
188 ifeq ($(SHARED_LIBS), 1)
190 CPPFLAGS += -DACE_HAS_AIO_CALLS
193 ifeq ($(PRJ_TYPE),library)
197 LDFLAGS := $(filter-out -X, $(LDFLAGS))
198 LDFLAGS := $(filter-out -N, $(LDFLAGS))
202 ifeq ($(findstring *sf,*$(TOOL)),*sf)
203 LDFLAGS += -L$(WIND_USR)/$(WIND_USR_LIB)/$(VX_CPU_FAMILY)/$(CPU)/sfcommon$(PICDIR)
205 LDFLAGS += -L$(WIND_USR)/$(WIND_USR_LIB)/$(VX_CPU_FAMILY)/$(CPU)/common$(PICDIR)
208 include $(TGT_DIR)/h/make/defs.default
209 include $(TGT_DIR)/h/make/defs.$(WIND_HOST_TYPE)
210 include $(TGT_DIR)/h/make/defs.$(PRJ_TYPE)
211 include $(TGT_DIR)/h/tool/$(TOOL_FAMILY)/make.$(CPU)$(TOOL)
214 ifeq ($(SHARED_LIBS), 1)
215 ifeq ("$(TOOL_FAMILY)","gnu")
219 LDFLAGS += -Wl,-rpath-link,$(ACE_ROOT)/lib
222 LDFLAGS += -non-static
233 ifeq ($(no_cflags_ansi), 1)
234 ifeq ("$(TOOL_FAMILY)","gnu")
235 CC_COMPILER := $(filter-out -ansi, $(CC_COMPILER))
237 CC_COMPILER := $(filter-out -Xansi, $(CC_COMPILER))
242 ifeq ($(no_ccflags_ansi), 1)
243 ifeq ("$(TOOL_FAMILY)","gnu")
244 C++_COMPILER := $(filter-out -ansi, $(C++_COMPILER))
246 C++_COMPILER := $(filter-out -Xansi, $(C++_COMPILER))
250 ifeq ($(footprint),1)
251 LD_PARTIALFLAGS += -Xlinker -M -Xlinker -Map -Xlinker $@.map
254 ifeq ($(VXWORKSLINK), 1)
255 # prevent possible clash with static LIB rules
256 # in VxWorks make includes and rules.lib.GNU
258 override LARGE_PROJECT =
259 PRJ_OBJS = $(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
260 ifeq ($(SHARED_LIBS),1)
261 ##LD_PARTIAL += -L$(ACE_ROOT)/lib -L./ $(LDLIBPATH) $(LD_LINK_PATH)
262 PRJ_OBJS_FOR_LD_PARTIAL=$(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
263 ifeq ($(VX_SO_BUILD),1)
264 ## Shared lib builds for VxWorks will also build 'import' libraries
266 LIB_INSTALL += $(VLIB:%=$(INSLIB)/%)
267 CLEANUP_INSTALL += $(CLEANUP_VLIB:%=$(INSLIB)/%)
268 REALCLEAN_FILES += $(CLEANUP_LIB:%=%) $(CLEANUP_LIB:%=%_debug) $(CLEANUP_LIB:%=%_profile) $(CLEANUP_LIB:%=%_optimize)
272 LD_PARTIAL += -L$(ACE_ROOT)/ace -L./ $(LDLIBPATH) $(LD_LINK_PATH) $(LD_PARTIALFLAGS)
273 ifeq ($(footprint),0)
274 PRJ_OBJS_FOR_LD_PARTIAL=$(addprefix $(VDIR), $(OBJS)) $(VSHOBJS) $(VLDLIBS) $(ACE_SHLIBS) $(LIBS)
276 PRJ_OBJS_FOR_LD_PARTIAL=$(VSHOBJS) $(VLDLIBS) $(ACE_SHLIBS) $(LIBS)
277 LD_PARTIAL_LAST_FLAGS += $(addprefix $(VDIR), $(OBJS)) $(VSHOBJS) $(VLDLIBS)
280 PRJ_OBJS_FOR_LD=$(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
281 PRJ_OBJS_FOR_NM=$(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
282 PRJ_OBJS_FOR_AR=$(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
283 POST_BUILD_RULE = $(POSTLINK)
284 COMPILE_TRADITIONAL = $(CC) $(OPTION_OBJECT_ONLY) $(OPTION_DOLLAR_SYMBOLS)\
285 $(filter-out -ansi, $(CFLAGS))
287 ## make sure default target stays the ACE/TAO default target
293 CPPFLAGS += $(VXWORKS_VERSION_FLAG)
302 CPPFLAGS += -DACE_HAS_PTHREADS
305 ifeq ("$(TOOL_FAMILY)","gnu")
306 # Test for template instantiation, add to SOFLAGS if SONAME set,
307 # add -E to LDFLAGS if using GNU ld
308 include $(ACE_ROOT)/include/makeinclude/platform_g++_common.GNU
310 ifeq ("$(templates)","automatic")
312 ifeq ($(VXWORKSLINK), 1)
313 ifeq ($(VX_APP_BUILD),1)
314 ifneq ($(SHARED_LIBS),1)
322 LINK.cc.override = $(LD_PARTIAL) -frepo -L$(ACE_ROOT)/ace -L$(INSLIB) -L./ $(LDLIBPATH) $(LD_LINK_PATH)
323 ifneq ($(SHARED_LIBS),1)
324 LDFLAGS = $(ACE_SHLIBS)
330 endif # TOOL_FAMILY == gnu
332 ifeq ("$(TOOL_FAMILY)","diab")
333 C++FLAGS += -Xexceptions
335 ifeq ("$(TOOL_FAMILY)","gnu")
336 C++FLAGS += -fexceptions
340 ifeq ("$(TOOL_FAMILY)","diab")
344 ifneq ($(findstring $(VX_CPU_FAMILY),ppc arm),)
345 ifeq ("$(TOOL_FAMILY)","diab")
346 C++FLAGS += -Xchar-signed
348 ifeq ("$(TOOL_FAMILY)","gnu")
349 C++FLAGS += -fsigned-char
355 override MUNCH_FLAGS := -asm $(TOOLENV)
358 ifneq ($(optimize),1)
362 CCFLAGS += $(C++FLAGS) $(FLAGS_C_CC)
364 ifeq ($(VXWORKSLINK), 1)
367 ifeq ($(SHARED_LIBS),1)
368 BACKUP_RPO_RULE = for f in $(basename $(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)) ; do if [ -a $$f.rpo ] ; then mv $$f.rpo $$f.rpobak $(ACE_NUL_STDERR) ; fi ; done ;
369 POST_BUILD_RULE = for f in $(basename $(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)) ; do if [ -a $$f.rpobak ] ; then mv $$f.rpobak $$f.rpo $(ACE_NUL_STDERR) ; fi ; done ;
373 ## special target to satisfy VxWorks dependencies for images
374 $(PRJ_DIR)/$(PRJ_FILE):
376 ifeq ($(SHARED_LIBS),1)
377 #### execute prelink step to make compiler instantiate all needed
378 #### templates; discard image and repo files (*.rpo) after linkstep
379 #### this step holds for both .SO as well as 'app' images so use both VSHOBJS and OBJS
380 -$(LD_PARTIAL) -frepo -L$(ACE_ROOT)/ace -L./ $(LDLIBPATH) $(LD_LINK_PATH)$(LINK_OUTPUT_FLAG) ace-templ_inst $? $(ACE_SHLIBS) $(addprefix $(VDIR), $(OBJS)) $(VSHOBJS)
381 -$(RM) ace-templ_inst
382 #### We need to backup the .RPO files or otherwise the link step of the final image will
383 #### start instantiating templates again even if we do not specify '-frepo'!
385 ifeq ($(VX_SO_BUILD),1)
386 #### build library of objects in .SO to use as a sort of import library for VxWorks
387 echo $(filter %.o, $(VSHOBJS)) | xargs $(AR) $(ARFLAGS) $(VLIB) $(AREXTRA)