Template.gmsvc.pp 39 KB

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