Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / bin / MakeProjectCreator / templates / gnu.mpd
blobf4c97286447d4e256b919cf7061c7470fe24e28b
1 # -*- Makefile -*-
2 #----------------------------------------------------------------------------
3 #       GNU Makefile
5 # @file <%project_file%>
7 # This file was automatically generated by MPC.  Any changes made directly to
8 # this file will be lost the next time it is generated.
10 #----------------------------------------------------------------------------
11 <%marker(top)%>
12 MAKEFILE         = <%project_file%>
13 DEPENDENCY_FILE  = .depend.<%project_name%>
14 <%if(compares(build_dir_per_project, 1))%>
15 VDIR_PRJ = <%project_name%>/
16 <%endif%>
17 <%if(idl_files)%>
19 <%if(contains(idlflags,-DGEN_IDL_MAKE_DEPS))%>
20 <%foreach(idl_files)%>
21 IDL_DEPENDENCY_FILE<%forcount%> = .depend.<%project_name%>_Idl<%forcount%>
22 <%endfor%>
24 IDL_DEPENDENCY_FILES += \
25 <%foreach(idl_files)%>
26         .depend.<%project_name%>_Idl<%forcount%><%fornotlast(" \\")%>
27 <%endfor%>
28 <%endif%>
29 <%endif%>
30 <%if(exename)%>
31 BIN_UNCHECKED    = <%exename%>
32 <%endif%>
34 LIB_PREFIX      ?= lib
35 <%if(need_staticflags)%>
36 static_libs_only ?= 1
37 <%endif%>
38 <%if(staticname)%>
40 ## LIB_CHECKED may be set to empty later on in this file
41 LIB_UNCHECKED    = $(LIB_PREFIX)<%libname_prefix%><%staticname%>.$(LIBEXT)
42 LIB_CHECKED      = $(LIB_UNCHECKED)
43 LIB_NAME         = $(LIB_PREFIX)<%libname_prefix%><%staticname%>
44 <%if(!sharedname)%>
45 static_libs_only = 1
46 <%endif%>
47 <%endif%>
48 <%if(sharedname)%>
50 ## SHLIB may be set to empty later on in this file
51 SHLIB_UNCHECKED  = $(LIB_PREFIX)<%libname_prefix%><%sharedname%>.$(SOEXT)
52 SHLIB            = $(SHLIB_UNCHECKED)
53 <%endif%>
54 <%if(tao)%>
56 TAO_ROOT  ?= $(ACE_ROOT)/TAO
57 <%endif%>
59 <%if(grouped_source_files)%>
60 <%foreach(grouped_source_files)%>
61 <%grouped_source_file%> = \
62 <%foreach(uniq(grouped_source_file->files))%>
63   <%grouped_source_file->file%><%fornotlast(" \\")%>
64 <%endfor%>
66 <%endfor%>
67 FILES += \
68 <%foreach(grouped_source_files)%>
69          $(<%grouped_source_file%>)<%fornotlast(" \\")%>
70 <%endfor%>
72 <%else%>
73 FILES = \
74 <%foreach(uniq(source_files))%>
75   <%source_file%><%fornotlast(" \\")%>
76 <%endfor%>
78 <%endif%>
79 <%if(idl_files)%>
80 <%if(contains(idlflags,-DGEN_IDL_MAKE_DEPS))%>
81 <%foreach(idl_files)%>
82 IDL_DEPS_FLAGS<%forcount%> = <%if(flag_overrides(idl_file, commandflags))%><%flag_overrides(idl_file, commandflags)%><%else%><%idlflags%><%endif%>
83 IDL_DEPS<%forcount%> = <%idl_file%>
85 <%endfor%>
86 <%endif%>
88 <%endif%>
89 <%vpath%>
91 LIBPATHS := <%libpaths%>
93 #----------------------------------------------------------------------------
94 #       Include macros and targets
95 #----------------------------------------------------------------------------
96 <%marker(macros)%>
97 <%if(xerceslib)%>
98 XERCESLIB ?= <%xerceslib%>
99 <%endif%>
100 <%if(exename)%>
101 LDLIBS =<%foreach(libs)%> -l<%libname_prefix%><%lib%><%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%>
102 <%else%>
103 <%if(sharedname)%>
104 ACE_SHLIBS =<%foreach(libs)%> -l<%libname_prefix%><%lib%><%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%>
105 <%endif%>
106 <%endif%>
107 <%if(tao_idl)%>
108 TAO_IDL = <%tao_idl%>
109 <%endif%>
110 <%if(tao_idl_dep)%>
111 TAO_IDL_DEP = <%tao_idl_dep%>$(EXEEXT)
112 <%endif%>
113 <%if(tao_idlflags)%>
114 TAO_IDLFLAGS = <%tao_idlflags%><%if(!compares(vms_old_make, 1))%>$(if $(ARCH), -g $(call ADD_QUOTE,$(call ADD_ARCH,$(ACE_ROOT)/bin/ace_gperf)))<%endif%>
115 <%endif%>
117 <%if(exename)%>
118 PRJ_TYPE = rtp
119 <%else%>
120 PRJ_TYPE = library
121 <%endif%>
123 <%if(exename)%>
124 <%if(install)%>
125 COLLAPSE_SLASHES = $(if $(findstring //,$(1)),$(call COLLAPSE_SLASHES,$(subst //,/,$(1))),$(1))
126 INSBIN ?= <%if(compares(vms_old_make, 1))%><%install%><%else%>$(call COLLAPSE_SLASHES,<%install%>)<%endif%>
127 <%endif%>
128 ifeq ($(INSBIN),.)
129   ifeq ($(CURDIR),)
130     ifeq ($(PWD),)
131       PWD=$(shell pwd)
132     endif
133   else
134     PWD=$(CURDIR)
135   endif
136   INSBIN = $(PWD)<%if(targetoutdir)%>/<%targetoutdir%><%endif%>
137 <%if(targetoutdir)%>
138 else
139   ifneq ($(INSBIN),)
140     INSBIN := $(INSBIN)/<%targetoutdir%>
141   endif
142 <%endif%>
143 endif
144 <%if(install)%>
145 OUTPUT_DIRECTORY = $(if $(ARCH),$(if $(INSBIN),$(INSBIN)/$(ARCH)),$(INSBIN))
146 <%else%>
147 OUTPUT_DIRECTORY = $(if $(ARCH),./$(ARCH))
148 <%endif%>
149 <%else%>
150 <%if(dllout || libout)%>
151 COLLAPSE_SLASHES = $(if $(findstring //,$(1)),$(call COLLAPSE_SLASHES,$(subst //,/,$(1))),$(1))
152 INSLIB ?= <%if(compares(vms_old_make, 1))%><%if(dllout)%><%dllout%><%else%><%libout%><%endif%><%else%>$(call COLLAPSE_SLASHES,<%if(dllout)%><%dllout%><%else%><%libout%><%endif%>)<%endif%>
153 <%endif%>
154 ifeq ($(INSLIB),.)
155   ifeq ($(CURDIR),)
156     ifeq ($(PWD),)
157       PWD=$(shell pwd)
158     endif
159   else
160     PWD=$(CURDIR)
161   endif
162   INSLIB = $(PWD)<%if(targetoutdir)%>/<%targetoutdir%><%endif%>
163 <%if(targetoutdir)%>
164 else
165   INSLIB := $(INSLIB)/<%targetoutdir%>
166 <%endif%>
167 endif
168 OUTPUT_DIRECTORY = $(INSLIB)
169 <%endif%>
171 <%if(targetoutdir)%>
172 VDIR   = <%targetoutdir%>.obj/
173 VSHDIR = <%targetoutdir%>.shobj/
175 <%endif%>
176 include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
178 <%marker(extension)%>
179 <%marker(deferred-extension)%>
181 <%if(version)%>
182 GNUACE_PROJECT_VERSION = <%version%>
183 <%else%>
184 GNUACE_PROJECT_VERSION ?= $(ACE_VERSION)
185 <%endif%>
187 <%if(resource_files)%>
188 ifneq (,$(RC))
189 RESOURCES += \
190 <%foreach(resource_files)%>
191   <%resource_file%><%fornotlast(" \\")%>
192 <%endfor%>
193 <%if(includes)%>
195 RC_INCLUDE_FLAG ?= --include-dir=
196 RCFLAGS = \
197 <%foreach(includes)%>
198         $(RC_INCLUDE_FLAG)<%include%><%fornotlast(" \\")%>
199 <%endfor%>
200 <%endif%>
201 endif
203 <%endif%>
204 ifdef TEMPINCDIR
205 TEMPINCDIR := $(TEMPINCDIR)/<%project_name%>
206 all: $(TEMPINCDIR)
207 endif
209 ifneq ($(OUTPUT_DIRECTORY),)
210 .PHONY: create_output_directory.local
211 all: create_output_directory.local
212 create_output_directory.local:
213         -@$(MKDIR) "$(OUTPUT_DIRECTORY)" $(ACE_NUL_STDERR)
214 endif
216 <%if(sharedname || staticname || exename)%>
217 <%if(libs && libpaths)%>
218 # turn off libcheck if doing a dry run
219 ifeq ($(findstring n, $(MAKEFLAGS)),n)
220   LIBCHECK = 1
221 else
222   # turn off libcheck if keep going was passed too
223   ifeq ($(findstring k, $(MAKEFLAGS)),k)
224     LIBCHECK = 1
225   else
226     ifeq ($(LIBCHECK_PREFIX),)
227       # If the user hasn't specified a place to look for installed libraries, let's set
228       # a reasonable default
229       LIBCHECK_PREFIX = /usr
230     endif
231     LIBCHECK ?= $(filter-out $(foreach lib,<%foreach(libs)%><%libname_prefix%><%lib%><%fornotlast(" ")%><%endfor%>,$(findstring $(lib),$(foreach libpath,<%foreach(libpaths)%><%if(targetoutdir)%><%libpath%>/<%targetoutdir%> <%endif%><%libpath%> $(if $(ARCH),<%libpath%>/$(ARCH)) <%endfor%>$(LIBCHECK_PREFIX)/lib $(LIBCHECK_PREFIX)/lib64 $(LIBCHECK_EXTRA_PATHS) $(INSLIB),$(wildcard $(libpath)/$(LIB_PREFIX)$(lib).* $(libpath)/$(lib).lib)))),<%foreach(libs)%><%libname_prefix%><%lib%><%fornotlast(" ")%><%endfor%>)
232     ifeq ($(LIBCHECK),)
233       LIBCHECK = 1
234     endif
235   endif
236 endif
237 <%else%>
238 LIBCHECK = 1
239 <%endif%>
240 <%else%>
241 LIBCHECK = 1
242 <%endif%>
243 <%if(!exename)%>
244 <%foreach(requires)%>
245 ifeq ($(<%require%>),1)
246 <%endfor%>
247 <%foreach(avoids)%>
248 ifneq ($(<%avoid%>),1)
249 <%endfor%>
250 ifneq ($(LIBCHECK), 1)
251 <%if(staticname)%>
252   LIB_CHECKED   =
253 <%endif%>
254 <%if(sharedname)%>
255   SHLIB =
256 <%endif%>
257   all: lib_warning
258 endif
259 <%foreach(avoids)%>
260 else
261 <%if(staticname)%>
262   LIB_CHECKED   =
263 <%endif%>
264 <%if(sharedname)%>
265   SHLIB =
266 <%endif%>
267   all: avoid_warning
268 endif
269 <%endfor%>
270 <%foreach(requires)%>
271 else
272 <%if(staticname)%>
273   LIB_CHECKED   =
274 <%endif%>
275 <%if(sharedname)%>
276   SHLIB =
277 <%endif%>
278   all: require_warning
279 endif
280 <%endfor%>
282 <%if(tagname)%>
283 ifeq (,$(<%tagname%>))
284 <%endif%>
285 <%foreach(requires)%>
286 ifeq ($(<%require%>),1)
287 <%endfor%>
288 <%foreach(avoids)%>
289 ifneq ($(<%avoid%>),1)
290 <%endfor%>
291 <%foreach(avoids)%>
292 else
293 <%if(staticname)%>
294   LIB_CHECKED   =
295 <%endif%>
296 <%if(sharedname)%>
297   SHLIB =
298 <%endif%>
299   all: avoid_warning
300 endif
301 <%endfor%>
302 <%foreach(requires)%>
303 else
304 <%if(staticname)%>
305   LIB_CHECKED   =
306 <%endif%>
307 <%if(sharedname)%>
308   SHLIB =
309 <%endif%>
310   all: require_warning
311 endif
312 <%endfor%>
313 <%if(tagname)%>
314 else
315 <%foreach(requires)%>
316 ifeq ($(<%require%>),1)
317 <%endfor%>
318 <%foreach(avoids)%>
319 ifneq ($(<%avoid%>),1)
320 <%endfor%>
321 <%foreach(tagchecks)%>
322   ifeq (<%tagcheck%>, $(findstring <%tagcheck%>, $(<%tagname%>)))
323 <%endfor%>
324 <%foreach(tagchecks)%>
325   else
326     LIB_CHECKED   =
327     SHLIB =
328   endif
329 <%endfor%>
330 <%foreach(avoids)%>
331 else
332   LIB_CHECKED   =
333   SHLIB =
334   all: avoid_warning
335 endif
336 <%endfor%>
337 <%foreach(requires)%>
338 else
339   LIB_CHECKED   =
340   SHLIB =
341   all: require_warning
342 endif
343 <%endfor%>
344 endif
345 <%endif%>
346 <%endif%>
347 <%if(exename)%>
348 <%foreach(requires)%>
349 ifeq ($(<%require%>),1)
350 <%endfor%>
351 <%foreach(avoids)%>
352 ifneq ($(<%avoid%>),1)
353 <%endfor%>
354 ifeq ($(LIBCHECK), 1)
355 BIN    = $(BIN_UNCHECKED)$(EXEEXT)
356 ifdef ARCH
357   ARCH_BIN = $(ARCH)/$(BIN)
358 endif #ARCH
359 else
360   all: lib_warning
361 endif
362 <%foreach(avoids)%>
363 else
364   all: avoid_warning
365 endif
366 <%endfor%>
367 <%foreach(requires)%>
368 else
369   all: require_warning
370 endif
371 <%endfor%>
373 # If it contains ../ at all use notdir.
374 OBJS   = $(foreach var, $(addsuffix .$(OBJEXT), $(basename $(FILES)) $(RESOURCES)), $(if $(findstring ../,$(var)),$(notdir $(var)),$(var)))
375 SRC    = $(FILES)
376 <%endif%>
377 <%if(sharedname || staticname)%>
378 LSRC   = $(FILES)
379 <%endif%>
381 <%marker(circuit)%>
382 include $(ACE_ROOT)/include/makeinclude/macros.GNU
383 include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
384 include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
385 <%if(exename)%>
387 ifneq ($(INSBIN),)
388 ifneq ($(INSBIN),.)
389   INSTALL = $(VBIN:%=$(INSBIN)/%)
390   CLEANUP_INSTALL += $(CLEANUP_BIN:%=$(INSBIN)/$(if $(ARCH),$(ARCH)/)%$(VAR)$(EXEEXT))
391 endif
392 endif
394 <%endif%>
395 <%if(sharedname || staticname)%>
396 include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
397 <%endif%>
398 <%if(pch_source)%>
400 ACE_PCH_SOURCE = <%pch_source%>
401 ACE_PCH_FILE   = <%basename(pch_header)%>.gch
403 ifeq ($(pchsupport),1)
404 <%if(pch_defines)%>
405 CPPFLAGS +=<%foreach(pch_defines)%> -D<%pch_define%><%endfor%>
406 <%endif%>
408 $(addprefix $(VDIR), $(OBJS)): $(VDIR)$(ACE_PCH_FILE)
409 $(VSHOBJS): $(VSHDIR)$(ACE_PCH_FILE)
410 endif
412 <%endif%>
413 include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
414 ifeq ($(VXWORKSLINK),1)
415 include $(TGT_DIR)/h/make/rules.$(PRJ_TYPE)
416 endif
418 <%foreach(source_files)%>
419 <%if(flag_overrides(source_file, buildflags))%>
420 $(VDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
421         @$(MKDIR) $(VDIR)<%dirname(source_file)%>
422         <%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%flag_overrides(source_file, buildflags)%> $(ACE_USE_PCH_OPT) $(CC_OUTPUT_FLAG)$(CC_OUTPUT_FLAG_SEP)$@ $<
423         ${MVCMD}
425 ifneq ($(VSHDIR), $(VDIR))
426 $(VSHDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
427         @$(MKDIR) $(VSHDIR)<%dirname(source_file)%>
428         <%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%flag_overrides(source_file, buildflags)%> $(ACE_USE_PCH_OPT) $(PIC) $(CC_OUTPUT_FLAG)$(CC_OUTPUT_FLAG_SEP)$@ $<
429 endif
431 <%else%>
432 <%if(dirname(source_file) && !contains(source_file, \.\./))%>
433 <%if(starts_with(source_file, \$) || !ends_with(source_file, \.cpp))%>
434 $(VDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
435         @$(MKDIR) $(VDIR)<%dirname(source_file)%>
436         <%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%if(flag_overrides(source_file, buildflags))%><%flag_overrides(source_file, buildflags)%> <%endif%>$(ACE_USE_PCH_OPT) $(CC_OUTPUT_FLAG)$(CC_OUTPUT_FLAG_SEP)$@ $<
437         ${MVCMD}
439 ifneq ($(VSHDIR), $(VDIR))
440 $(VSHDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
441         @$(MKDIR) $(VSHDIR)<%dirname(source_file)%>
442         <%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%if(flag_overrides(source_file, buildflags))%><%flag_overrides(source_file, buildflags)%> <%endif%>$(ACE_USE_PCH_OPT) $(PIC) $(CC_OUTPUT_FLAG)$(CC_OUTPUT_FLAG_SEP)$@ $<
443 endif
445 <%endif%>
446 <%endif%>
447 <%endif%>
448 <%endfor%>
449 <%if(libpaths)%>
450 ifeq ($(VXWORKSLINK),1)
451 LDLIBPATH     =<%foreach(libpaths)%> <%if(targetoutdir)%>-L<%libpath%>/<%targetoutdir%> <%endif%>-L<%libpath%><%endfor%><%if(linkflags)%> <%linkflags%><%endif%>
452 else
453 LDFLAGS      +=<%foreach(libpaths)%> <%if(targetoutdir)%>-L<%libpath%>/<%targetoutdir%> <%endif%>-L<%libpath%> $(if $(ARCH),-L<%libpath%>/$(ARCH))<%endfor%><%if(linkflags)%> <%linkflags%><%endif%>
454 endif
455 <%endif%>
456 <%if(includes)%>
457 CPPFLAGS     +=<%foreach(includes)%> -I<%include%><%endfor%>
458 <%endif%>
459 <%if(macros)%>
460 CPPFLAGS     +=<%foreach(macros)%> -D<%macro%><%endfor%>
461 <%endif%>
462 <%if(compile_flags)%>
463 CPPFLAGS     += <%compile_flags%>
464 <%endif%>
465 <%if(dynamicflags)%>
466 ifeq ($(shared_libs),1)
467   ifneq ($(SHLIB),)
468     CPPFLAGS +=<%foreach(dynamicflags)%> -D<%dynamicflag%><%endfor%>
469   endif
470 endif
471 <%endif%>
472 <%if(staticflags || exename)%>
473 ifeq ($(static_libs),1)
474 <%if(staticflags)%>
475   CPPFLAGS +=<%foreach(staticflags)%> -D<%staticflag%><%endfor%>
476 <%endif%>
477 <%if(exename)%>
478   ifeq ($(link_groups), 1)
479     LDLIBS := -Wl,--start-group $(LDLIBS) -Wl,--end-group
480   endif
481 <%endif%>
482 endif
483 <%endif%>
485 #----------------------------------------------------------------------------
486 #       Local targets
487 #----------------------------------------------------------------------------
488 <%marker(local)%>
489 .PHONY: lib_warning
490 lib_warning:
491         @echo <%project_name%> will not be built due to the following missing library: $(LIBCHECK) >&2
493 <%if(requires)%>
494 <%foreach(requires)%>
495 ifneq ($(<%require%>),1)
496 requires_disabled_macros += <%require%>
497 endif
498 <%endfor%>
499 .PHONY: require_warning
500 require_warning:
501         @echo <%project_name%> will not be built due to the following disabled make macros: $(requires_disabled_macros)>&2
503 <%endif%>
504 <%if(avoids)%>
505 <%foreach(avoids)%>
506 ifeq ($(<%avoid%>),1)
507 avoids_enabled_macros += <%avoid%>
508 endif
509 <%endfor%>
510 .PHONY: avoid_warning
511 avoid_warning:
512         @echo <%project_name%> will not be built due to the following enabled make macros: $(avoids_enabled_macros)>&2
514 <%endif%>
515 <%if(custom_types)%>
516 ## Some OS's have /bin/test others only have /usr/bin/test
517 ifeq ($(wildcard /bin/test), /bin/test)
518   TEST_EXE = /bin/test
519 else
520 ifeq ($(wildcard /usr/bin/test), /usr/bin/test)
521   TEST_EXE = /usr/bin/test
522 endif
523 endif
525 SPACE = $(should_be_unset) $(should_be_unset)
526 <%foreach(custom_types)%>
527 <%if(custom_type->libpath)%>
528 export DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):<%custom_type->libpath%>$(if $(ARCH),:<%custom_type->libpath%>/$(ARCH))
529 export LD_LIBRARY_PATH   := $(LD_LIBRARY_PATH):<%custom_type->libpath%>$(if $(ARCH),:<%custom_type->libpath%>/$(ARCH))
530 export SHLIB_PATH        := $(SHLIB_PATH):<%custom_type->libpath%>$(if $(ARCH),:<%custom_type->libpath%>/$(ARCH))
531 export LIBPATH           := $(LIBPATH):<%custom_type->libpath%>$(if $(ARCH),:<%custom_type->libpath%>/$(ARCH))
532 export PATH              := $(PATH):<%custom_type->libpath%>$(if $(ARCH),:<%custom_type->libpath%>/$(ARCH))
534 <%endif%>
535 <%foreach(custom_type->input_files)%>
536 <%if(custom_type->input_file->output_files)%>
537 GENERATED_DIRTY +=<%foreach(custom_type->input_file->output_files)%> <%custom_type->input_file->output_file%><%endfor%>
538 <%if(precious_files)%>
539 PRECIOUS_FILES +=<%foreach(precious_files)%><%foreach(custom_type->input_file->output_files)%><%if(contains(custom_type->input_file->output_file, precious_file))%> <%custom_type->input_file->output_file%><%endif%><%endfor%><%endfor%>
540 <%endif%>
541 <%if(custom_type->input_file->non_source_output_files)%>
542 OBJS_DEPEND_ON_GENERATED = 1
543 <%endif%>
544 <%foreach(custom_type->input_file->output_files)%>
545 <%if(forlast && !forfirst)%>
546 ## More than one file is generated by the command and therefore
547 ## it can not be run in parallel.  Unfortunately, there is no way to
548 ## say that only this rule can't be run in parallel.  However, we can
549 ## determine if the generated files have already been generated.  If that's
550 ## the case, then we don't need this special rule.
551 ifeq ($(wildcard $(GENERATED_DIRTY)), $(GENERATED_DIRTY))
552   ## If we can find /bin/test, then we will continue
553   ifneq ($(TEST_EXE),)
554     ## If all of the generated files are there, then we need to check
555     ## and make sure that the generated files are up-to-date.  If they are not
556     ## then we need the special rule.
557     ifeq ($(shell<%foreach(custom_type->input_file->output_files)%> $(TEST_EXE) "<%custom_type->input_file%>" -nt "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%>" 2> /dev/null ||<%endfor%> echo 0),)
558       .NOTPARALLEL:
559 <%if(flag_overrides(custom_type->input_file, dependent) || custom_type->dependent || flag_overrides(custom_type->input_file, dependent_libs) || custom_type->dependent_libs)%>
560     else
561       ## By this point, all of the generated files are here and up-to-date
562       ## with respect to the source file.  Now we need to make sure that
563       ## they are up-to-date with respect to the generation tool.  If the tool
564       ## is newer than the generated files, then we need the special rule.
565       ifeq ($(shell<%if(flag_overrides(custom_type->input_file, dependent))%><%foreach(dep, flag_overrides(custom_type->input_file, dependent))%><%foreach(custom_type->input_file->output_files)%> $(TEST_EXE) "<%if(compares(vms_old_make, 1))%><%dep%><%else%>$(call ADD_ARCH,<%dep%>)<%endif%>" -nt "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%>" 2> /dev/null ||<%endfor%><%endfor%><%else%><%if(custom_type->dependent)%><%foreach(custom_type->dependent)%><%foreach(custom_type->input_file->output_files)%> $(TEST_EXE) "<%if(compares(vms_old_make, 1))%><%custom_type->dependent%><%else%>$(call ADD_ARCH,<%custom_type->dependent%>)<%endif%>" -nt "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%>" 2> /dev/null ||<%endfor%><%endfor%><%endif%><%endif%><%if(flag_overrides(custom_type->input_file, dependent_libs))%><%foreach(dep_lib, flag_overrides(custom_type->input_file, dependent_libs))%><%foreach(custom_type->input_file->output_files)%> $(TEST_EXE) "<%if(compares(vms_old_make, 1))%><%dirname(dep_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(dep_lib)%>.$(SOEXT)<%else%>$(call ADD_ARCH,<%dirname(dep_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(dep_lib)%>.$(SOEXT))<%endif%>" -nt "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%>" 2> /dev/null ||<%endfor%><%endfor%><%else%><%if(custom_type->dependent_libs)%><%foreach(custom_type->dependent_libs)%><%foreach(custom_type->input_file->output_files)%> $(TEST_EXE) "<%if(compares(vms_old_make, 1))%><%dirname(custom_type->dependent_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(custom_type->dependent_lib)%>.$(SOEXT)<%else%>$(call ADD_ARCH,<%dirname(custom_type->dependent_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(custom_type->dependent_lib)%>.$(SOEXT))<%endif%>" -nt "<%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%>" 2> /dev/null ||<%endfor%><%endfor%><%endif%><%endif%> echo 0),)
566         .NOTPARALLEL:
567       endif
568 <%endif%>
569     endif
570   else
571     .NOTPARALLEL:
572   endif
573 else
574 .NOTPARALLEL:
575 endif
576 <%endif%>
577 <%endfor%>
578 <%foreach(custom_type->input_file->output_files)%><%custom_type->input_file->output_file%><%fornotlast(" ")%><%endfor%>: <%custom_type->input_file%><%if(custom_type->input_file->dependencies)%><%foreach(custom_type->input_file->dependencies)%> <%if(contains(custom_type->input_file->dependencie, [\s\$]))%>$(subst $(SPACE),\$(SPACE),<%custom_type->input_file->dependencie%>)<%else%><%custom_type->input_file->dependencie%><%endif%><%endfor%><%endif%><%if(flag_overrides(custom_type->input_file, dependent))%><%foreach(dep, flag_overrides(custom_type->input_file, dependent))%> <%if(contains(dep, [\s\$]))%>$(subst $(SPACE),\$(SPACE),<%if(compares(vms_old_make, 1))%><%dep%><%else%>$(call ADD_ARCH,<%dep%>)<%endif%>)<%else%><%if(compares(vms_old_make, 1))%><%dep%><%else%>$(call ADD_ARCH,<%dep%>)<%endif%><%endif%><%endfor%><%else%><%if(custom_type->dependent)%><%foreach(custom_type->dependent)%> <%if(contains(custom_type->dependent, [\s\$]))%>$(subst $(SPACE),\$(SPACE),<%if(compares(vms_old_make, 1))%><%custom_type->dependent%><%else%>$(call ADD_ARCH,<%custom_type->dependent%>)<%endif%>)<%else%><%if(compares(vms_old_make, 1))%><%custom_type->dependent%><%else%>$(call ADD_ARCH,<%custom_type->dependent%>)<%endif%><%endif%><%endfor%><%endif%><%endif%>
579 <%if(flag_overrides(custom_type->input_file, gendir))%>
580 <%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%>
581         $(MKDIR) <%flag_overrides(custom_type->input_file, gendir)%>
582 <%endif%>
583 <%endif%>
584         <%if(compares(vms_old_make, 1))%><%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%><%else%>$(if $(findstring ",<%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%>),<%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%>,$(call ADD_QUOTE,$(call ADD_ARCH,<%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%>)))<%endif%> <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> <%if(custom_type->output_option)%><%custom_type->input_file%> <%custom_type->output_option%> $@<%else%><%custom_type->input_file%><%endif%>
585 <%if(flag_overrides(custom_type->input_file, postcommand))%>
586 <%foreach(custom_type->input_file)%>
587         <%flag_overrides(custom_type->input_file, postcommand)%>
588 <%endfor%>
589 <%else%>
590 <%if(custom_type->postcommand)%>
591 <%foreach(custom_type->input_file)%>
592         <%custom_type->postcommand%>
593 <%endfor%>
594 <%endif%>
595 <%endif%>
596 <%if(pch_header)%>
597 <%if(custom_type->pch_postrule)%>
598 <%foreach(custom_type->input_file->source_output_files)%>
599         @echo '#include "<%pch_header%>"' > temp.$$$$ && cat <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%> >> temp.$$$$ && mv temp.$$$$ <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>
600 <%endfor%>
601 <%endif%>
602 <%endif%>
604 <%if(flag_overrides(custom_type->input_file, dependent_libs) || custom_type->dependent_libs)%>
605 ifneq ($(static_libs_only),1)
606 ifneq ($(CROSS-COMPILE),1)
607 <%foreach(custom_type->input_file->output_files)%><%if(flag_overrides(custom_type->input_file, gendir))%><%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%><%flag_overrides(custom_type->input_file, gendir)%>/<%endif%><%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%fornotlast(" ")%><%endfor%>:<%if(flag_overrides(custom_type->input_file, dependent_libs))%><%foreach(dep_lib, flag_overrides(custom_type->input_file, dependent_libs))%> <%if(contains(dep_lib, [\s\$]))%>$(subst $(SPACE),\$(SPACE),<%if(compares(vms_old_make, 1))%><%dirname(dep_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(dep_lib)%>.$(SOEXT)<%else%>$(call ADD_ARCH,<%dirname(dep_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(dep_lib)%>.$(SOEXT))<%endif%>)<%else%><%if(compares(vms_old_make, 1))%><%dirname(dep_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(dep_lib)%>.$(SOEXT)<%else%>$(call ADD_ARCH,<%dirname(dep_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(dep_lib)%>.$(SOEXT))<%endif%><%endif%><%endfor%><%else%><%if(custom_type->dependent_libs)%><%foreach(custom_type->dependent_libs)%> <%if(contains(custom_type->dependent_lib, [\s\$]))%>$(subst $(SPACE),\$(SPACE),<%if(compares(vms_old_make, 1))%><%dirname(custom_type->dependent_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(custom_type->dependent_lib)%>.$(SOEXT)<%else%>$(call ADD_ARCH,<%dirname(custom_type->dependent_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(custom_type->dependent_lib)%>.$(SOEXT))<%endif%>)<%else%><%if(compares(vms_old_make, 1))%><%dirname(custom_type->dependent_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(custom_type->dependent_lib)%>.$(SOEXT)<%else%>$(call ADD_ARCH,<%dirname(custom_type->dependent_lib)%>/$(LIB_PREFIX)<%libname_prefix%><%basename(custom_type->dependent_lib)%>.$(SOEXT))<%endif%><%endif%><%endfor%><%endif%><%endif%>
608 endif
609 endif
610 <%endif%>
612 <%endif%>
613 <%endfor%>
614 <%endfor%>
615 ifneq ($(GENERATED_DIRTY),)
616 .PRECIOUS: $(GENERATED_DIRTY)
617 <%if(source_files)%>
618 ## If the generated files are anything but source files, we need to
619 ## ensure that those files are generated before we attempt to build anything
620 ## else.
621 ifeq ($(OBJS_DEPEND_ON_GENERATED),1)
622 $(VDIR)$(ACE_PCH_FILE) $(addprefix $(VDIR), $(OBJS)): $(GENERATED_DIRTY)
623 $(VSHDIR)$(ACE_PCH_FILE) $(VSHOBJS): $(GENERATED_DIRTY)
624 endif
625 <%else%>
626 <%foreach(requires)%>
627 ifeq ($(<%require%>),1)
628 <%endfor%>
629 <%foreach(avoids)%>
630 ifneq ($(<%avoid%>),1)
631 <%endfor%>
632 all: $(GENERATED_DIRTY)
633 <%foreach(avoids)%>
634 endif
635 <%endfor%>
636 <%foreach(requires)%>
637 endif
638 <%endfor%>
639 <%endif%>
640 endif
642 <%endif%>
643 <%if(idl_files)%>
644 ADDITIONAL_IDL_TARGETS += $(GENERATED_DIRTY)
645 idl_stubs: $(ADDITIONAL_IDL_TARGETS)
646 <%if(source_files)%>
648 # This assignment forces make to run the idl_stubs
649 # target before building any of the source files.
650 FORCED_IDL_STUBS = <%source_files%>  <%if(pch_source)%>$(ACE_PCH_SOURCE)<%endif%>
651 <%foreach(custom_types)%>
652 <%foreach(custom_type->input_files)%>
653 <%if(custom_type->input_file->source_output_files)%>
654 <%foreach(custom_type->input_file->source_output_files)%>
655 FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:<%if(flag_overrides(custom_type->input_file, gendir))%><%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%><%flag_overrides(custom_type->input_file, gendir)%>/<%endif%><%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>=)
656 <%endfor%>
657 <%endif%>
658 <%endfor%>
659 <%endfor%>
661 ifneq ($(FORCED_IDL_STUBS),)
662 $(FORCED_IDL_STUBS): idl_stubs
663 endif
664 <%endif%>
665 <%endif%>
666 <%if(exename)%>
668 ifneq ($(VXWORKSLINK),1)
669 <%if(libs && libpaths)%>
670 ifeq ($(static_libs_only), 1)
671   ifeq ($(use_dep_libs), 1)
672     DEPLIBS = $(foreach lib,<%foreach(libs)%> <%libname_prefix%><%lib%><%endfor%> <%lit_libs%>, $(foreach libpath,<%foreach(libpaths)%><%if(targetoutdir)%> <%libpath%>/<%targetoutdir%><%endif%> <%libpath%><%endfor%>, $(wildcard $(libpath)/$(LIB_PREFIX)$(lib).$(LIBEXT))))
673   endif
674 endif
676 <%endif%>
677 $(VBIN): $(addprefix $(VDIR), $(OBJS)) $(DEPLIBS)
678   ifneq (,$(LINK.cc.override))
679         $(LINK.cc.override)
680   else
681         $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $(filter-out %.a,$^) $(VLDLIBS) $(POSTLINK)
682   endif
683 endif
684 <%endif%>
686 <%if(idl_files)%>
687 <%if(contains(idlflags,-DGEN_IDL_MAKE_DEPS))%>
688 incremental_depend_idl::
689 <%foreach(idl_files)%>
690         @$(RM) $(IDL_DEPENDENCY_FILE<%forcount%>)_idl.old
691         @cp $(IDL_DEPENDENCY_FILE<%forcount%>) $(IDL_DEPENDENCY_FILE<%forcount%>)_idl.old
692         $(DEPGEN_ENV) $(DEPGEN) -A $(DEPEND_CMD_ARGS) -f $(IDL_DEPENDENCY_FILE<%forcount%>) \
693         $(IDL_DEPS_FLAGS<%forcount%>) -t gnuidl -DMAKEDEPEND $(IDL_DEPS<%forcount%>)
694         @if cmp -s $(IDL_DEPENDENCY_FILE<%forcount%>) $(IDL_DEPENDENCY_FILE<%forcount%>)_idl.old ;\
695         then echo "GNUmakefile idl dependencies unchanged for $(IDL_DEPS<%forcount%>)." ;\
696         else \
697                 echo "GNUmakefile idl dependencies updated for $(IDL_DEPS<%forcount%>)." ;\
698         fi ;\
699         $(RM) $(IDL_DEPENDENCY_FILE<%forcount%>)_idl.old ;
700 <%endfor%>
701 <%endif%>
702 <%endif%>
704 realclean: clean
705 ifneq ($(GENERATED_DIRTY),)
706         -$(RM) -r $(filter-out $(PRECIOUS_FILES),$(GENERATED_DIRTY))
707 endif
708 <%if(postclean)%>
709         -<%eval(postclean)%>
710 <%endif%>
712 __prebuild__:
713 <%foreach(requires)%>
714 ifeq ($(<%require%>),1)
715 <%endfor%>
716 <%foreach(avoids)%>
717 ifneq ($(<%avoid%>),1)
718 <%endfor%>
719 <%if(prebuild)%>
720         @<%eval(prebuild)%>
721 <%else%>
722         @-:
723 <%endif%>
724 <%foreach(avoids requires)%>
725 endif
726 <%endfor%>
728 <%if(postbuild)%>
729 all: __postbuild__
731 .PHONY: __postbuild__
732 <%if(exename)%>
733 __postbuild__: $(VBIN) $(INSTALL)
734 <%else%>
735 <%if(sharedname || staticname)%>
736 __postbuild__: $(VLIBS) $(INSTALL)
737 <%else%>
738 <%foreach(requires)%>
739 ifeq ($(<%require%>),1)
740 <%endfor%>
741 <%foreach(avoids)%>
742 ifneq ($(<%avoid%>),1)
743 <%endfor%>
744 __postbuild__: $(GENERATED_DIRTY)
745 <%foreach(avoids requires)%>
746 endif
747 <%endfor%>
748 <%endif%>
749 <%endif%>
751 __postbuild__:
752 <%foreach(requires)%>
753 ifeq ($(<%require%>),1)
754 <%endfor%>
755 <%foreach(avoids)%>
756 ifneq ($(<%avoid%>),1)
757 <%endfor%>
758         @<%eval(postbuild)%>
759 <%foreach(avoids requires)%>
760 endif
761 <%endfor%>
763 <%endif%>
765 .PHONY: install
766 install: <%if(postbuild)%>__postbuild__<%else%>all<%endif%>
767 INSTALL_LIB ?= lib
768 ifneq ($(INSTALL_PREFIX),)
769 ifneq ($(install_rpath),0)
770 LD_RPATH ?= -Wl,-rpath,
771 LDFLAGS += $(LD_RPATH)$(INSTALL_PREFIX)/$(INSTALL_LIB) $(LD_RPATH_FLAGS)
772 endif
773 endif
775 <%if(install_this_target)%>
776 PRJINST_OPTIONS ?=
777 INST_DIR ?= <%if(install_dir)%>/<%install_dir%><%else%>/$(notdir $(PWD))<%endif%>
778 COMMA = ,
779 SPACE = $(should_be_unset) $(should_be_unset)
780 INSTALLER ?= $(MPC_ROOT)/prj_install.pl
781 CUSTOM_INST_TAGS = $(sort <%custom_install%> <%foreach(custom_types)%><%foreach(custom_type->input_files)%><%if(custom_type->input_file->output_files)%><%custom_type%> <%endif%><%endfor%><%endfor%>)
783 <%if(staticname || sharedname)%>
784 <%if(install_headers)%>
785 LIB_INST_TAGS = header_files template_files inline_files$(if $(CUSTOM_INST_TAGS), $(CUSTOM_INST_TAGS))
786 LIB_INST_LOCATIONS = $(foreach tag,$(LIB_INST_TAGS),-b $(tag)=include$(INST_DIR))
788 <%else%>
789 ifeq ($(shared_libs),1)
790 <%endif%>
791 INST_TAGS = lib_output$(if $(LIB_INST_TAGS), $(LIB_INST_TAGS))
792 INST_LOCATIONS = $(LIB_INST_LOCATIONS) -o lib_output=$(INSTALL_LIB)
793 <%if(!install_headers)%>
794 endif
795 <%endif%>
797 <%else%>
798 <%if(exename)%>
799 INST_TAGS = exe_output
800 INST_LOCATIONS = -o exe_output=bin
802 <%else%>
803 INST_TAGS = $(CUSTOM_INST_TAGS)<%if(custom_inst_tags)%> <%custom_inst_tags%><%endif%>
804 INST_LOCATIONS = $(foreach tag,$(INST_TAGS),-b $(tag)=include$(INST_DIR))
806 <%endif%>
807 <%endif%>
808 DATA_INST_TAGS = <%foreach(custom_types)%><%if(compares(custom_type, installdata_files))%><%if(custom_type->input_files)%>installdata_files<%endif%><%endif%><%endfor%>
809 INST_LOCATIONS += $(if $(DATA_INST_TAGS),-x installdata_files -b installdata_files=share$(INST_DIR))
810 INST_TAGS := $(INST_TAGS)$(if $(DATA_INST_TAGS), $(DATA_INST_TAGS))
812 ifeq ($(INSTALLER),/prj_install.pl)
813 INSTALLER = $(ACE_ROOT)/MPC/prj_install.pl
814 endif
816 ifeq ($(LIBCHECK),1)
817 <%foreach(requires)%>
818 ifeq ($(<%require%>),1)
819 <%endfor%>
820 <%foreach(avoids)%>
821 ifneq ($(<%avoid%>),1)
822 <%endfor%>
823 install:
824 ifeq ($(INST_TAGS),)
825         @echo Nothing to install.
826 else
827 ifeq ($(INSTALL_PREFIX),)
828         @echo The variable INSTALL_PREFIX must be set to install.
829         @echo If binaries are already built and you want to use RPATH,
830         @echo they must be rebuilt after changing INSTALL_PREFIX.
831         @false
832 else
833         perl -ne'if (/^#END MPC-Generated Install Info/) {exit 0}' \
834           -e'elsif (/^#BEGIN MPC-Generated Install Info/) {$$ok=1}' \
835           -e'elsif ($$ok && s/^#//) {print}' $(MAKEFILE) | \
836         $(INSTALLER) -i -s $(subst $(SPACE),$(COMMA),$(INST_TAGS)) \
837           $(INST_LOCATIONS) $(if $(ARCH),-d $(ARCH)) $(PRJINST_OPTIONS) \
838           $(DESTDIR)$(INSTALL_PREFIX)
839 <%foreach(custom_types)%>
840 <%if(compares(custom_type, pkgconfig_files))%>
841 <%if(custom_type->input_files)%>
842         $(ACE_ROOT)/bin/ace_install_pkgconfig.pl <%custom_type->input_files%> --destdir "$(DESTDIR)" --prefix $(INSTALL_PREFIX) --libdir $(INSTALL_LIB) --libs "$(LIBS)" --version $(GNUACE_PROJECT_VERSION)<%foreach(pkgconfig_variables)%> --custom "<%pkgconfig_variable%>"<%endfor%>
843 <%endif%>
844 <%endif%>
845 <%endfor%>
846 <%marker(postinstall)%>
847 endif
848 endif
849 <%foreach(requires avoids)%>
850 endif
851 <%endfor%>
852 endif
854 #BEGIN MPC-Generated Install Info
855 <%genins%>
856 #END MPC-Generated Install Info
857 <%endif%>
859 <%marker(bottom)%>