ACE+TAO-7_0_8
[ACE_TAO.git] / ACE / bin / MakeProjectCreator / templates / gnu.mpd
blobee3a32011b32753eac14a48763ac63bf13b01bfd
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 # To build multiple targets in the same directory on AIX, it works
205 # best to have a template directory per project.
206 # The compiler/linker isn't too smart about instantiating templates...
207 ifdef TEMPINCDIR
208 TEMPINCDIR := $(TEMPINCDIR)/<%project_name%>
209 all: $(TEMPINCDIR)
210 endif
212 ifneq ($(OUTPUT_DIRECTORY),)
213 .PHONY: create_output_directory.local
214 all: create_output_directory.local
215 create_output_directory.local:
216         -@$(MKDIR) "$(OUTPUT_DIRECTORY)" $(ACE_NUL_STDERR)
217 endif
219 <%if(sharedname || staticname || exename)%>
220 <%if(libs && libpaths)%>
221 # turn off libcheck if doing a dry run
222 ifeq ($(findstring n, $(MAKEFLAGS)),n)
223   LIBCHECK = 1
224 else
225   # turn off libcheck if keep going was passed too
226   ifeq ($(findstring k, $(MAKEFLAGS)),k)
227     LIBCHECK = 1
228   else
229     ifeq ($(LIBCHECK_PREFIX),)
230       # If the user hasn't specified a place to look for installed libraries, let's set
231       # a reasonable default
232       LIBCHECK_PREFIX = /usr
233     endif
234     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%>)
235     ifeq ($(LIBCHECK),)
236       LIBCHECK = 1
237     endif
238   endif
239 endif
240 <%else%>
241 LIBCHECK = 1
242 <%endif%>
243 <%else%>
244 LIBCHECK = 1
245 <%endif%>
246 <%if(!exename)%>
247 <%foreach(requires)%>
248 ifeq ($(<%require%>),1)
249 <%endfor%>
250 <%foreach(avoids)%>
251 ifneq ($(<%avoid%>),1)
252 <%endfor%>
253 ifneq ($(LIBCHECK), 1)
254 <%if(staticname)%>
255   LIB_CHECKED   =
256 <%endif%>
257 <%if(sharedname)%>
258   SHLIB =
259 <%endif%>
260   all: lib_warning
261 endif
262 <%foreach(avoids)%>
263 else
264 <%if(staticname)%>
265   LIB_CHECKED   =
266 <%endif%>
267 <%if(sharedname)%>
268   SHLIB =
269 <%endif%>
270   all: avoid_warning
271 endif
272 <%endfor%>
273 <%foreach(requires)%>
274 else
275 <%if(staticname)%>
276   LIB_CHECKED   =
277 <%endif%>
278 <%if(sharedname)%>
279   SHLIB =
280 <%endif%>
281   all: require_warning
282 endif
283 <%endfor%>
285 <%if(tagname)%>
286 ifeq (,$(<%tagname%>))
287 <%endif%>
288 <%foreach(requires)%>
289 ifeq ($(<%require%>),1)
290 <%endfor%>
291 <%foreach(avoids)%>
292 ifneq ($(<%avoid%>),1)
293 <%endfor%>
294 <%foreach(avoids)%>
295 else
296 <%if(staticname)%>
297   LIB_CHECKED   =
298 <%endif%>
299 <%if(sharedname)%>
300   SHLIB =
301 <%endif%>
302   all: avoid_warning
303 endif
304 <%endfor%>
305 <%foreach(requires)%>
306 else
307 <%if(staticname)%>
308   LIB_CHECKED   =
309 <%endif%>
310 <%if(sharedname)%>
311   SHLIB =
312 <%endif%>
313   all: require_warning
314 endif
315 <%endfor%>
316 <%if(tagname)%>
317 else
318 <%foreach(requires)%>
319 ifeq ($(<%require%>),1)
320 <%endfor%>
321 <%foreach(avoids)%>
322 ifneq ($(<%avoid%>),1)
323 <%endfor%>
324 <%foreach(tagchecks)%>
325   ifeq (<%tagcheck%>, $(findstring <%tagcheck%>, $(<%tagname%>)))
326 <%endfor%>
327 <%foreach(tagchecks)%>
328   else
329     LIB_CHECKED   =
330     SHLIB =
331   endif
332 <%endfor%>
333 <%foreach(avoids)%>
334 else
335   LIB_CHECKED   =
336   SHLIB =
337   all: avoid_warning
338 endif
339 <%endfor%>
340 <%foreach(requires)%>
341 else
342   LIB_CHECKED   =
343   SHLIB =
344   all: require_warning
345 endif
346 <%endfor%>
347 endif
348 <%endif%>
349 <%endif%>
350 <%if(exename)%>
351 <%foreach(requires)%>
352 ifeq ($(<%require%>),1)
353 <%endfor%>
354 <%foreach(avoids)%>
355 ifneq ($(<%avoid%>),1)
356 <%endfor%>
357 ifeq ($(LIBCHECK), 1)
358 BIN    = $(BIN_UNCHECKED)$(EXEEXT)
359 ifdef ARCH
360   ARCH_BIN = $(ARCH)/$(BIN)
361 endif #ARCH
362 else
363   all: lib_warning
364 endif
365 <%foreach(avoids)%>
366 else
367   all: avoid_warning
368 endif
369 <%endfor%>
370 <%foreach(requires)%>
371 else
372   all: require_warning
373 endif
374 <%endfor%>
376 # If it contains ../ at all use notdir.
377 OBJS   = $(foreach var, $(addsuffix .$(OBJEXT), $(basename $(FILES)) $(RESOURCES)), $(if $(findstring ../,$(var)),$(notdir $(var)),$(var)))
378 SRC    = $(FILES)
379 <%endif%>
380 <%if(sharedname || staticname)%>
381 LSRC   = $(FILES)
382 <%endif%>
384 <%marker(circuit)%>
385 include $(ACE_ROOT)/include/makeinclude/macros.GNU
386 include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
387 include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
388 <%if(exename)%>
390 ifneq ($(INSBIN),)
391 ifneq ($(INSBIN),.)
392   INSTALL = $(VBIN:%=$(INSBIN)/%)
393   CLEANUP_INSTALL += $(CLEANUP_BIN:%=$(INSBIN)/$(if $(ARCH),$(ARCH)/)%$(VAR)$(EXEEXT))
394 endif
395 endif
397 <%endif%>
398 <%if(sharedname || staticname)%>
399 include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
400 <%endif%>
401 <%if(pch_source)%>
403 ACE_PCH_SOURCE = <%pch_source%>
404 ACE_PCH_FILE   = <%basename(pch_header)%>.gch
406 ifeq ($(pchsupport),1)
407 <%if(pch_defines)%>
408 CPPFLAGS +=<%foreach(pch_defines)%> -D<%pch_define%><%endfor%>
409 <%endif%>
411 $(addprefix $(VDIR), $(OBJS)): $(VDIR)$(ACE_PCH_FILE)
412 $(VSHOBJS): $(VSHDIR)$(ACE_PCH_FILE)
413 endif
415 <%endif%>
416 include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
417 ifeq ($(VXWORKSLINK),1)
418 include $(TGT_DIR)/h/make/rules.$(PRJ_TYPE)
419 endif
421 <%foreach(source_files)%>
422 <%if(flag_overrides(source_file, buildflags))%>
423 $(VDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
424         @$(MKDIR) $(VDIR)<%dirname(source_file)%>
425         <%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)$@ $<
426         ${MVCMD}
428 ifneq ($(VSHDIR), $(VDIR))
429 $(VSHDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
430         @$(MKDIR) $(VSHDIR)<%dirname(source_file)%>
431         <%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)$@ $<
432 endif
434 <%else%>
435 <%if(dirname(source_file) && !contains(source_file, \.\./))%>
436 <%if(starts_with(source_file, \$) || !ends_with(source_file, \.cpp))%>
437 $(VDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
438         @$(MKDIR) $(VDIR)<%dirname(source_file)%>
439         <%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)$@ $<
440         ${MVCMD}
442 ifneq ($(VSHDIR), $(VDIR))
443 $(VSHDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%>
444         @$(MKDIR) $(VSHDIR)<%dirname(source_file)%>
445         <%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)$@ $<
446 endif
448 <%endif%>
449 <%endif%>
450 <%endif%>
451 <%endfor%>
452 <%if(libpaths)%>
453 ifeq ($(VXWORKSLINK),1)
454 LDLIBPATH     =<%foreach(libpaths)%> <%if(targetoutdir)%>-L<%libpath%>/<%targetoutdir%> <%endif%>-L<%libpath%><%endfor%><%if(linkflags)%> <%linkflags%><%endif%>
455 else
456 LDFLAGS      +=<%foreach(libpaths)%> <%if(targetoutdir)%>-L<%libpath%>/<%targetoutdir%> <%endif%>-L<%libpath%> $(if $(ARCH),-L<%libpath%>/$(ARCH))<%endfor%><%if(linkflags)%> <%linkflags%><%endif%>
457 endif
458 <%endif%>
459 <%if(includes)%>
460 CPPFLAGS     +=<%foreach(includes)%> -I<%include%><%endfor%>
461 <%endif%>
462 <%if(macros)%>
463 CPPFLAGS     +=<%foreach(macros)%> -D<%macro%><%endfor%>
464 <%endif%>
465 <%if(compile_flags)%>
466 CPPFLAGS     += <%compile_flags%>
467 <%endif%>
468 <%if(dynamicflags)%>
469 ifeq ($(shared_libs),1)
470   ifneq ($(SHLIB),)
471     CPPFLAGS +=<%foreach(dynamicflags)%> -D<%dynamicflag%><%endfor%>
472   endif
473 endif
474 <%endif%>
475 <%if(staticflags || exename)%>
476 ifeq ($(static_libs),1)
477 <%if(staticflags)%>
478   CPPFLAGS +=<%foreach(staticflags)%> -D<%staticflag%><%endfor%>
479 <%endif%>
480 <%if(exename)%>
481   ifeq ($(link_groups), 1)
482     LDLIBS := -Wl,--start-group $(LDLIBS) -Wl,--end-group
483   endif
484 <%endif%>
485 endif
486 <%endif%>
488 #----------------------------------------------------------------------------
489 #       Local targets
490 #----------------------------------------------------------------------------
491 <%marker(local)%>
492 .PHONY: lib_warning
493 lib_warning:
494         @echo <%project_name%> will not be built due to the following missing library: $(LIBCHECK) >&2
496 <%if(requires)%>
497 <%foreach(requires)%>
498 ifneq ($(<%require%>),1)
499 requires_disabled_macros += <%require%>
500 endif
501 <%endfor%>
502 .PHONY: require_warning
503 require_warning:
504         @echo <%project_name%> will not be built due to the following disabled make macros: $(requires_disabled_macros)>&2
506 <%endif%>
507 <%if(avoids)%>
508 <%foreach(avoids)%>
509 ifeq ($(<%avoid%>),1)
510 avoids_enabled_macros += <%avoid%>
511 endif
512 <%endfor%>
513 .PHONY: avoid_warning
514 avoid_warning:
515         @echo <%project_name%> will not be built due to the following enabled make macros: $(avoids_enabled_macros)>&2
517 <%endif%>
518 <%if(custom_types)%>
519 ## Some OS's have /bin/test others only have /usr/bin/test
520 ifeq ($(wildcard /bin/test), /bin/test)
521   TEST_EXE = /bin/test
522 else
523 ifeq ($(wildcard /usr/bin/test), /usr/bin/test)
524   TEST_EXE = /usr/bin/test
525 endif
526 endif
528 SPACE = $(should_be_unset) $(should_be_unset)
529 <%foreach(custom_types)%>
530 <%if(custom_type->libpath)%>
531 export DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):<%custom_type->libpath%>$(if $(ARCH),:<%custom_type->libpath%>/$(ARCH))
532 export LD_LIBRARY_PATH   := $(LD_LIBRARY_PATH):<%custom_type->libpath%>$(if $(ARCH),:<%custom_type->libpath%>/$(ARCH))
533 export SHLIB_PATH        := $(SHLIB_PATH):<%custom_type->libpath%>$(if $(ARCH),:<%custom_type->libpath%>/$(ARCH))
534 export LIBPATH           := $(LIBPATH):<%custom_type->libpath%>$(if $(ARCH),:<%custom_type->libpath%>/$(ARCH))
535 export PATH              := $(PATH):<%custom_type->libpath%>$(if $(ARCH),:<%custom_type->libpath%>/$(ARCH))
537 <%endif%>
538 <%foreach(custom_type->input_files)%>
539 <%if(custom_type->input_file->output_files)%>
540 GENERATED_DIRTY +=<%foreach(custom_type->input_file->output_files)%> <%custom_type->input_file->output_file%><%endfor%>
541 <%if(precious_files)%>
542 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%>
543 <%endif%>
544 <%if(custom_type->input_file->non_source_output_files)%>
545 OBJS_DEPEND_ON_GENERATED = 1
546 <%endif%>
547 <%foreach(custom_type->input_file->output_files)%>
548 <%if(forlast && !forfirst)%>
549 ## More than one file is generated by the command and therefore
550 ## it can not be run in parallel.  Unfortunately, there is no way to
551 ## say that only this rule can't be run in parallel.  However, we can
552 ## determine if the generated files have already been generated.  If that's
553 ## the case, then we don't need this special rule.
554 ifeq ($(wildcard $(GENERATED_DIRTY)), $(GENERATED_DIRTY))
555   ## If we can find /bin/test, then we will continue
556   ifneq ($(TEST_EXE),)
557     ## If all of the generated files are there, then we need to check
558     ## and make sure that the generated files are up-to-date.  If they are not
559     ## then we need the special rule.
560     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),)
561       .NOTPARALLEL:
562 <%if(flag_overrides(custom_type->input_file, dependent) || custom_type->dependent || flag_overrides(custom_type->input_file, dependent_libs) || custom_type->dependent_libs)%>
563     else
564       ## By this point, all of the generated files are here and up-to-date
565       ## with respect to the source file.  Now we need to make sure that
566       ## they are up-to-date with respect to the generation tool.  If the tool
567       ## is newer than the generated files, then we need the special rule.
568       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),)
569         .NOTPARALLEL:
570       endif
571 <%endif%>
572     endif
573   else
574     .NOTPARALLEL:
575   endif
576 else
577 .NOTPARALLEL:
578 endif
579 <%endif%>
580 <%endfor%>
581 <%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%>
582 <%if(flag_overrides(custom_type->input_file, gendir))%>
583 <%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%>
584         $(MKDIR) <%flag_overrides(custom_type->input_file, gendir)%>
585 <%endif%>
586 <%endif%>
587         <%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%>
588 <%if(flag_overrides(custom_type->input_file, postcommand))%>
589 <%foreach(custom_type->input_file)%>
590         <%flag_overrides(custom_type->input_file, postcommand)%>
591 <%endfor%>
592 <%else%>
593 <%if(custom_type->postcommand)%>
594 <%foreach(custom_type->input_file)%>
595         <%custom_type->postcommand%>
596 <%endfor%>
597 <%endif%>
598 <%endif%>
599 <%if(pch_header)%>
600 <%if(custom_type->pch_postrule)%>
601 <%foreach(custom_type->input_file->source_output_files)%>
602         @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%>
603 <%endfor%>
604 <%endif%>
605 <%endif%>
607 <%if(flag_overrides(custom_type->input_file, dependent_libs) || custom_type->dependent_libs)%>
608 ifneq ($(static_libs_only),1)
609 ifneq ($(CROSS-COMPILE),1)
610 <%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%>
611 endif
612 endif
613 <%endif%>
615 <%endif%>
616 <%endfor%>
617 <%endfor%>
618 ifneq ($(GENERATED_DIRTY),)
619 .PRECIOUS: $(GENERATED_DIRTY)
620 <%if(source_files)%>
621 ## If the generated files are anything but source files, we need to
622 ## ensure that those files are generated before we attempt to build anything
623 ## else.
624 ifeq ($(OBJS_DEPEND_ON_GENERATED),1)
625 $(VDIR)$(ACE_PCH_FILE) $(addprefix $(VDIR), $(OBJS)): $(GENERATED_DIRTY)
626 $(VSHDIR)$(ACE_PCH_FILE) $(VSHOBJS): $(GENERATED_DIRTY)
627 endif
628 <%else%>
629 <%foreach(requires)%>
630 ifeq ($(<%require%>),1)
631 <%endfor%>
632 <%foreach(avoids)%>
633 ifneq ($(<%avoid%>),1)
634 <%endfor%>
635 all: $(GENERATED_DIRTY)
636 <%foreach(avoids)%>
637 endif
638 <%endfor%>
639 <%foreach(requires)%>
640 endif
641 <%endfor%>
642 <%endif%>
643 endif
645 <%endif%>
646 <%if(idl_files)%>
647 ADDITIONAL_IDL_TARGETS += $(GENERATED_DIRTY)
648 idl_stubs: $(ADDITIONAL_IDL_TARGETS)
649 <%if(source_files)%>
651 # This assignment forces make to run the idl_stubs
652 # target before building any of the source files.
653 FORCED_IDL_STUBS = <%source_files%>  <%if(pch_source)%>$(ACE_PCH_SOURCE)<%endif%>
654 <%foreach(custom_types)%>
655 <%foreach(custom_type->input_files)%>
656 <%if(custom_type->input_file->source_output_files)%>
657 <%foreach(custom_type->input_file->source_output_files)%>
658 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%>=)
659 <%endfor%>
660 <%endif%>
661 <%endfor%>
662 <%endfor%>
664 ifneq ($(FORCED_IDL_STUBS),)
665 $(FORCED_IDL_STUBS): idl_stubs
666 endif
667 <%endif%>
668 <%endif%>
669 <%if(exename)%>
671 ifneq ($(VXWORKSLINK),1)
672 <%if(libs && libpaths)%>
673 ifeq ($(static_libs_only), 1)
674   ifeq ($(use_dep_libs), 1)
675     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))))
676   endif
677 endif
679 <%endif%>
680 $(VBIN): $(addprefix $(VDIR), $(OBJS)) $(DEPLIBS)
681   ifneq (,$(LINK.cc.override))
682         $(LINK.cc.override)
683   else
684         $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $(filter-out %.a,$^) $(VLDLIBS) $(POSTLINK)
685   endif
686 endif
687 <%endif%>
689 <%if(idl_files)%>
690 <%if(contains(idlflags,-DGEN_IDL_MAKE_DEPS))%>
691 incremental_depend_idl::
692 <%foreach(idl_files)%>
693         @$(RM) $(IDL_DEPENDENCY_FILE<%forcount%>)_idl.old
694         @cp $(IDL_DEPENDENCY_FILE<%forcount%>) $(IDL_DEPENDENCY_FILE<%forcount%>)_idl.old
695         $(DEPGEN_ENV) $(DEPGEN) -A $(DEPEND_CMD_ARGS) -f $(IDL_DEPENDENCY_FILE<%forcount%>) \
696         $(IDL_DEPS_FLAGS<%forcount%>) -t gnuidl -DMAKEDEPEND $(IDL_DEPS<%forcount%>)
697         @if cmp -s $(IDL_DEPENDENCY_FILE<%forcount%>) $(IDL_DEPENDENCY_FILE<%forcount%>)_idl.old ;\
698         then echo "GNUmakefile idl dependencies unchanged for $(IDL_DEPS<%forcount%>)." ;\
699         else \
700                 echo "GNUmakefile idl dependencies updated for $(IDL_DEPS<%forcount%>)." ;\
701         fi ;\
702         $(RM) $(IDL_DEPENDENCY_FILE<%forcount%>)_idl.old ;
703 <%endfor%>
704 <%endif%>
705 <%endif%>
707 realclean: clean
708 ifneq ($(GENERATED_DIRTY),)
709         -$(RM) -r $(filter-out $(PRECIOUS_FILES),$(GENERATED_DIRTY))
710 endif
711 <%if(postclean)%>
712         -<%eval(postclean)%>
713 <%endif%>
715 __prebuild__:
716 <%foreach(requires)%>
717 ifeq ($(<%require%>),1)
718 <%endfor%>
719 <%foreach(avoids)%>
720 ifneq ($(<%avoid%>),1)
721 <%endfor%>
722 <%if(prebuild)%>
723         @<%eval(prebuild)%>
724 <%else%>
725         @-:
726 <%endif%>
727 <%foreach(avoids requires)%>
728 endif
729 <%endfor%>
731 <%if(postbuild)%>
732 all: __postbuild__
734 .PHONY: __postbuild__
735 <%if(exename)%>
736 __postbuild__: $(VBIN) $(INSTALL)
737 <%else%>
738 <%if(sharedname || staticname)%>
739 __postbuild__: $(VLIBS) $(INSTALL)
740 <%else%>
741 <%foreach(requires)%>
742 ifeq ($(<%require%>),1)
743 <%endfor%>
744 <%foreach(avoids)%>
745 ifneq ($(<%avoid%>),1)
746 <%endfor%>
747 __postbuild__: $(GENERATED_DIRTY)
748 <%foreach(avoids requires)%>
749 endif
750 <%endfor%>
751 <%endif%>
752 <%endif%>
754 __postbuild__:
755 <%foreach(requires)%>
756 ifeq ($(<%require%>),1)
757 <%endfor%>
758 <%foreach(avoids)%>
759 ifneq ($(<%avoid%>),1)
760 <%endfor%>
761         @<%eval(postbuild)%>
762 <%foreach(avoids requires)%>
763 endif
764 <%endfor%>
766 <%endif%>
768 .PHONY: install
769 install: <%if(postbuild)%>__postbuild__<%else%>all<%endif%>
770 INSTALL_LIB ?= lib
771 ifneq ($(INSTALL_PREFIX),)
772 ifneq ($(install_rpath),0)
773 LD_RPATH ?= -Wl,-rpath,
774 LDFLAGS += $(LD_RPATH)$(INSTALL_PREFIX)/$(INSTALL_LIB) $(LD_RPATH_FLAGS)
775 endif
776 endif
778 <%if(install_this_target)%>
779 PRJINST_OPTIONS ?=
780 INST_DIR ?= <%if(install_dir)%>/<%install_dir%><%else%>/$(notdir $(PWD))<%endif%>
781 COMMA = ,
782 SPACE = $(should_be_unset) $(should_be_unset)
783 INSTALLER ?= $(MPC_ROOT)/prj_install.pl
784 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%>)
786 <%if(staticname || sharedname)%>
787 <%if(install_headers)%>
788 LIB_INST_TAGS = header_files template_files inline_files$(if $(CUSTOM_INST_TAGS), $(CUSTOM_INST_TAGS))
789 LIB_INST_LOCATIONS = $(foreach tag,$(LIB_INST_TAGS),-b $(tag)=include$(INST_DIR))
791 <%else%>
792 ifeq ($(shared_libs),1)
793 <%endif%>
794 INST_TAGS = lib_output$(if $(LIB_INST_TAGS), $(LIB_INST_TAGS))
795 INST_LOCATIONS = $(LIB_INST_LOCATIONS) -o lib_output=$(INSTALL_LIB)
796 <%if(!install_headers)%>
797 endif
798 <%endif%>
800 <%else%>
801 <%if(exename)%>
802 INST_TAGS = exe_output
803 INST_LOCATIONS = -o exe_output=bin
805 <%else%>
806 INST_TAGS = $(CUSTOM_INST_TAGS)<%if(custom_inst_tags)%> <%custom_inst_tags%><%endif%>
807 INST_LOCATIONS = $(foreach tag,$(INST_TAGS),-b $(tag)=include$(INST_DIR))
809 <%endif%>
810 <%endif%>
811 DATA_INST_TAGS = <%foreach(custom_types)%><%if(compares(custom_type, installdata_files))%><%if(custom_type->input_files)%>installdata_files<%endif%><%endif%><%endfor%>
812 INST_LOCATIONS += $(if $(DATA_INST_TAGS),-x installdata_files -b installdata_files=share$(INST_DIR))
813 INST_TAGS := $(INST_TAGS)$(if $(DATA_INST_TAGS), $(DATA_INST_TAGS))
815 ifeq ($(INSTALLER),/prj_install.pl)
816 INSTALLER = $(ACE_ROOT)/MPC/prj_install.pl
817 endif
819 ifeq ($(LIBCHECK),1)
820 <%foreach(requires)%>
821 ifeq ($(<%require%>),1)
822 <%endfor%>
823 <%foreach(avoids)%>
824 ifneq ($(<%avoid%>),1)
825 <%endfor%>
826 install:
827 ifeq ($(INST_TAGS),)
828         @echo Nothing to install.
829 else
830 ifeq ($(INSTALL_PREFIX),)
831         @echo The variable INSTALL_PREFIX must be set to install.
832         @echo If binaries are already built and you want to use RPATH,
833         @echo they must be rebuilt after changing INSTALL_PREFIX.
834         @false
835 else
836         perl -ne'if (/^#END MPC-Generated Install Info/) {exit 0}' \
837           -e'elsif (/^#BEGIN MPC-Generated Install Info/) {$$ok=1}' \
838           -e'elsif ($$ok && s/^#//) {print}' $(MAKEFILE) | \
839         $(INSTALLER) -i -s $(subst $(SPACE),$(COMMA),$(INST_TAGS)) \
840           $(INST_LOCATIONS) $(if $(ARCH),-d $(ARCH)) $(PRJINST_OPTIONS) \
841           $(DESTDIR)$(INSTALL_PREFIX)
842 <%foreach(custom_types)%>
843 <%if(compares(custom_type, pkgconfig_files))%>
844 <%if(custom_type->input_files)%>
845         $(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%>
846 <%endif%>
847 <%endif%>
848 <%endfor%>
849 <%marker(postinstall)%>
850 endif
851 endif
852 <%foreach(requires avoids)%>
853 endif
854 <%endfor%>
855 endif
857 #BEGIN MPC-Generated Install Info
858 <%genins%>
859 #END MPC-Generated Install Info
860 <%endif%>
862 <%marker(bottom)%>