Template.gmsvc.pp 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168
  1. //
  2. // Template.gmsvc.pp
  3. //
  4. // This file defines the set of output files that will be generated to
  5. // support a makefile build system invoking Microsoft's Visual C++
  6. // command-line compiler, similar to Template.msvc.pp, but using
  7. // Cygwin's GNU make instead of Microsoft's nmake.
  8. //
  9. // Before this file is processed, the following files are read and
  10. // processed (in order):
  11. // The Package.pp file in the root of the current source hierarchy
  12. // (e.g. $PANDA/Package.pp)
  13. // $DTOOL/Package.pp
  14. // $DTOOL/Config.pp
  15. // $DTOOL/Config.Platform.pp
  16. // The user's PPREMAKE_CONFIG file.
  17. // $DTOOL/pptempl/System.pp
  18. // All of the Sources.pp files in the current source hierarchy
  19. // $DTOOL/pptempl/Global.pp
  20. // $DTOOL/pptempl/Global.gmsvc.pp
  21. // $DTOOL/pptempl/Depends.pp, once for each Sources.pp file
  22. // Template.gmsvc.pp (this file), once for each Sources.pp file
  23. #if $[ne $[DTOOL],]
  24. #define dtool_ver_dir_cyg $[DTOOL]/src/dtoolbase
  25. #define dtool_ver_dir $[osfilename $[dtool_ver_dir_cyg]]
  26. #endif
  27. //
  28. // Correct LDFLAGS_OPT 3,4 here to get around early evaluation of, even
  29. // if deferred
  30. //
  31. #defer nodefaultlib_cstatic \
  32. $[if $[ne $[LINK_FORCE_STATIC_RELEASE_C_RUNTIME],], \
  33. /NODEFAULTLIB:MSVCRT.LIB, \
  34. /NODEFAULTLIB:LIBCMT.LIB \
  35. ]
  36. #defer LDFLAGS_OPT3 $[LDFLAGS_OPT3] $[nodefaultlib_cstatic]
  37. #defer LDFLAGS_OPT4 $[LDFLAGS_OPT4] $[nodefaultlib_cstatic]
  38. //////////////////////////////////////////////////////////////////////
  39. #if $[or $[eq $[DIR_TYPE], src],$[eq $[DIR_TYPE], metalib]]
  40. //////////////////////////////////////////////////////////////////////
  41. // For a source directory, build a single Makefile with rules to build
  42. // each target.
  43. #if $[build_directory]
  44. // This is the real set of lib_targets we'll be building. On Windows,
  45. // we don't build the shared libraries which are included on metalibs.
  46. #define real_lib_targets
  47. #define real_lib_target_libs
  48. #define deferred_objs
  49. #forscopes lib_target
  50. #if $[build_target]
  51. #if $[eq $[module $[TARGET],$[TARGET]],]
  52. // This library is not on a metalib, so we can build it.
  53. #set real_lib_targets $[real_lib_targets] $[TARGET]
  54. #set real_lib_target_libs $[real_lib_target_libs] $[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]
  55. #else
  56. // This library is on a metalib, so we can't build it, but we
  57. // should build all the obj's that go into it.
  58. #set deferred_objs $[deferred_objs] \
  59. $[patsubst %,$[%_obj],$[compile_sources]]
  60. #endif
  61. #endif
  62. #end lib_target
  63. // We need to know the various targets we'll be building.
  64. // $[lib_targets] will be the list of dynamic and static libraries,
  65. // and $[bin_targets] the list of binaries. $[test_bin_targets] is
  66. // the list of binaries that are to be built only when specifically
  67. // asked for.
  68. #define lib_targets $[forscopes metalib_target noinst_lib_target test_lib_target static_lib_target dynamic_lib_target ss_lib_target,$[if $[build_target],$[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]]] $[real_lib_target_libs]
  69. #define bin_targets \
  70. $[active_target(bin_target noinst_bin_target csharp_target):%=$[ODIR]/%.exe] \
  71. $[active_target(sed_bin_target):%=$[ODIR]/%]
  72. #define test_bin_targets $[active_target(test_bin_target):%=$[ODIR]/%.exe]
  73. #defer test_lib_targets $[active_target(test_lib_target):%=$[if $[TEST_ODIR],$[TEST_ODIR],$[ODIR]]/%$[dllext]$[lib_ext]]
  74. // And these variables will define the various things we need to
  75. // install.
  76. #define install_lib $[active_target(metalib_target static_lib_target dynamic_lib_target ss_lib_target)] $[real_lib_targets]
  77. #define install_bin $[active_target(bin_target)]
  78. #define install_scripts $[sort $[INSTALL_SCRIPTS(metalib_target lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target)] $[INSTALL_SCRIPTS]]
  79. #define install_modules $[sort $[INSTALL_MODULES(metalib_target lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target)] $[INSTALL_MODULES]]
  80. #define install_headers $[sort $[INSTALL_HEADERS(metalib_target lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target)] $[INSTALL_HEADERS]]
  81. #define install_parser_inc $[sort $[INSTALL_PARSER_INC]]
  82. #define install_data $[sort $[INSTALL_DATA(metalib_target lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target)] $[INSTALL_DATA]]
  83. #define install_config $[sort $[INSTALL_CONFIG(metalib_target lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target)] $[INSTALL_CONFIG]]
  84. #define install_igatedb $[sort $[get_igatedb(metalib_target lib_target)]]
  85. // These are the various sources collected from all targets within the
  86. // directory.
  87. #define st_sources $[sort $[compile_sources(metalib_target lib_target noinst_lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target test_lib_target csharp_target)]]
  88. #define yxx_st_sources $[sort $[yxx_sources(metalib_target lib_target noinst_lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target test_lib_target)]]
  89. #define lxx_st_sources $[sort $[lxx_sources(metalib_target lib_target noinst_lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target test_lib_target)]]
  90. #define dep_sources_1 $[sort $[get_sources(metalib_target lib_target noinst_lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target test_lib_target)]]
  91. // If there is an __init__.py in the directory, then all Python
  92. // files in the directory just get installed without having to be
  93. // named.
  94. #if $[and $[INSTALL_PYTHON_SOURCE],$[wildcard $[TOPDIR]/$[DIRPREFIX]__init__.py]]
  95. #define py_sources $[wildcard $[TOPDIR]/$[DIRPREFIX]*.py]
  96. #endif
  97. #define install_py $[py_sources:$[TOPDIR]/$[DIRPREFIX]%=%]
  98. // These are the source files that our dependency cache file will
  99. // depend on. If it's an empty list, we won't bother writing rules to
  100. // freshen the cache file.
  101. #define dep_sources $[sort $[filter %.c %.cxx %.cpp %.yxx %.lxx %.h %.I %.T,$[dep_sources_1]]]
  102. #endif // $[build_directory]
  103. #defer actual_local_libs $[get_metalibs $[TARGET],$[complete_local_libs]]
  104. // $[static_lib_dependencies] is the set of libraries we will link
  105. // with that happen to be static libs. We will introduce dependency
  106. // rules for these. (We don't need dependency rules for dynamic libs,
  107. // since these don't get burned in at build time.)
  108. #defer static_lib_dependencies $[all_libs $[if $[and $[lib_is_static],$[build_lib]],$[RELDIR:%=%/$[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]]],$[complete_local_libs]]
  109. // $[target_ipath] is the proper ipath to put on the command line,
  110. // from the context of a particular target.
  111. #defer target_ipath $[TOPDIR] $[sort $[complete_ipath]] $[other_trees_include] $[get_ipath]
  112. // These are the complete set of extra flags the compiler requires.
  113. #defer cflags $[get_cflags] $[CFLAGS] $[CFLAGS_OPT$[OPTIMIZE]]
  114. #defer c++flags $[get_cflags] $[C++FLAGS] $[CFLAGS_OPT$[OPTIMIZE]]
  115. // $[complete_lpath] is rather like $[complete_ipath]: the list of
  116. // directories (from within this tree) we should add to our -L list.
  117. #defer complete_lpath $[libs $[RELDIR:%=%/$[ODIR]],$[actual_local_libs]] $[EXTRA_LPATH]
  118. // $[lpath] is like $[target_ipath]: it's the list of directories we
  119. // should add to our -L list, from the context of a particular target.
  120. #defer lpath $[sort $[complete_lpath]] $[other_trees_lib] $[get_lpath]
  121. // $[libs] is the set of libraries we will link with.
  122. #defer libs $[unique $[actual_local_libs:%=%$[dllext]] $[patsubst %:c,,%:m %,%$[dllext],$[OTHER_LIBS]] $[get_libs]]
  123. // This is the set of files we might copy into *.prebuilt, if we have
  124. // bison and flex (or copy from *.prebuilt if we don't have them).
  125. #define bison_prebuilt $[patsubst %.yxx,%.cxx %.h,$[yxx_st_sources]] $[patsubst %.lxx,%.cxx,$[lxx_st_sources]]
  126. // Rather than making a rule to generate each install directory later,
  127. // we create the directories now. This reduces problems from
  128. // multiprocess builds.
  129. #mkdir $[sort \
  130. $[if $[install_lib],$[install_lib_dir]] \
  131. $[if $[install_bin] $[install_scripts],$[install_bin_dir]] \
  132. $[if $[install_bin] $[install_modules],$[install_lib_dir]] \
  133. $[if $[install_headers],$[install_headers_dir]] \
  134. $[if $[install_parser_inc],$[install_parser_inc_dir]] \
  135. $[if $[install_data],$[install_data_dir]] \
  136. $[if $[install_config],$[install_config_dir]] \
  137. $[if $[install_igatedb],$[install_igatedb_dir]] \
  138. $[if $[install_py],$[install_py_dir] $[install_py_package_dir]] \
  139. ]
  140. // Similarly, we need to ensure that $[ODIR] exists. Trying to make
  141. // the makefiles do this automatically just causes problems with
  142. // multiprocess builds.
  143. #mkdir $[ODIR] $[TEST_ODIR]
  144. // Pre-compiled headers are one way to speed the compilation of many
  145. // C++ source files that include similar headers, but it turns out a
  146. // more effective (and more portable) way is simply to compile all the
  147. // similar source files in one pass.
  148. // We do this by generating a *_composite.cxx file that has an
  149. // #include line for each of several actual source files, and then we
  150. // compile the composite file instead of the original files.
  151. #foreach composite_file $[composite_list]
  152. #output $[composite_file] notouch
  153. #format collapse
  154. /* Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE]. */
  155. /* ################################# DO NOT EDIT ########################### */
  156. #foreach file $[$[composite_file]_sources]
  157. #if $[USE_TAU]
  158. // For the benefit of Tau, we copy the source file verbatim into the
  159. // composite file. (Tau doesn't instrument files picked up via #include.)
  160. #copy $[DIRPREFIX]$[file]
  161. #else
  162. ##include "$[file]"
  163. #endif // USE_TAU
  164. #end file
  165. #end $[composite_file]
  166. #end composite_file
  167. // Okay, we're ready. Start outputting the Makefile now.
  168. #output Makefile
  169. #format makefile
  170. #### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
  171. ################################# DO NOT EDIT ###########################
  172. // If we are using GNU make, this will automatically enable the
  173. // multiprocessor build mode according to the value in
  174. // NUMBER_OF_PROCESSORS, which should be set by NT. Maybe this isn't
  175. // a good idea to do all the time, but you can always disable it by
  176. // explicitly unsetting NUMBER_OF_PROCESSORS, or by setting it to 1.
  177. //#if $[NUMBER_OF_PROCESSORS]
  178. //MAKEFLAGS := -j$[NUMBER_OF_PROCESSORS]
  179. //#endif
  180. // The 'all' rule makes all the stuff in the directory except for the
  181. // test_bin_targets. It doesn't do any installation, however.
  182. #define all_targets \
  183. Makefile \
  184. $[if $[dep_sources],$[DEPENDENCY_CACHE_FILENAME]] \
  185. $[sort $[lib_targets] $[bin_targets]] \
  186. $[deferred_objs]
  187. all : $[all_targets]
  188. // The 'test' rule makes all the test_bin_targets.
  189. test : $[test_bin_targets] $[test_lib_targets]
  190. clean : clean-igate
  191. #forscopes metalib_target lib_target noinst_lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target test_lib_target
  192. #if $[compile_sources]
  193. $[TAB] rm -f $[patsubst %,$[%_obj],$[compile_sources]]
  194. #endif
  195. #end metalib_target lib_target noinst_lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target test_lib_target
  196. #if $[deferred_objs]
  197. $[TAB] rm -f $[deferred_objs]
  198. #endif
  199. #if $[lib_targets] $[bin_targets] $[test_bin_targets]
  200. $[TAB] rm -f $[lib_targets] $[bin_targets] $[test_bin_targets]
  201. #endif
  202. #if $[yxx_st_sources] $[lxx_st_sources]
  203. $[TAB] rm -f $[patsubst %.yxx,%.cxx %.h,$[yxx_st_sources]] $[patsubst %.lxx,%.cxx,$[lxx_st_sources]]
  204. #endif
  205. #if $[py_sources]
  206. $[TAB] rm -f *.pyc *.pyo // Also scrub out old generated Python code.
  207. #endif
  208. #if $[USE_TAU]
  209. $[TAB] rm -f $[ODIR]/*.il $[ODIR]/*.pdb *.inst.* // scrub out tau-generated files.
  210. #endif
  211. // 'cleanall' is intended to undo all the effects of running ppremake
  212. // and building. It removes everything except the Makefile.
  213. cleanall : clean
  214. #if $[st_sources]
  215. $[TAB] rm -rf $[ODIR]
  216. #endif
  217. #if $[ne $[DEPENDENCY_CACHE_FILENAME],]
  218. $[TAB] rm -f $[DEPENDENCY_CACHE_FILENAME]
  219. #endif
  220. #if $[composite_list]
  221. $[TAB] rm -f $[composite_list]
  222. #endif
  223. clean-igate :
  224. #forscopes metalib_target lib_target ss_lib_target
  225. #define igatedb $[get_igatedb]
  226. #define igateoutput $[get_igateoutput]
  227. #define igatemscan $[get_igatemscan]
  228. #define igatemout $[get_igatemout]
  229. #if $[igatedb]
  230. $[TAB] rm -f $[igatedb]
  231. #endif
  232. #if $[igateoutput]
  233. $[TAB] rm -f $[igateoutput] $[$[igateoutput]_obj]
  234. #endif
  235. #if $[igatemout]
  236. $[TAB] rm -f $[igatemout] $[$[igatemout]_obj]
  237. #endif
  238. #end metalib_target lib_target ss_lib_target
  239. // Now, 'install' and 'uninstall'. These simply copy files into the
  240. // install directory (or remove them). The 'install' rule also makes
  241. // the directories if necessary.
  242. #define installed_files \
  243. $[INSTALL_SCRIPTS:%=$[install_bin_dir]/%] \
  244. $[INSTALL_MODULES:%=$[install_lib_dir]/%] \
  245. $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \
  246. $[INSTALL_PARSER_INC:%=$[install_parser_inc_dir]/%] \
  247. $[INSTALL_DATA:%=$[install_data_dir]/%] \
  248. $[INSTALL_CONFIG:%=$[install_config_dir]/%] \
  249. $[if $[install_py],$[install_py:%=$[install_py_dir]/%] $[install_py_package_dir]/__init__.py]
  250. #define installed_igate_files \
  251. $[get_igatedb(metalib_target lib_target ss_lib_target):$[ODIR]/%=$[install_igatedb_dir]/%]
  252. #define install_targets \
  253. $[active_target(metalib_target lib_target static_lib_target dynamic_lib_target ss_lib_target):%=install-lib%] \
  254. $[active_target(bin_target sed_bin_target csharp_target):%=install-%] \
  255. $[installed_files]
  256. install : all $[install_targets]
  257. install-igate : $[sort $[installed_igate_files]]
  258. uninstall : $[active_target(metalib_target lib_target static_lib_target dynamic_lib_target ss_lib_target):%=uninstall-lib%] $[active_target(bin_target):%=uninstall-%]
  259. #if $[installed_files]
  260. $[TAB] rm -f $[sort $[installed_files]]
  261. #endif
  262. uninstall-igate :
  263. #if $[installed_igate_files]
  264. $[TAB] rm -f $[sort $[installed_igate_files]]
  265. #endif
  266. #if $[HAVE_BISON]
  267. prebuild-bison : $[patsubst %,%.prebuilt,$[bison_prebuilt]]
  268. clean-prebuild-bison :
  269. #if $[bison_prebuilt]
  270. $[TAB] rm -f $[sort $[patsubst %,%.prebuilt,$[bison_prebuilt]]]
  271. #endif
  272. #endif
  273. // Now it's time to start generating the rules to make our actual
  274. // targets.
  275. igate : $[get_igatedb(metalib_target lib_target ss_lib_target)]
  276. /////////////////////////////////////////////////////////////////////
  277. // First, the dynamic and static libraries.
  278. /////////////////////////////////////////////////////////////////////
  279. #forscopes metalib_target lib_target static_lib_target dynamic_lib_target ss_lib_target
  280. // We might need to define a BUILDING_ symbol for win32. We use the
  281. // BUILDING_DLL variable name, defined typically in the metalib, for
  282. // this; but in some cases, where the library isn't part of a metalib,
  283. // we define BUILDING_DLL directly for the target.
  284. #define building_var $[or $[BUILDING_DLL],$[module $[BUILDING_DLL],$[TARGET]]]
  285. // $[igatescan] is the set of C++ headers and source files that we
  286. // need to scan for interrogate. $[igateoutput] is the name of the
  287. // generated .cxx file that interrogate will produce (and which we
  288. // should compile into the library). $[igatedb] is the name of the
  289. // generated .in file that interrogate will produce (and which should
  290. // be installed into the /etc directory).
  291. #define igatescan $[get_igatescan]
  292. #define igateoutput $[get_igateoutput]
  293. #define igatedb $[get_igatedb]
  294. // If this is a metalib, it may have a number of components that
  295. // include interrogated interfaces. If so, we need to generate a
  296. // 'module' file within this library. This is mainly necessary for
  297. // Python; it contains a table of all of the interrogated functions,
  298. // so we can load the library as a Python module and have access to
  299. // the interrogated functions.
  300. // $[igatemscan] is the set of .in files generated by all of our
  301. // component libraries. If it is nonempty, then we do need to
  302. // generate a module, and $[igatemout] is the name of the .cxx file
  303. // that interrogate will produce to make this module.
  304. #define igatemscan $[get_igatemscan]
  305. #define igatemout $[get_igatemout]
  306. #if $[build_lib]
  307. // Now output the rule to actually link the library from all of its
  308. // various .obj files.
  309. #define sources \
  310. $[patsubst %,$[%_obj],$[compile_sources]]
  311. #if $[not $[BUILD_COMPONENTS]]
  312. // Also link in all of the component files directly into the metalib.
  313. #define sources $[sources] \
  314. $[components $[patsubst %,$[RELDIR]/$[%_obj],$[compile_sources]],$[active_component_libs]]
  315. #endif
  316. #define varname $[subst -,_,.,_,$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]]
  317. $[varname] = $[sources]
  318. #define target $[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]
  319. #define sources $($[varname])
  320. #define flags $[get_cflags] $[C++FLAGS] $[CFLAGS_OPT$[OPTIMIZE]] $[CFLAGS_SHARED] $[building_var:%=/D%]
  321. // not parallel (requires gmake 3.79) because of link.exe conflicts in TMP dir (see audiotraits dir)
  322. #if $[or $[GENERATE_BUILDDATE],$[WIN_RESOURCE_FILE]]
  323. #define resource_file $[or $[WIN_RESOURCE_FILE],$[dtool_ver_dir_cyg]/version.rc]
  324. #define tlb_depend $[patsubst %.idl,$[ODIR]/%.tlb,$[filter %.idl, $[get_sources]]]
  325. $[target] : $[sources] $[static_lib_dependencies] $[resource_file] $[DLLBASEADDRFILENAME:%=$[dtool_ver_dir_cyg]/%] $[tlb_depend]
  326. // first generate builddate for rc compiler using compiler preprocessor
  327. #define ver_resource "$[ODIR]\$[lib_prefix]$[TARGET].res"
  328. $[TAB] cl /nologo /EP "$[dtool_ver_dir]\verdate.cpp" > "$[ODIR]\verdate.h"
  329. $[TAB] rc /n /I"$[ODIR]" $[DECYGWINED_INC_PATHLIST_ARGS] /fo$[ver_resource] $[filter /D%, $[flags]] "$[osfilename $[resource_file]]"
  330. #define sources $[sources] $[ver_resource]
  331. #if $[filter %.cxx %.cpp %.yxx %.lxx,$[get_sources]]
  332. $[TAB] $[link_lib_c++]
  333. #else
  334. $[TAB] $[link_lib_c]
  335. #endif
  336. #else
  337. $[target] : $[sources] $[DLLBASEADDRFILENAME:%=$[dtool_ver_dir_cyg]/%]
  338. #if $[filter %.cxx %.cpp %.yxx %.lxx,$[get_sources]]
  339. $[TAB] $[link_lib_c++]
  340. #else
  341. $[TAB] $[link_lib_c]
  342. #endif
  343. #endif
  344. // Additional dependency rules for the implicit files that get built
  345. // along with a .dll.
  346. #if $[not $[lib_is_static]]
  347. $[ODIR]/$[lib_prefix]$[TARGET]$[dllext].lib : $[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]
  348. #endif
  349. #if $[has_pdb]
  350. $[ODIR]/$[lib_prefix]$[TARGET]$[dllext].pdb : $[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]
  351. #endif
  352. #endif
  353. // Here are the rules to install and uninstall the library and
  354. // everything that goes along with it.
  355. #define installed_files \
  356. $[if $[build_lib], \
  357. $[install_lib_dir]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext] \
  358. $[if $[not $[lib_is_static]],$[install_lib_dir]/$[lib_prefix]$[TARGET]$[dllext].lib] \
  359. $[if $[has_pdb],$[install_lib_dir]/$[lib_prefix]$[TARGET]$[dllext].pdb] \
  360. ] \
  361. $[INSTALL_SCRIPTS:%=$[install_bin_dir]/%] \
  362. $[INSTALL_MODULES:%=$[install_lib_dir]/%] \
  363. $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \
  364. $[INSTALL_DATA:%=$[install_data_dir]/%] \
  365. $[INSTALL_CONFIG:%=$[install_config_dir]/%] \
  366. $[igatedb:$[ODIR]/%=$[install_igatedb_dir]/%]
  367. install-lib$[TARGET] : $[installed_files]
  368. uninstall-lib$[TARGET] :
  369. #if $[installed_files]
  370. $[TAB] rm -f $[sort $[installed_files]]
  371. #endif
  372. $[install_lib_dir]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext] : $[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]
  373. #define local $[lib_prefix]$[TARGET]$[dllext]$[lib_ext]
  374. #define dest $[install_lib_dir]
  375. #if $[not $[lib_is_static]]
  376. #if $[or $[eq $[USE_COMPILER], MSVC8],$[eq $[USE_COMPILER], MSVC9],$[eq $[USE_COMPILER], MSVC9x64]]
  377. $[TAB] mt -nologo -manifest $[ODIR]/$[local].manifest -outputresource:$[ODIR]/$[local]\;2
  378. $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local].manifest $[dest]
  379. #endif
  380. #endif
  381. $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local] $[dest]/
  382. // Install the .lib associated with a .dll.
  383. #if $[not $[lib_is_static]]
  384. $[install_lib_dir]/$[lib_prefix]$[TARGET]$[dllext].lib : $[ODIR]/$[lib_prefix]$[TARGET]$[dllext].lib
  385. #define local $[lib_prefix]$[TARGET]$[dllext].lib
  386. #define dest $[install_lib_dir]
  387. $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local] $[dest]/
  388. #endif
  389. #if $[has_pdb]
  390. $[install_lib_dir]/$[lib_prefix]$[TARGET]$[dllext].pdb : $[ODIR]/$[lib_prefix]$[TARGET]$[dllext].pdb
  391. #define local $[lib_prefix]$[TARGET]$[dllext].pdb
  392. #define dest $[install_lib_dir]
  393. $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local] $[dest]/
  394. #endif
  395. #if $[igatescan]
  396. // Now, some additional rules to generate and compile the interrogate
  397. // data, if needed.
  398. // The library name is based on this library.
  399. #define igatelib $[lib_prefix]$[TARGET]
  400. // The module name comes from the metalib that includes this library.
  401. #define igatemod $[module $[TARGET],$[TARGET]]
  402. #if $[eq $[igatemod],]
  403. // Unless no metalib includes this library.
  404. #define igatemod $[TARGET]
  405. #endif
  406. $[igatedb:$[ODIR]/%=$[install_igatedb_dir]/%] : $[igatedb]
  407. #define local $[igatedb]
  408. #define dest $[install_igatedb_dir]
  409. $[TAB] cp $[install_dash_p] -f $[local] $[dest]/
  410. // We have to split this out as a separate rule to properly support
  411. // parallel make.
  412. $[igatedb] : $[igateoutput]
  413. $[lib_prefix]$[TARGET]_igatescan = $[igatescan]
  414. $[igateoutput] : $[sort $[patsubst %.h,%.h,%.I,%.I,%.T,%.T,%,,$[dependencies $[igatescan]] $[igatescan:%=./%]]]
  415. $[TAB] $[INTERROGATE] -od $[igatedb] -oc $[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $($[lib_prefix]$[TARGET]_igatescan)
  416. #endif // igatescan
  417. #if $[igatemout]
  418. // And finally, some additional rules to build the interrogate module
  419. // file into the library, if this is a metalib that includes
  420. // interrogated components.
  421. #define igatelib $[lib_prefix]$[TARGET]
  422. #define igatemod $[TARGET]
  423. $[lib_prefix]$[TARGET]_igatemscan = $[igatemscan]
  424. #define target $[igatemout]
  425. #define sources $($[lib_prefix]$[TARGET]_igatemscan)
  426. $[target] : $[sources]
  427. $[TAB] $[INTERROGATE_MODULE] -oc $[target] -module "$[igatemod]" -library "$[igatelib]" $[interrogate_module_options] $[sources]
  428. #endif // igatemout
  429. #foreach idl $[filter %.idl, $[get_sources]]
  430. #define idl_basename $[basename $[idl]]
  431. $[ODIR]/$[idl_basename].tlb : $[ODIR]/$[idl_basename].h
  432. $[ODIR]/$[idl_basename].h : $[idl]
  433. $[TAB] $[MIDL_COMMAND]
  434. #end idl
  435. #end metalib_target lib_target static_lib_target dynamic_lib_target ss_lib_target
  436. /////////////////////////////////////////////////////////////////////
  437. // Now, the noninstalled dynamic libraries. These are presumably used
  438. // only within this directory, or at the most within this tree, and
  439. // also presumably will never include interrogate data. That, plus
  440. // the fact that we don't need to generate install rules, makes it a
  441. // lot simpler.
  442. /////////////////////////////////////////////////////////////////////
  443. #forscopes noinst_lib_target test_lib_target
  444. #define varname $[subst -,_,.,_,$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]]
  445. $[varname] = $[patsubst %,$[%_obj],$[compile_sources]]
  446. #define target $[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]
  447. #define sources $($[varname])
  448. #define $[VER_RESOURCE] $[COMPILED_RESOURCES]
  449. $[target] : $[sources] $[static_lib_dependencies] $[GENERATED_SOURCES]
  450. #if $[filter %.cxx %.cpp %.yxx %.lxx,$[get_sources]]
  451. $[TAB] $[link_lib_c++]
  452. #else
  453. $[TAB] $[link_lib_c]
  454. #endif
  455. $[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext] : $[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]
  456. #if $[has_pdb]
  457. $[ODIR]/$[lib_prefix]$[TARGET]$[dllext].pdb : $[ODIR]/$[lib_prefix]$[TARGET]$[dllext]$[lib_ext]
  458. #endif
  459. // this section is all very clunky and not generalized enough
  460. // assuming tgt dirs and such
  461. #define rc_to_gen $[filter %.rc, $[GENERATED_SOURCES]]
  462. #if $[rc_to_gen]
  463. $[rc_to_gen] : $[GENERATED_RC_DEPENDENCIES]
  464. $[TAB] $[RC_GENERATOR_RULE]
  465. $[ODIR]/$[RC_BASENAME].res : $[rc_to_gen]
  466. $[TAB] $[COMPILE_RC] /I"$[ODIR]" /Fo"$[ODIR]/$[RC_BASENAME].res" $[ODIR]/$[RC_BASENAME].rc
  467. #endif
  468. #define inf_to_gen $[filter %.inf, $[GENERATED_SOURCES]]
  469. #if $[inf_to_gen]
  470. $[inf_to_gen] : $[GENERATED_INF_DEPENDENCIES]
  471. $[TAB] $[INF_GENERATOR_RULE]
  472. #endif
  473. #define rgs_to_gen $[filter %.rgs, $[GENERATED_SOURCES]]
  474. #if $[rgs_to_gen]
  475. $[rgs_to_gen] : $[GENERATED_RGS_DEPENDENCIES]
  476. $[TAB] $[RGS_GENERATOR_RULE]
  477. #endif
  478. #define verhdr_to_gen $[filter %Version.h, $[GENERATED_SOURCES]]
  479. #if $[verhdr_to_gen]
  480. $[verhdr_to_gen] : $[GENERATED_VERHEADER_DEPENDENCIES]
  481. $[TAB] $[VERHEADER_GENERATOR_RULE]
  482. $[VERHEADER_DEPENDENTS] : $[verhdr_to_gen]
  483. #endif
  484. #define idl_to_gen $[filter %.idl, $[GENERATED_SOURCES]]
  485. #if $[idl_to_gen]
  486. $[idl_to_gen] : $[GENERATED_IDL_DEPENDENCIES]
  487. $[TAB] $[IDL_GENERATOR_RULE]
  488. $[ODIR]/$[IDL_BASENAME].h : $[idl_to_gen]
  489. #define idl $[idl_to_gen]
  490. $[TAB] $[MIDL_COMMAND]
  491. // this is a complete hack. I don't know how add a generated .h to the dependency list of $[IDL_BASENAME].cpp.
  492. // it is already there, but in the wrong directory. should really add this to official dependency list
  493. #foreach file $[GENERATED_IDL_H_DEPENDENTS]
  494. $[file] : $[ODIR]/$[IDL_BASENAME].h
  495. $[TAB] // empty, dependency-only 'rule'
  496. #end file
  497. $[ODIR]/$[IDL_BASENAME].tlb : $[idl_to_gen]
  498. #define idl $[idl_to_gen]
  499. $[TAB] $[MIDL_COMMAND]
  500. #endif
  501. #end noinst_lib_target test_lib_target
  502. /////////////////////////////////////////////////////////////////////
  503. // The sed_bin_targets are a special bunch. These are scripts that
  504. // are to be preprocessed with sed before being installed, for
  505. // instance to insert a path or something in an appropriate place.
  506. /////////////////////////////////////////////////////////////////////
  507. #forscopes sed_bin_target
  508. $[TARGET] : $[ODIR]/$[TARGET]
  509. #define target $[ODIR]/$[TARGET]
  510. #define source $[SOURCE]
  511. #define script $[COMMAND]
  512. $[target] : $[source]
  513. $[TAB] $[SED]
  514. $[TAB] chmod +x $[target]
  515. #define installed_files \
  516. $[install_bin_dir]/$[TARGET]
  517. install-$[TARGET] : $[installed_files]
  518. uninstall-$[TARGET] :
  519. #if $[installed_files]
  520. $[TAB] rm -f $[sort $[installed_files]]
  521. #endif
  522. #define local $[TARGET]
  523. #define dest $[install_bin_dir]
  524. $[install_bin_dir]/$[TARGET] : $[ODIR]/$[TARGET]
  525. $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local] $[dest]/
  526. #end sed_bin_target
  527. /////////////////////////////////////////////////////////////////////
  528. // And now, the bin_targets. These are normal C++ executables. No
  529. // interrogate, metalibs, or any such nonsense here.
  530. /////////////////////////////////////////////////////////////////////
  531. #forscopes bin_target
  532. $[TARGET] : $[ODIR]/$[TARGET].exe
  533. #define varname $[subst -,_,bin_$[TARGET]]
  534. $[varname] = $[patsubst %,$[%_obj],$[compile_sources]]
  535. #define target $[ODIR]/$[TARGET].exe
  536. #define sources $($[varname])
  537. #define ld $[get_ld]
  538. #if $[WIN_RESOURCE_FILE]
  539. #define resource_file $[WIN_RESOURCE_FILE]
  540. #define ver_resource "$[ODIR]\$[TARGET].res"
  541. $[ver_resource] : $[resource_file]
  542. $[TAB] rc /n /I"$[ODIR]" $[DECYGWINED_INC_PATHLIST_ARGS] /fo$[ver_resource] $[filter /D%, $[flags]] "$[osfilename $[resource_file]]"
  543. #set sources $[sources] $[ver_resource]
  544. #endif
  545. $[target] : $[sources] $[static_lib_dependencies]
  546. #if $[ld]
  547. // If there's a custom linker defined for the target, we have to use it.
  548. $[TAB] $[ld] -o $[target] $[sources] $[lpath:%=-L%] $[libs:%=-l%]
  549. #else
  550. // Otherwise, we can use the normal linker.
  551. #if $[filter %.cxx %.cpp %.yxx %.lxx,$[get_sources]]
  552. $[TAB] $[link_bin_c++]
  553. #else
  554. $[TAB] $[link_bin_c]
  555. #endif
  556. #endif
  557. #if $[build_pdbs]
  558. $[ODIR]/$[TARGET].pdb : $[ODIR]/$[TARGET].exe
  559. #endif
  560. #define installed_files \
  561. $[install_bin_dir]/$[TARGET].exe \
  562. $[if $[build_pdbs],$[install_bin_dir]/$[TARGET].pdb] \
  563. $[if $[or $[eq $[USE_COMPILER],MSVC8],$[eq $[USE_COMPILER],MSVC9],$[eq $[USE_COMPILER],MSVC9x64]],$[install_bin_dir]/$[TARGET].exe.manifest] \
  564. $[INSTALL_SCRIPTS:%=$[install_bin_dir]/%] \
  565. $[INSTALL_MODULES:%=$[install_lib_dir]/%] \
  566. $[INSTALL_HEADERS:%=$[install_headers_dir]/%] \
  567. $[INSTALL_DATA:%=$[install_data_dir]/%] \
  568. $[if $[bin_postprocess_target],$[install_bin_dir]/$[bin_postprocess_target].exe] \
  569. $[INSTALL_CONFIG:%=$[install_config_dir]/%]
  570. install-$[TARGET] : $[installed_files]
  571. uninstall-$[TARGET] :
  572. #if $[installed_files]
  573. $[TAB] rm -f $[sort $[installed_files]]
  574. #endif
  575. $[install_bin_dir]/$[TARGET].exe : $[ODIR]/$[TARGET].exe
  576. #define local $[TARGET].exe
  577. #define dest $[install_bin_dir]
  578. #if $[or $[eq $[USE_COMPILER],MSVC8],$[eq $[USE_COMPILER],MSVC9],$[eq $[USE_COMPILER],MSVC9x64]]
  579. $[TAB] mt -nologo -manifest $[ODIR]/$[local].manifest -outputresource:$[ODIR]/$[local]\;1
  580. $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local].manifest $[dest]/
  581. #endif
  582. $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local] $[dest]/
  583. #if $[build_pdbs]
  584. $[install_bin_dir]/$[TARGET].pdb : $[ODIR]/$[TARGET].pdb
  585. #define local $[TARGET].pdb
  586. #define dest $[install_bin_dir]
  587. $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local] $[dest]/
  588. #endif
  589. #if $[bin_postprocess_target]
  590. #define input_exe $[ODIR]/$[TARGET].exe
  591. #define output_exe $[ODIR]/$[bin_postprocess_target].exe
  592. $[output_exe] : $[input_exe]
  593. $[TAB] rm -f $[output_exe]
  594. $[TAB] $[bin_postprocess_cmd] $[bin_postprocess_arg1] $[input_exe] $[bin_postprocess_arg2] $[output_exe]
  595. $[install_bin_dir]/$[bin_postprocess_target].exe : $[output_exe]
  596. $[TAB] cp $[install_dash_p] -f $[output_exe] $[install_bin_dir]/
  597. #endif
  598. #end bin_target
  599. /////////////////////////////////////////////////////////////////////
  600. // The noinst_bin_targets and the test_bin_targets share the property
  601. // of being built (when requested), but having no install rules.
  602. /////////////////////////////////////////////////////////////////////
  603. #forscopes noinst_bin_target test_bin_target test_lib_target
  604. $[TARGET] : $[ODIR]/$[TARGET].exe
  605. #define varname $[subst -,_,bin_$[TARGET]]
  606. $[varname] = $[patsubst %,$[%_obj],$[compile_sources]]
  607. #define target $[ODIR]/$[TARGET].exe
  608. #define sources $($[varname])
  609. $[target] : $[sources] $[static_lib_dependencies]
  610. #if $[filter %.cxx %.cpp %.yxx %.lxx,$[get_sources]]
  611. $[TAB] $[link_bin_c++]
  612. #else
  613. $[TAB] $[link_bin_c]
  614. #endif
  615. #end noinst_bin_target test_bin_target test_lib_target
  616. /////////////////////////////////////////////////////////////////////
  617. // Rules to for rudimentary C-sharp compiling
  618. /////////////////////////////////////////////////////////////////////
  619. #forscopes csharp_target
  620. $[TARGET] : $[ODIR]/$[TARGET].exe
  621. #define target $[ODIR]/$[TARGET].exe
  622. #define output "$[ODIR]\$[TARGET].exe"
  623. $[target] : $[sources]
  624. $[TAB] $[CSHARP] /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:TRACE /debug:pdbonly /filealign:512 /optimize+ /out:$[target] /target:exe $[osfilename $[SOURCES]]
  625. #if $[build_pdbs]
  626. $[ODIR]/$[TARGET].pdb : $[ODIR]/$[TARGET].exe
  627. #endif
  628. #define installed_files \
  629. $[install_bin_dir]/$[TARGET].exe
  630. install-$[TARGET] : $[installed_files]
  631. uninstall-$[TARGET] :
  632. #if $[installed_files]
  633. $[TAB] rm -f $[sort $[installed_files]]
  634. #endif
  635. $[install_bin_dir]/$[TARGET].exe : $[ODIR]/$[TARGET].exe
  636. #define local $[TARGET].exe
  637. #define dest $[install_bin_dir]
  638. $[TAB] cp $[install_dash_p] -f $[ODIR]/$[local] $[dest]/
  639. #end csharp_target
  640. /////////////////////////////////////////////////////////////////////
  641. // Rules to run bison and/or flex as needed.
  642. /////////////////////////////////////////////////////////////////////
  643. // Rules to generate a C++ file from a Bison input file.
  644. #foreach file $[sort $[yxx_st_sources]]
  645. #define target $[patsubst %.yxx,%.cxx,$[file]]
  646. #define target_header $[patsubst %.yxx,%.h,$[file]]
  647. #define target_prebuilt $[target].prebuilt
  648. #define target_header_prebuilt $[target_header].prebuilt
  649. #if $[HAVE_BISON]
  650. $[target] : $[file]
  651. $[TAB] $[BISON] $[YFLAGS] -y $[if $[YACC_PREFIX],-d --name-prefix=$[YACC_PREFIX]] $[file]
  652. $[TAB] mv y.tab.c $[target]
  653. $[TAB] mv y.tab.h $[target_header]
  654. $[target_header] : $[target]
  655. $[target_prebuilt] : $[target]
  656. $[TAB] cp $[target] $[target_prebuilt]
  657. $[target_header_prebuilt] : $[target_header]
  658. $[TAB] cp $[target_header] $[target_header_prebuilt]
  659. #else // HAVE_BISON
  660. $[target] : $[target_prebuilt]
  661. $[TAB] cp $[target_prebuilt] $[target]
  662. $[target_header] : $[target_header_prebuilt]
  663. $[TAB] cp $[target_header_prebuilt] $[target_header]
  664. #endif // HAVE_BISON
  665. #end file
  666. // Rules to generate a C++ file from a Flex input file.
  667. #foreach file $[sort $[lxx_st_sources]]
  668. #define target $[patsubst %.lxx,%.cxx,$[file]]
  669. #define target_prebuilt $[target].prebuilt
  670. #if $[HAVE_BISON]
  671. #define source $[file]
  672. $[target] : $[file]
  673. $[TAB] $[FLEX] $[FLEXFLAGS] $[if $[YACC_PREFIX],-P$[YACC_PREFIX]] -olex.yy.c $[file]
  674. #define source lex.yy.c
  675. #define script /#include <unistd.h>/d
  676. $[TAB] $[SED]
  677. $[TAB] rm lex.yy.c
  678. $[target_prebuilt] : $[target]
  679. $[TAB] cp $[target] $[target_prebuilt]
  680. #else // HAVE_BISON
  681. $[target] : $[target_prebuilt]
  682. $[TAB] cp $[target_prebuilt] $[target]
  683. #endif // HAVE_BISON
  684. #end file
  685. /////////////////////////////////////////////////////////////////////
  686. // Finally, we put in the rules to compile each source file into a .obj
  687. // file.
  688. /////////////////////////////////////////////////////////////////////
  689. #forscopes metalib_target lib_target noinst_lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target test_lib_target
  690. // need to use #print to avoid printing to Makefile
  691. // printvar prints the unevaluated defn of the var
  692. // #print TARGET=$[TARGET]
  693. // #printvar TARGET
  694. // Rules to compile ordinary C files.
  695. #foreach file $[sort $[c_sources]]
  696. #define target $[$[file]_obj]
  697. #define source $[file]
  698. #define ipath $[target_ipath]
  699. #define flags $[cflags] $[building_var:%=/D%]
  700. #if $[ne $[file], $[notdir $file]]
  701. // If the source file is not in the current directory, tack on "."
  702. // to front of the ipath.
  703. #set ipath . $[ipath]
  704. #endif
  705. #if $[not $[direct_tau]]
  706. $[target] : $[source] $[get_depends $[source]]
  707. $[TAB] $[compile_c]
  708. #else // direct_tau
  709. // This version is used to invoke the tau compiler directly.
  710. #define il_source $[target].il
  711. #define pdb_source $[target].pdb // Not to be confused with windows .pdb debugger info files.
  712. #define inst_source $[notdir $[target:%.obj=%.inst.c]]
  713. $[il_source] : $[source]
  714. $[TAB] $[TAU_MAKE_IL]
  715. $[pdb_source] : $[il_source]
  716. $[TAB] $[TAU_MAKE_PDB]
  717. $[inst_source] : $[pdb_source]
  718. $[TAB] $[TAU_MAKE_INST] -c
  719. $[target] : $[inst_source] $[get_depends $[source]]
  720. #define source $[inst_source]
  721. $[TAB] $[COMPILE_C]
  722. #endif // direct_tau
  723. #end file
  724. // Rules to compile C++ files.
  725. #foreach file $[sort $[cxx_sources] $[cxx_interrogate_sources]]
  726. #define target $[$[file]_obj]
  727. #define source $[file]
  728. #define ipath $[target_ipath]
  729. #define flags $[c++flags] $[building_var:%=/D%]
  730. #if $[ne $[file], $[notdir $file]]
  731. // If the source file is not in the current directory, tack on "."
  732. // to front of the ipath.
  733. #set ipath . $[ipath]
  734. #endif
  735. #if $[not $[direct_tau]]
  736. // Yacc must run before some files can be compiled, so all files
  737. // depend on yacc having run.
  738. $[target] : $[source] $[get_depends $[source]] $[yxx_sources:%.yxx=%.h]
  739. $[TAB] $[compile_c++]
  740. #else // direct_tau
  741. // This version is used to invoke the tau compiler directly.
  742. #define il_source $[target].il
  743. #define pdb_source $[target].pdb // Not to be confused with windows .pdb debugger info files.
  744. #define inst_source $[notdir $[target:%.obj=%.inst.cxx]]
  745. $[il_source] : $[source] $[yxx_sources:%.yxx=%.h]
  746. $[TAB] $[TAU_MAKE_IL]
  747. $[pdb_source] : $[il_source]
  748. $[TAB] $[TAU_MAKE_PDB]
  749. $[inst_source] : $[pdb_source]
  750. $[TAB] $[TAU_MAKE_INST] -c++
  751. $[target] : $[inst_source] $[get_depends $[source]]
  752. #define source $[inst_source]
  753. $[TAB] $[COMPILE_C++]
  754. #endif // direct_tau
  755. #end file
  756. #end metalib_target lib_target noinst_lib_target static_lib_target dynamic_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target test_lib_target
  757. // And now the rules to install the auxiliary files, like headers and
  758. // data files.
  759. #foreach file $[install_scripts]
  760. $[install_bin_dir]/$[file] : $[file]
  761. #define local $[file]
  762. #define dest $[install_bin_dir]
  763. $[TAB] chmod +x $[local]; cp $[install_dash_p] -f $[local] $[dest]/
  764. #end file
  765. #foreach file $[install_modules]
  766. $[install_lib_dir]/$[file] : $[file]
  767. #define local $[file]
  768. #define dest $[install_lib_dir]
  769. $[TAB] chmod +x $[local]; cp $[install_dash_p] -f $[local] $[dest]/
  770. #end file
  771. #foreach file $[install_headers]
  772. $[install_headers_dir]/$[file] : $[file]
  773. #define local $[file]
  774. #define dest $[install_headers_dir]
  775. $[TAB] cp $[install_dash_p] -f $[local] $[dest]/
  776. #end file
  777. #foreach file $[install_parser_inc]
  778. #if $[ne $[dir $[file]], ./]
  779. $[install_parser_inc_dir]/$[file] : $[notdir $[file]]
  780. #define local $[notdir $[file]]
  781. #define dest $[install_parser_inc_dir]/$[dir $[file]]
  782. $[TAB] mkdir -p $[install_parser_inc_dir]/$[dir $[file]] || echo
  783. $[TAB] cp $[install_dash_p] -f $[local] $[dest]
  784. #else
  785. $[install_parser_inc_dir]/$[file] : $[file]
  786. #define local $[file]
  787. #define dest $[install_parser_inc_dir]
  788. $[TAB] cp $[install_dash_p] -f $[local] $[dest]/
  789. #endif
  790. #end file
  791. #foreach file $[install_data]
  792. $[install_data_dir]/$[file] : $[file]
  793. #define local $[file]
  794. #define dest $[install_data_dir]
  795. $[TAB] cp $[install_dash_p] -f $[local] $[dest]/
  796. #end file
  797. #foreach file $[install_config]
  798. $[install_config_dir]/$[file] : $[file]
  799. #define local $[file]
  800. #define dest $[install_config_dir]
  801. $[TAB] cp $[install_dash_p] -f $[local] $[dest]/
  802. #end file
  803. #foreach file $[install_py]
  804. $[install_py_dir]/$[file] : $[file]
  805. #define local $[file]
  806. #define dest $[install_py_dir]
  807. $[TAB] cp $[install_dash_p] -f $[local] $[dest]/
  808. #end file
  809. #if $[install_py]
  810. $[install_py_package_dir]/__init__.py :
  811. $[TAB] touch $[install_py_package_dir]/__init__.py
  812. #endif
  813. // Finally, all the special targets. These are commands that just need
  814. // to be invoked; we don't pretend to know what they are.
  815. #forscopes special_target
  816. $[TARGET] :
  817. $[TAB] $[COMMAND]
  818. #end special_target
  819. // Finally, the rules to freshen the Makefile itself.
  820. Makefile : $[SOURCE_FILENAME] $[EXTRA_PPREMAKE_SOURCE]
  821. $[TAB] ppremake
  822. #if $[USE_TAU]
  823. #foreach composite_file $[composite_list]
  824. $[composite_file] : $[$[composite_file]_sources]
  825. $[TAB] ppremake
  826. #end composite_file
  827. #endif // USE_TAU
  828. #if $[and $[DEPENDENCY_CACHE_FILENAME],$[dep_sources]]
  829. $[DEPENDENCY_CACHE_FILENAME] : $[dep_sources]
  830. $[TAB] @ppremake -D $[DEPENDENCY_CACHE_FILENAME]
  831. #endif
  832. #end Makefile
  833. //////////////////////////////////////////////////////////////////////
  834. #elif $[eq $[DIR_TYPE], group]
  835. //////////////////////////////////////////////////////////////////////
  836. // This is a group directory: a directory above a collection of source
  837. // directories, e.g. $DTOOL/src. We don't need to output anything in
  838. // this directory.
  839. //////////////////////////////////////////////////////////////////////
  840. #elif $[eq $[DIR_TYPE], toplevel]
  841. //////////////////////////////////////////////////////////////////////
  842. // This is the toplevel directory, e.g. $DTOOL. Here we build the
  843. // root makefile and also synthesize the dtool_config.h (or whichever
  844. // file) we need.
  845. #map subdirs
  846. // Iterate through all of our known source files. Each src and
  847. // metalib type file gets its corresponding Makefile listed
  848. // here. However, we test for $[DIR_TYPE] of toplevel, because the
  849. // source directories typically don't define their own DIR_TYPE
  850. // variable, and they end up inheriting this one dynamically.
  851. #forscopes */
  852. #if $[or $[eq $[DIR_TYPE], src],$[eq $[DIR_TYPE], metalib],$[and $[eq $[DIR_TYPE], toplevel],$[ne $[DIRNAME],top]]]
  853. #if $[build_directory]
  854. #addmap subdirs $[DIRNAME]
  855. #endif
  856. #endif
  857. #end */
  858. #if $[PYTHON_PACKAGE]
  859. #include $[THISDIRPREFIX]PythonPackageInit.pp
  860. #endif
  861. #output Makefile
  862. #format makefile
  863. #### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[SOURCEFILE].
  864. ################################# DO NOT EDIT ###########################
  865. all : $[subdirs]
  866. test : $[subdirs:%=test-%]
  867. igate : $[subdirs:%=igate-%]
  868. clean : $[subdirs:%=clean-%]
  869. clean-igate : $[subdirs:%=clean-igate-%]
  870. cleanall : $[subdirs:%=cleanall-%]
  871. install : $[if $[CONFIG_HEADER],$[install_headers_dir] $[install_headers_dir]/$[CONFIG_HEADER]] $[subdirs:%=install-%]
  872. install-igate : $[subdirs:%=install-igate-%]
  873. uninstall : $[subdirs:%=uninstall-%]
  874. #if $[CONFIG_HEADER]
  875. $[TAB] rm -f $[install_headers_dir]/$[CONFIG_HEADER]
  876. #endif
  877. uninstall-igate : $[subdirs:%=uninstall-igate-%]
  878. #if $[HAVE_BISON]
  879. prebuild-bison : $[subdirs:%=prebuild-bison-%]
  880. clean-prebuild-bison : $[subdirs:%=clean-prebuild-bison-%]
  881. #endif
  882. #formap dirname subdirs
  883. #define depends
  884. $[dirname] : $[dirnames $[if $[build_directory],$[DIRNAME]],$[DEPEND_DIRS]]
  885. $[TAB] cd ./$[PATH] && $(MAKE) all
  886. #end dirname
  887. #formap dirname subdirs
  888. test-$[dirname] :
  889. $[TAB] cd ./$[PATH] && $(MAKE) test
  890. #end dirname
  891. #formap dirname subdirs
  892. igate-$[dirname] :
  893. $[TAB]cd ./$[PATH] && $(MAKE) igate
  894. #end dirname
  895. #formap dirname subdirs
  896. clean-$[dirname] :
  897. $[TAB] cd ./$[PATH] && $(MAKE) clean
  898. #end dirname
  899. #formap dirname subdirs
  900. clean-igate-$[dirname] :
  901. $[TAB] cd ./$[PATH] && $(MAKE) clean-igate
  902. #end dirname
  903. #formap dirname subdirs
  904. cleanall-$[dirname] : $[patsubst %,cleanall-%,$[dirnames $[if $[build_directory],$[DIRNAME]],$[DEPEND_DIRS]]]
  905. $[TAB] cd ./$[PATH] && $(MAKE) cleanall
  906. #end dirname
  907. #formap dirname subdirs
  908. install-$[dirname] : $[patsubst %,install-%,$[dirnames $[if $[build_directory],$[DIRNAME]],$[DEPEND_DIRS]]]
  909. $[TAB] cd ./$[PATH] && $(MAKE) install
  910. #end dirname
  911. #formap dirname subdirs
  912. install-igate-$[dirname] :
  913. $[TAB] cd ./$[PATH] && $(MAKE) install-igate
  914. #end dirname
  915. #formap dirname subdirs
  916. uninstall-$[dirname] :
  917. $[TAB] cd ./$[PATH] && $(MAKE) uninstall
  918. #end dirname
  919. #formap dirname subdirs
  920. uninstall-igate-$[dirname] :
  921. $[TAB] cd ./$[PATH] && $(MAKE) uninstall-igate
  922. #end dirname
  923. #if $[HAVE_BISON]
  924. #formap dirname subdirs
  925. prebuild-bison-$[dirname] :
  926. $[TAB]cd ./$[PATH] && $(MAKE) prebuild-bison
  927. clean-prebuild-bison-$[dirname] :
  928. $[TAB]cd ./$[PATH] && $(MAKE) clean-prebuild-bison
  929. #end dirname
  930. #endif
  931. #if $[ne $[CONFIG_HEADER],]
  932. $[install_headers_dir] :
  933. $[TAB] @test -d $[install_headers_dir] || echo mkdir -p $[install_headers_dir]
  934. $[TAB] @test -d $[install_headers_dir] || mkdir -p $[install_headers_dir]
  935. $[install_headers_dir]/$[CONFIG_HEADER] : $[CONFIG_HEADER]
  936. #define local $[CONFIG_HEADER]
  937. #define dest $[install_headers_dir]
  938. $[TAB] cp $[install_dash_p] -f $[local] $[dest]/
  939. #endif
  940. // Finally, the rules to freshen the Makefile itself.
  941. Makefile : $[SOURCE_FILENAME] $[EXTRA_PPREMAKE_SOURCE]
  942. $[TAB] ppremake
  943. #end Makefile
  944. // If there is a file called LocalSetup.pp in the package's top
  945. // directory, then invoke that. It might contain some further setup
  946. // instructions.
  947. #sinclude $[TOPDIRPREFIX]LocalSetup.gmsvc.pp
  948. #sinclude $[TOPDIRPREFIX]LocalSetup.pp
  949. //////////////////////////////////////////////////////////////////////
  950. #elif $[or $[eq $[DIR_TYPE], models],$[eq $[DIR_TYPE], models_toplevel],$[eq $[DIR_TYPE], models_group]]
  951. //////////////////////////////////////////////////////////////////////
  952. #include $[THISDIRPREFIX]Template.models.pp
  953. //////////////////////////////////////////////////////////////////////
  954. #endif // DIR_TYPE