| 1 |
# -*- Makefile -*- |
| 2 |
# VxWorks 6.3 |
| 3 |
|
| 4 |
#### Notes: |
| 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. |
| 15 |
|
| 16 |
VXWORKS = 1 |
| 17 |
CROSS-COMPILE = 1 |
| 18 |
|
| 19 |
debug ?= 1 |
| 20 |
optimize ?= 1 |
| 21 |
threads ?= 1 |
| 22 |
rtp ?= 1 |
| 23 |
ifeq ($(rtp),0) |
| 24 |
pthread ?= 0 |
| 25 |
else |
| 26 |
pthread ?= 1 |
| 27 |
endif |
| 28 |
xerces ?= 0 |
| 29 |
aio ?= 0 |
| 30 |
versioned_so ?= 0 |
| 31 |
footprint ?= 0 |
| 32 |
|
| 33 |
ifeq ($(static_libs),1) |
| 34 |
shared_libs = 0 |
| 35 |
else |
| 36 |
static_libs = 0 |
| 37 |
endif |
| 38 |
ifeq ($(static_libs_only),1) |
| 39 |
shared_libs = 0 |
| 40 |
endif |
| 41 |
|
| 42 |
# VxWorks doesn't have rwho |
| 43 |
rwho = 0 |
| 44 |
|
| 45 |
ifeq (,$(WIND_BASE)) |
| 46 |
default: |
| 47 |
@ERROR: you must set your WIND_BASE environment variable |
| 48 |
endif # WIND_BASE |
| 49 |
|
| 50 |
ifeq (,$(WIND_HOST_TYPE)) |
| 51 |
default: |
| 52 |
@ERROR: you must set your WIND_HOST_TYPE environment variable |
| 53 |
endif # WIND_HOST_TYPE |
| 54 |
|
| 55 |
ifeq ("$(WIND_HOST_TYPE)","x86-win32") |
| 56 |
vxworks_ntbuild ?= 0 |
| 57 |
mingw32 ?= 1 |
| 58 |
lacks_touch ?= 0 |
| 59 |
PWD=$(subst \,/,$(shell pwd)) |
| 60 |
ACE_ROOT:=$(subst \,/,$(ACE_ROOT)) |
| 61 |
TAO_ROOT:=$(subst \,/,$(TAO_ROOT)) |
| 62 |
HOST_ROOT:=$(subst \,/,$(HOST_ROOT)) |
| 63 |
override RM=rm -f |
| 64 |
HOST_EXE_EXT = .exe |
| 65 |
endif # x86-win32 |
| 66 |
|
| 67 |
ifneq (,$(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) |
| 71 |
else |
| 72 |
# Append the HOST_EXE_EXT if it's not already there |
| 73 |
TAO_IDL_DEP = $(TAO_IDL:$(HOST_EXE_EXT)=)$(HOST_EXE_EXT) |
| 74 |
endif |
| 75 |
|
| 76 |
HOST_DIR = $(WIND_BASE)/host/$(WIND_HOST_TYPE) |
| 77 |
|
| 78 |
ifeq (,$(PERL_PATH)) |
| 79 |
PERL_PATH = perl |
| 80 |
endif # ! PERL_PATH |
| 81 |
|
| 82 |
ifeq ($(VXWORKS_VERSION_FLAG),) |
| 83 |
VXWORKS_VERSION_FLAG = -DACE_VXWORKS=0x630 |
| 84 |
endif # VXWORKS_VERSION_FLAG |
| 85 |
|
| 86 |
ifeq ($(TOOL),) |
| 87 |
override TOOL = gnu |
| 88 |
else |
| 89 |
override TOOL := $(TOOL) |
| 90 |
endif |
| 91 |
ifeq ($(TOOL_FAMILY),) |
| 92 |
ifeq ($(findstring gnu,$(TOOL)),gnu) |
| 93 |
override TOOL_FAMILY := gnu |
| 94 |
else |
| 95 |
override TOOL_FAMILY := diab |
| 96 |
endif |
| 97 |
endif |
| 98 |
|
| 99 |
ifeq ("$(TOOL_FAMILY)","gnu") |
| 100 |
templates ?= automatic |
| 101 |
endif |
| 102 |
|
| 103 |
ifeq ($(rtp),0) |
| 104 |
ifeq ($(findstring PPC,$(CPU)),PPC) |
| 105 |
CPPFLAGS += -mlongcall |
| 106 |
endif |
| 107 |
PRJ_TYPE = vxApp |
| 108 |
endif |
| 109 |
|
| 110 |
ifeq ($(rtp),1) |
| 111 |
TARGET_DIR = $(WIND_BASE)/target/usr |
| 112 |
else |
| 113 |
TARGET_DIR = $(WIND_BASE)/target/h |
| 114 |
endif |
| 115 |
TGT_DIR = $(WIND_BASE)/target |
| 116 |
|
| 117 |
ifeq ($(CPU),) |
| 118 |
# default CPU |
| 119 |
CPU = SIMNT |
| 120 |
else |
| 121 |
override CPU := $(CPU) |
| 122 |
endif |
| 123 |
|
| 124 |
ifeq ($(shared_libs),1) |
| 125 |
SHARED_LIBS = 1 |
| 126 |
endif |
| 127 |
ifeq ($(shared_libs_only),1) |
| 128 |
SHARED_LIBS = 1 |
| 129 |
endif |
| 130 |
|
| 131 |
ifeq ($(rtp),0) |
| 132 |
ifeq ($(SHARED_LIBS),1) |
| 133 |
ACELIB = -L./ |
| 134 |
#### There's no difference between non-shared and shared object code. |
| 135 |
VSHDIR = $(VDIR) |
| 136 |
endif # shared_libs |
| 137 |
endif |
| 138 |
|
| 139 |
BIN_UNCHECKED ?= |
| 140 |
SHLIB_UNCHECKED ?= |
| 141 |
|
| 142 |
ifneq ("$(BIN_UNCHECKED)","") |
| 143 |
VX_APP_BUILD := 1 |
| 144 |
else |
| 145 |
ifeq ($(SHARED_LIBS),1) |
| 146 |
ifneq ("$(SHLIB_UNCHECKED)","") |
| 147 |
VX_SO_BUILD := 1 |
| 148 |
endif |
| 149 |
endif |
| 150 |
ifneq ($(VX_SO_BUILD),1) |
| 151 |
VX_LIB_BUILD := 1 |
| 152 |
endif |
| 153 |
endif |
| 154 |
|
| 155 |
ifneq ($(VX_LIB_BUILD),1) |
| 156 |
ifeq ($(rtp),0) |
| 157 |
VXWORKSLINK ?= 1 |
| 158 |
endif |
| 159 |
ifeq ($(VX_APP_BUILD),1) |
| 160 |
## set variables for VxWorks linktarget identification |
| 161 |
ifeq ($(rtp),0) |
| 162 |
EXEEXT = .out |
| 163 |
PRJ_FILE = $(basename $(notdir $(BIN_UNCHECKED))).vxworks |
| 164 |
else |
| 165 |
PRJ_FILE = $(basename $(notdir $(BIN_UNCHECKED))).vxe |
| 166 |
EXEEXT = .vxe |
| 167 |
VXE_DIR := $(OUTPUT_DIRECTORY) |
| 168 |
EXE = $(BIN_UNCHECKED) |
| 169 |
endif |
| 170 |
PRJ_DIR = . |
| 171 |
CLEANUP_OBJS := ctdt.c $(PRJ_DIR)/$(PRJ_FILE) $(CLEANUP_OBJS) |
| 172 |
else |
| 173 |
## set variables for VxWorks .SO linktarget identification |
| 174 |
PRJ_FILE = $(basename $(notdir $(SHLIB_UNCHECKED))).vxworks |
| 175 |
PRJ_DIR = . |
| 176 |
CLEANUP_OBJS := ctdt.c $(PRJ_DIR)/$(PRJ_FILE) *.out $(CLEANUP_OBJS) |
| 177 |
endif |
| 178 |
endif |
| 179 |
|
| 180 |
ifeq ($(rtp),1) |
| 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") |
| 185 |
CPPFLAGS += -mrtp |
| 186 |
SOFLAGS += -mrtp |
| 187 |
endif |
| 188 |
ifeq ($(SHARED_LIBS), 1) |
| 189 |
ifeq ($(aio),1) |
| 190 |
CPPFLAGS += -DACE_HAS_AIO_CALLS |
| 191 |
LIBS += AioPx |
| 192 |
endif |
| 193 |
ifeq ($(PRJ_TYPE),library) |
| 194 |
PICDIR = /PIC |
| 195 |
endif |
| 196 |
endif |
| 197 |
LDFLAGS := $(filter-out -X, $(LDFLAGS)) |
| 198 |
LDFLAGS := $(filter-out -N, $(LDFLAGS)) |
| 199 |
LD := $(CPLUS) |
| 200 |
DLD := $(CPLUS) |
| 201 |
WIND_USR_LIB ?= lib |
| 202 |
ifeq ($(findstring *sf,*$(TOOL)),*sf) |
| 203 |
LDFLAGS += -L$(WIND_USR)/$(WIND_USR_LIB)/$(VX_CPU_FAMILY)/$(CPU)/sfcommon$(PICDIR) |
| 204 |
else |
| 205 |
LDFLAGS += -L$(WIND_USR)/$(WIND_USR_LIB)/$(VX_CPU_FAMILY)/$(CPU)/common$(PICDIR) |
| 206 |
endif |
| 207 |
else |
| 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) |
| 212 |
endif |
| 213 |
|
| 214 |
ifeq ($(SHARED_LIBS), 1) |
| 215 |
ifeq ("$(TOOL_FAMILY)","gnu") |
| 216 |
ifeq ($(rtp),1) |
| 217 |
PIC = -fpic |
| 218 |
SOFLAGS += -fpic |
| 219 |
LDFLAGS += -Wl,-rpath-link,$(ACE_ROOT)/lib |
| 220 |
endif |
| 221 |
SOFLAGS += -shared |
| 222 |
LDFLAGS += -non-static |
| 223 |
else |
| 224 |
ifeq ($(rtp),1) |
| 225 |
PIC = -Xpic |
| 226 |
endif |
| 227 |
SOFLAGS += -Xshared |
| 228 |
LDFLAGS += -Xdynamic |
| 229 |
endif |
| 230 |
endif |
| 231 |
|
| 232 |
no_cflags_ansi ?= 0 |
| 233 |
ifeq ($(no_cflags_ansi), 1) |
| 234 |
ifeq ("$(TOOL_FAMILY)","gnu") |
| 235 |
CC_COMPILER := $(filter-out -ansi, $(CC_COMPILER)) |
| 236 |
else |
| 237 |
CC_COMPILER := $(filter-out -Xansi, $(CC_COMPILER)) |
| 238 |
endif |
| 239 |
endif |
| 240 |
|
| 241 |
no_ccflags_ansi ?= 0 |
| 242 |
ifeq ($(no_ccflags_ansi), 1) |
| 243 |
ifeq ("$(TOOL_FAMILY)","gnu") |
| 244 |
C++_COMPILER := $(filter-out -ansi, $(C++_COMPILER)) |
| 245 |
else |
| 246 |
C++_COMPILER := $(filter-out -Xansi, $(C++_COMPILER)) |
| 247 |
endif |
| 248 |
endif |
| 249 |
|
| 250 |
ifeq ($(footprint),1) |
| 251 |
LD_PARTIALFLAGS += -Xlinker -M -Xlinker -Map -Xlinker [email protected] |
| 252 |
endif |
| 253 |
|
| 254 |
ifeq ($(VXWORKSLINK), 1) |
| 255 |
# prevent possible clash with static LIB rules |
| 256 |
# in VxWorks make includes and rules.lib.GNU |
| 257 |
override ARCHIVE = |
| 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 |
| 265 |
ifeq ($(rtp),1) |
| 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) |
| 269 |
endif |
| 270 |
endif |
| 271 |
else |
| 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) |
| 275 |
else |
| 276 |
PRJ_OBJS_FOR_LD_PARTIAL=$(VSHOBJS) $(VLDLIBS) $(ACE_SHLIBS) $(LIBS) |
| 277 |
LD_PARTIAL_LAST_FLAGS += $(addprefix $(VDIR), $(OBJS)) $(VSHOBJS) $(VLDLIBS) |
| 278 |
endif |
| 279 |
endif |
| 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)) |
| 286 |
|
| 287 |
## make sure default target stays the ACE/TAO default target |
| 288 |
## |
| 289 |
default: all |
| 290 |
|
| 291 |
endif |
| 292 |
|
| 293 |
CPPFLAGS += $(VXWORKS_VERSION_FLAG) |
| 294 |
|
| 295 |
ifeq ($(debug),1) |
| 296 |
DCFLAGS += -g |
| 297 |
DCCFLAGS += -g |
| 298 |
CPPFLAGS += |
| 299 |
endif |
| 300 |
|
| 301 |
ifeq ($(pthread),1) |
| 302 |
CPPFLAGS += -DACE_HAS_PTHREADS |
| 303 |
endif |
| 304 |
|
| 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 |
| 309 |
|
| 310 |
ifeq ("$(templates)","automatic") |
| 311 |
ifeq ($(repo),1) |
| 312 |
ifeq ($(VXWORKSLINK), 1) |
| 313 |
ifeq ($(VX_APP_BUILD),1) |
| 314 |
ifneq ($(SHARED_LIBS),1) |
| 315 |
LD_PARTIAL += -frepo |
| 316 |
endif |
| 317 |
endif |
| 318 |
else |
| 319 |
ifeq ($(rtp),0) |
| 320 |
ace_lib_prelink := 1 |
| 321 |
LINK.cc = override |
| 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) |
| 325 |
endif |
| 326 |
endif |
| 327 |
endif |
| 328 |
endif |
| 329 |
endif |
| 330 |
endif # TOOL_FAMILY == gnu |
| 331 |
|
| 332 |
ifeq ("$(TOOL_FAMILY)","diab") |
| 333 |
C++FLAGS += -Xexceptions |
| 334 |
else |
| 335 |
ifeq ("$(TOOL_FAMILY)","gnu") |
| 336 |
C++FLAGS += -fexceptions |
| 337 |
endif |
| 338 |
endif |
| 339 |
|
| 340 |
ifeq ("$(TOOL_FAMILY)","diab") |
| 341 |
LIBS += -lstlstd |
| 342 |
endif |
| 343 |
|
| 344 |
ifneq ($(findstring $(VX_CPU_FAMILY),ppc arm),) |
| 345 |
ifeq ("$(TOOL_FAMILY)","diab") |
| 346 |
C++FLAGS += -Xchar-signed |
| 347 |
else |
| 348 |
ifeq ("$(TOOL_FAMILY)","gnu") |
| 349 |
C++FLAGS += -fsigned-char |
| 350 |
endif |
| 351 |
endif |
| 352 |
endif |
| 353 |
|
| 354 |
ifeq ($(CPU),SIMNT) |
| 355 |
override MUNCH_FLAGS := -asm $(TOOLENV) |
| 356 |
endif |
| 357 |
|
| 358 |
ifneq ($(optimize),1) |
| 359 |
CC_OPTIM_NORMAL = |
| 360 |
endif |
| 361 |
|
| 362 |
CCFLAGS += $(C++FLAGS) $(FLAGS_C_CC) |
| 363 |
|
| 364 |
ifeq ($(VXWORKSLINK), 1) |
| 365 |
|
| 366 |
ifeq ($(repo),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 ; |
| 370 |
endif |
| 371 |
endif |
| 372 |
|
| 373 |
## special target to satisfy VxWorks dependencies for images |
| 374 |
$(PRJ_DIR)/$(PRJ_FILE): |
| 375 |
ifeq ($(repo),1) |
| 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'! |
| 384 |
-$(BACKUP_RPO_RULE) |
| 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) |
| 388 |
-chmod a+r $(VLIB) |
| 389 |
ifneq (,$(RANLIB)) |
| 390 |
-$(RANLIB) $(VLIB) |
| 391 |
endif # RANLIB |
| 392 |
endif # VX_SO_BUILD |
| 393 |
endif |
| 394 |
endif |
| 395 |
@echo 1>$@ |
| 396 |
|
| 397 |
endif |