Imake.rules 79 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572
  1. XCOMM ---------------------------------------------------------------------
  2. XCOMM Imake rules for building libraries, programs, scripts, and data files
  3. XCOMM rules: $TOG: Imake.rules /main/227 1998/02/02 12:07:57 kaleb $
  4. /*
  5. * MACHINE-INDEPENDENT RULES; DO NOT MODIFY
  6. *
  7. * Warning, when defining rules: make sure you do not include both a trailing
  8. * backslash and double ampersand backslash or else you will get an extra
  9. * backslash in the Makefile.
  10. *
  11. * The following macros are defined for the various templates and Imakefiles
  12. * (for a list of the applicable make variables, see the template files):
  13. *
  14. * Concat (a,b)
  15. * Concat3 (a,b,c)
  16. * Concat4 (a,b,c,d)
  17. * _Use (a,b)
  18. * _UseCat (a,b,c)
  19. * ProgramTargetName (target)
  20. * RunProgram (progvar,options)
  21. * RunProgramWithSetup (setup,progvar,options)
  22. * RemoveFile (file)
  23. * RemoveFiles (files)
  24. * CenterLoadTarget (target,srclist,libs,defines)
  25. * CenterProgramTarget (program,srclist,objlist,locallibs,syslibs)
  26. * SentinelLinkTarget (step,program,linklist)
  27. * SentinelProgramTarget (program,deplist,linklist)
  28. * SentinelCplusplusProgramTarget (program,deplist,linklist)
  29. * PurifyLinkTarget (step,program,linklist)
  30. * PurifyProgramTarget (program,deplist,linklist)
  31. * PurifyCplusplusProgramTarget (program,deplist,linklist)
  32. * ProofLinkTarget (step,program,linklist)
  33. * ProofProgramTarget (program,deplist,linklist)
  34. * ProofCplusplusProgramTarget (program,deplist,linklist)
  35. * ProofCleanTarget ()
  36. * RemoveTargetProgram (program)
  37. * MakeDir (dir)
  38. * BuildIncludesTop (srclist)
  39. * BuildIncludes (srclist,dstsubdir,dstupdir)
  40. * LinkRule (program,options,objects,libraries)
  41. * HostLinkRule (program,options,objects,libraries)
  42. * NoCmpScript (target)
  43. * NoConfigRec (target)
  44. * NormalProgramTarget (program,objects,deplibs,locallibs,syslibs)
  45. * SetUIDProgramTarget (program,objects,deplibs,locallibs,syslibs)
  46. * SingleProgramTarget (program,objects,locallibs,syslibs)
  47. * SimpleProgramTarget (program)
  48. * ComplexProgramTarget (program)
  49. * ComplexProgramTarget_1 (program,locallib,syslib)
  50. * ComplexProgramTarget_2 (program,locallib,syslib)
  51. * ComplexProgramTarget_3 (program,locallib,syslib)
  52. * ServerTargetWithFlags (server,subdirs,objects,libs,syslibs,flags)
  53. * ServerTarget (server,subdirs,objects,libs,syslibs)
  54. * MoveToBakFile (file)
  55. * RMoveToBakFile (file)
  56. * RanLibrary (args)
  57. * LibraryTargetName (libname)
  58. * LibraryTargetNameSuffix (libname,suffix)
  59. * InstallNamedTarget (step,srcname,flags,dest,dstname)
  60. * InstallTarget (step,file,flags,dest)
  61. * InstallLibrary (libname,dest)
  62. * MergeIntoInstalledLibrary (tolib,fromlib)
  63. * InstallLibraryAlias (libname,alias,dest)
  64. * InstallLintLibrary (libname,dest)
  65. * InstallManPageLong (file,destdir,dest)
  66. * InstallManPage (file,destdir)
  67. * InstallManPageAliases (file,destdir,aliases)
  68. * ManKeywordsTarget (manpath)
  69. * InstallNamedNonExec (srcname,dstname,dest)
  70. * InstallNonExecFile (file,dest)
  71. * InstallNonExecFileNoClobber (file,dest)
  72. * InstallNonExec (file,dest)
  73. * InstallProgramWithFlags (program,dest,flags)
  74. * InstallProgram (program,dest)
  75. * InstallScript (program,dest)
  76. * InstallNamedProg (srcname,dstname,dest)
  77. * InstallNamedProgNoClobber (srcname,dstname,dest)
  78. * MakeFlagsToShellFlags (makeflags,shellcmd)
  79. * LinkFileList (step,list,dir,sub)
  80. * LinkVarDirectory (mdir,cdir,rdir,ldir)
  81. * InstallMultipleDestFlags (step,list,dest,flags)
  82. * InstallMultipleDest (step,list,dest)
  83. * InstallMultiple (list,dest)
  84. * InstallMultipleFlags (list,dest,flags)
  85. * InstallMultipleMan (list,dest)
  86. * DependDependency ()
  87. * DependTarget ()
  88. * DependTarget3 (srcs1,srcs2,srcs3)
  89. * CleanTarget ()
  90. * TagsTarget ()
  91. * ImakeDependency (target)
  92. * BuildMakefileTarget (notused,imakeflags)
  93. * MakefileTarget ()
  94. * LibMkdir (dir)
  95. * LibCleanDir (dir)
  96. * LintLibReferences (varname,libname,libsource)
  97. * UnsharedLibReferences (varname,libname,libsource)
  98. * ProjectUnsharedLibReferences (varname,libname,libsource,buildlibdir)
  99. * SharedLibDependencies (libname,libsource,revname)
  100. * SharedDSLibDependencies (libname,libsource,revname)
  101. * SharedLibReferences (varname,libname,libsource,revname,rev)
  102. * SharedDSLibReferences (varname,libname,libsource,revname,rev)
  103. * ObjectCompile (options)
  104. * NormalLibObjCompile (options)
  105. * NormalSharedLibObjCompile (options)
  106. * LibObjCompile (dir,options)
  107. * DebuggedLibObjCompile (options)
  108. * ProfiledLibObjCompile (options)
  109. * SharedLibObjCompile (options)
  110. * NormalLibraryObjectRule ()
  111. * NormalFortranObjectRule ()
  112. * ObjectFromSpecialSource (dst,src,flags)
  113. * SpecialObjectRule (objs,depends,options)
  114. * SpecialCObjectRule (basename,depends,options)
  115. * LexFile (file)
  116. * YaccFile (file,flags)
  117. * YaccFileNoFlags (file)
  118. * MakeLibrary (libname,objlist)
  119. * NormalLibraryTarget (libname,objlist)
  120. * NormalLibraryTarget2 (libname,objlist1,objlist2)
  121. * NormalLibraryTarget3 (libname,objlist1,objlist2,objlist3)
  122. * NormalDepLibraryTarget (libname,deplist,objlist)
  123. * UnsharedLibraryTarget (libname,objlist,down,up)
  124. * UnsharedLibraryTarget3 (libname,objlist1,objlist2,objlist3,down,up)
  125. * SubdirLibraryRule (objlist)
  126. * ProfiledLibraryTarget (libname,objlist)
  127. * DebuggedLibraryTarget (libname,objlist)
  128. * AliasedLibraryTarget (libname,alias)
  129. * NormalRelocatableTarget (objname,objlist)
  130. * ProfiledRelocatableTarget (objname,objlist)
  131. * DebuggedRelocatableTarget (objname,objlist)
  132. * LintLibraryTarget (libname,srclist)
  133. * NormalLintTarget (srclist)
  134. * LintTarget ()
  135. * LinkSourceFile (src,dir)
  136. * CopySourceFile (src,dir)
  137. * LinkFile (tofile,fromfile)
  138. * MakeSubincludesForBuild (step,dir,srclist)
  139. * LangNamedTargetSubdirs (lang,name,dirs,verb,flags,subname)
  140. * LangNamedMakeSubdirs (lang,name,dirs)
  141. * LangMakeSubdirs (lang,dirs)
  142. * NamedTargetSubdirs (name,dirs,verb,flags,subname)
  143. * NamedMakeSubdirs (name,dirs)
  144. * MakeSubdirs (dirs)
  145. * DependSubdirs (dirs)
  146. * ForceSubdirs (dirs)
  147. * InstallSubdirs (dirs)
  148. * InstallManSubdirs (dirs)
  149. * IncludesSubdirs (dirs)
  150. * NamedCleanSubdirs (name,dirs)
  151. * CleanSubdirs (dirs)
  152. * NamedTagSubdirs (name,dirs)
  153. * TagSubdirs (dirs)
  154. * MakeLintSubdirs (dirs,target,subtarget)
  155. * LintSubdirs (dirs)
  156. * MakeLintLibSubdirs (dirs)
  157. * MakeMakeOneSubdirs ()
  158. * MakeMakeSubdirs (dirs,target)
  159. * MakefileSubdirs (dirs)
  160. * CppScriptTarget (dst,src,defs,deplist)
  161. * MakeScriptFromCpp (name,defs)
  162. * CppFileTarget (dst,src,defs,deplist)
  163. * CppSourceFile (dst,src,defs,deplist)
  164. * MakeDirectories (step,dirs)
  165. * AllTarget (depends)
  166. * MakeImakeDir ()
  167. * DoUDB_SCRIPT3 (target, file, script, build)
  168. * DoUDB_SCRIPT4 (target, file, script, build)
  169. *
  170. *
  171. * The following are in specific <os>Lib.rules:
  172. *
  173. * SharedLibraryTarget (libname,rev,solist,down,up)
  174. * SharedLibraryDataTarget (libname,rev,salist)
  175. * InstallSharedLibrary (libname,rev,dest)
  176. * InstallSharedLibraryData (libname,rev,dest)
  177. *
  178. */
  179. #define NullParameter
  180. /* stringify macro */
  181. #ifndef STR
  182. # if defined(__llvm__)
  183. # define STR2(x) #x
  184. # else
  185. # define STR2(x) "x"
  186. # endif
  187. #define STR(x) STR2(x)
  188. #endif
  189. /* if [ -d ] or [ ! -d ] causes make to fail, define this as - */
  190. #ifndef DirFailPrefix
  191. #define DirFailPrefix
  192. #endif
  193. /*
  194. * NoCmpScript - suppress clearmake build script comparison.
  195. */
  196. #ifndef NoCmpScript
  197. #if HasClearmake
  198. #define NoCmpScript(targ) @@\
  199. XCOMM special target for clearmake @@\
  200. .NO_CMP_SCRIPT: targ
  201. #else
  202. #define NoCmpScript(targ) /**/
  203. #endif
  204. #endif
  205. /*
  206. * NoConfigRec - suppress using clearmake configuration records.
  207. */
  208. #ifndef NoConfigRec
  209. #if HasClearmake
  210. #define NoConfigRec(targ) @@\
  211. XCOMM special target for clearmake @@\
  212. .NO_CONFIG_REC: targ
  213. #else
  214. #define NoConfigRec(targ) /**/
  215. #endif
  216. #endif
  217. /*
  218. * Concat - concatenates two strings.
  219. */
  220. #ifndef Concat
  221. #if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
  222. #define Concat(a,b)a##b
  223. #else
  224. #define Concat(a,b)a/**/b
  225. #endif
  226. #endif
  227. /*
  228. * Concat3 - concatenates three strings.
  229. */
  230. #ifndef Concat3
  231. #if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
  232. #define Concat3(a,b,c)a##b##c
  233. #else
  234. #define Concat3(a,b,c)a/**/b/**/c
  235. #endif
  236. #endif
  237. /*
  238. * Concat4 - concatenates four strings.
  239. */
  240. #ifndef Concat4
  241. #if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
  242. #define Concat4(a,b,c,d)a##b##c##d
  243. #else
  244. #define Concat4(a,b,c,d)a/**/b/**/c/**/d
  245. #endif
  246. #endif
  247. /*
  248. * _XUse - makes a choice based on UseInstalledX11.
  249. */
  250. #ifndef _XUse
  251. # if defined(UseInstalled) || UseInstalledX11
  252. # define _XUse(a,b) a
  253. # else
  254. # define _XUse(a,b) b
  255. # endif
  256. #endif /* _XUse */
  257. /*
  258. * _Use - makes a choice based on UseInstalled.
  259. */
  260. #ifndef _Use
  261. # define _Use _XUse
  262. #endif /* _Use */
  263. /*
  264. * _XUseCat - combination of _XUse and Concat.
  265. * exists to avoid problems with some preprocessors
  266. */
  267. #ifndef _XUseCat
  268. # if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
  269. # if defined(UseInstalled) || UseInstalledX11
  270. # define _XUseCat(a,b,c) a##c
  271. # else
  272. # define _XUseCat(a,b,c) b##c
  273. # endif
  274. # else
  275. # if defined(UseInstalled) || UseInstalledX11
  276. # define _XUseCat(a,b,c) a/**/c
  277. # else
  278. # define _XUseCat(a,b,c) b/**/c
  279. # endif
  280. # endif
  281. #endif /* _XUseCat */
  282. /*
  283. * _UseCat - combination of _Use and Concat.
  284. * exists to avoid problems with some preprocessors
  285. */
  286. #ifndef _UseCat
  287. # define _UseCat _XUseCat
  288. #endif /* _UseCat */
  289. #ifndef ProgramTargetName
  290. #define ProgramTargetName(target)target
  291. #endif
  292. #ifndef RunProgram
  293. #define RunProgram(progvar,options) $(progvar) options
  294. #endif
  295. #ifndef RunProgramWithSetup
  296. #define RunProgramWithSetup(setup,progvar,options) setup $(progvar) options
  297. #endif
  298. #ifndef RemoveFile
  299. #define RemoveFile(file) $(RM) file
  300. #endif /* RemoveFile */
  301. #ifndef RemoveFiles
  302. #define RemoveFiles(files) $(RM) files
  303. #endif /* RemoveFiles */
  304. /*
  305. * CenterLoadTarget - generate rules to load files into CodeCenter
  306. */
  307. #ifndef CenterLoadTarget
  308. #if HasCodeCenter
  309. #define CenterLoadTarget(target,srclist,libs,defines) @@\
  310. ProgramTargetName(target):: srclist @@\
  311. XCOMM load defines srclist libs
  312. #else
  313. #define CenterLoadTarget(target,srclist,libs,defines) /**/
  314. #endif
  315. #endif /* CenterLoadTarget */
  316. /*
  317. * CenterProgramTarget - generate rules to make CodeCenter read in sources
  318. * and objects.
  319. */
  320. #ifndef CenterProgramTarget
  321. #define CenterProgramTarget(program,srclist,objlist,locallibs,syslibs) @@\
  322. CenterLoadTarget(Concat(debug_,program),srclist,$(EXTRA_LDOPTIONS) $(LOCAL_LDFLAGS) $(LDPRELIBS) locallibs $(LDLIBS) syslibs,$(ALLDEFINES)) @@\
  323. @@\
  324. CenterLoadTarget(Concat(odebug_,program),objlist,$(EXTRA_LDOPTIONS) $(LOCAL_LDFLAGS) $(LDPRELIBS) locallibs $(LDLIBS) syslibs,$(ALLDEFINES))
  325. #endif /* CenterProgramTarget */
  326. #ifndef SentinelLinkTarget
  327. #if HasSentinel
  328. #define SentinelLinkTarget(step,program,linklist) @@\
  329. ProgramTargetName(step.sentinel): @@\
  330. RemoveTargetProgram($@) @@\
  331. $(CCENVSETUP) $(SENTINEL) $(SENTINELOPTIONS) $(CC) -o program.sentinel $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS)
  332. #else
  333. #define SentinelLinkTarget(step,program,linklist) /**/
  334. #endif
  335. #endif /* SentinelLinkTarget */
  336. /*
  337. * SentinelProgramTarget - generate rules to make Sentinel image
  338. */
  339. #ifndef SentinelProgramTarget
  340. #if HasSentinel
  341. #define SentinelProgramTarget(program,deplist,linklist) @@\
  342. ProgramTargetName(program.sentinel): deplist @@\
  343. RemoveTargetProgram($@) @@\
  344. $(CCENVSETUP) $(SENTINEL) $(SENTINELOPTIONS) $(CC) -o $@ $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
  345. @@\
  346. clean clean.sentinel:: @@\
  347. RemoveFile(program.sentinel)
  348. #else
  349. #define SentinelProgramTarget(program,deplist,linklist) /**/
  350. #endif
  351. #endif /* SentinelProgramTarget */
  352. /*
  353. * SentinelCplusplusProgramTarget - generate rules to make Sentinel image
  354. */
  355. #ifndef SentinelCplusplusProgramTarget
  356. #if HasSentinel
  357. #define SentinelCplusplusProgramTarget(program,deplist,linklist) @@\
  358. ProgramTargetName(program.sentinel): deplist @@\
  359. RemoveTargetProgram($@) @@\
  360. $(CXXENVSETUP) $(SENTINEL) $(SENTINELOPTIONS) $(CXX) -o $@ $(CXXLDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
  361. @@\
  362. clean clean.sentinel:: @@\
  363. RemoveFile(program.sentinel)
  364. #else
  365. #define SentinelCplusplusProgramTarget(program,deplist,linklist) /**/
  366. #endif
  367. #endif /* SentinelCplusplusProgramTarget */
  368. #ifndef PurifyLinkTarget
  369. #if HasPurify
  370. #define PurifyLinkTarget(step,program,linklist) @@\
  371. ProgramTargetName(step.pure): @@\
  372. RemoveTargetProgram($@) @@\
  373. $(CCENVSETUP) $(PURIFY) $(PURIFYOPTIONS) $(CC) -o program.pure $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS)
  374. #else
  375. #define PurifyLinkTarget(step,program,linklist) /**/
  376. #endif
  377. #endif /* PurifyLinkTarget */
  378. /*
  379. * PurifyProgramTarget - generate rules to make Purify'ed image
  380. */
  381. #ifndef PurifyProgramTarget
  382. #if HasPurify
  383. #define PurifyProgramTarget(program,deplist,linklist) @@\
  384. ProgramTargetName(program.pure): deplist @@\
  385. RemoveTargetProgram($@) @@\
  386. $(CCENVSETUP) $(PURIFY) $(PURIFYOPTIONS) $(CC) -o $@ $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
  387. @@\
  388. clean clean.pure:: @@\
  389. RemoveFile(program.pure)
  390. #else
  391. #define PurifyProgramTarget(program,deplist,linklist) /**/
  392. #endif
  393. #endif /* PurifyProgramTarget */
  394. /*
  395. * PurifyCplusplusProgramTarget - generate rules to make Purify'ed image
  396. */
  397. #ifndef PurifyCplusplusProgramTarget
  398. #if HasPurify
  399. #define PurifyCplusplusProgramTarget(program,deplist,linklist) @@\
  400. ProgramTargetName(program.pure): deplist @@\
  401. RemoveTargetProgram($@) @@\
  402. $(CXXENVSETUP) $(PURIFY) $(PURIFYOPTIONS) $(CXX) -o $@ $(CXXLDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
  403. @@\
  404. clean clean.pure:: @@\
  405. RemoveFile(program.pure)
  406. #else
  407. #define PurifyCplusplusProgramTarget(program,deplist,linklist) /**/
  408. #endif
  409. #endif /* PurifyCplusplusProgramTarget */
  410. #ifndef ProofLinkTarget
  411. #if HasTestCenter
  412. #define ProofLinkTarget(step,program,linklist) @@\
  413. ProgramTargetName(step.tc): @@\
  414. RemoveTargetProgram($@) @@\
  415. $(CCENVSETUP) $(PROOF) $(PROOFOPTIONS) $(CC) -o program.tc $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS)
  416. #else
  417. #define ProofLinkTarget(step,program,linklist) /**/
  418. #endif
  419. #endif /* ProofLinkTarget */
  420. /*
  421. * ProofProgramTarget - generate rules to make Proof'ed image
  422. */
  423. #ifndef ProofProgramTarget
  424. #if HasTestCenter
  425. #define ProofProgramTarget(program,deplist,linklist) @@\
  426. ProgramTargetName(program.tc): deplist @@\
  427. RemoveTargetProgram($@) @@\
  428. $(CCENVSETUP) $(PROOF) $(PROOFOPTIONS) $(CC) -o $@ $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
  429. @@\
  430. clean clean.tc:: @@\
  431. RemoveFiles(program.tc program.tc.*.*)
  432. #else
  433. #define ProofProgramTarget(program,deplist,linklist) /**/
  434. #endif
  435. #endif /* ProofProgramTarget */
  436. /*
  437. * ProofCplusplusProgramTarget - generate rules to make Proof'ed image
  438. */
  439. #ifndef ProofCplusplusProgramTarget
  440. #if HasTestCenter
  441. #define ProofCplusplusProgramTarget(program,deplist,linklist) @@\
  442. ProgramTargetName(program.tc): deplist @@\
  443. RemoveTargetProgram($@) @@\
  444. $(CXXENVSETUP) $(PROOF) $(PROOFOPTIONS) $(CXX) -o $@ $(CXXLDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
  445. @@\
  446. clean clean.tc:: @@\
  447. RemoveFiles(program.tc program.tc.*.*)
  448. #else
  449. #define ProofCplusplusProgramTarget(program,deplist,linklist) /**/
  450. #endif
  451. #endif /* ProofCplusplusProgramTarget */
  452. #ifndef ProofCleanTarget
  453. #if HasTestCenter
  454. #define ProofCleanTarget() @@\
  455. clean clean.tc:: @@\
  456. $(RM) -r TC.Cache
  457. #else
  458. #define ProofCleanTarget() /**/
  459. #endif
  460. #endif /* ProofCleanTarget */
  461. #ifndef RemoveTargetProgram
  462. #if RemoveTargetProgramByMoving
  463. #define RemoveTargetProgram(program) \
  464. -if [ -f program ]; then RemoveFile(Concat(program,~)); $(MV) program Concat(program,~); fi
  465. #else
  466. #define RemoveTargetProgram(program) RemoveFile(program)
  467. #endif
  468. #endif /* RemoveTargetProgram */
  469. #ifndef MakeDir
  470. #define MakeDir(dir) DirFailPrefix@if [ -d dir ]; then set +x; \ @@\
  471. else (set -x; $(MKDIRHIER) dir); fi
  472. #endif /* MakeDir */
  473. #ifndef BuildIncludesTop
  474. #define BuildIncludesTop(srclist) @@\
  475. includes:: srclist @@\
  476. MakeDir($(BUILDINCDIR)) @@\
  477. @(set -x; cd $(BUILDINCDIR); for i in srclist; do \ @@\
  478. RemoveFile($$i); \ @@\
  479. $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/$$i .; \ @@\
  480. done)
  481. #endif /* BuildIncludesTop */
  482. #ifndef BuildIncludes
  483. #define BuildIncludes(srclist,dstsubdir,dstupdir) @@\
  484. includes:: srclist @@\
  485. MakeDir($(BUILDINCDIR)/dstsubdir) @@\
  486. @(set -x; cd $(BUILDINCDIR)/dstsubdir; for i in srclist; do \ @@\
  487. RemoveFile($$i); \ @@\
  488. $(LN) $(BUILDINCTOP)/dstupdir/$(CURRENT_DIR)/$$i .; \ @@\
  489. done)
  490. #endif /* BuildIncludes */
  491. /*
  492. * LinkBuildBinary - export a binary from the build tree.
  493. */
  494. #ifndef LinkBuildBinary
  495. #define LinkBuildBinary(binary) @@\
  496. all:: $(BUILDBINDIR)/binary binary @@\
  497. @@\
  498. $(BUILDBINDIR)/binary: binary @@\
  499. RemoveFile($@) @@\
  500. cd $(BUILDBINDIR) && $(LN) $(BUILDBINTOP)/$(CURRENT_DIR)/binary .
  501. #endif /* LinkBuildBinary */
  502. #ifndef BuildInterfaces
  503. #define BuildInterfaces(srclist,dstsubdir,dstupdir) @@\
  504. interfaces:: @@\
  505. MakeDir($(BUILDINCDIR)/dstsubdir) @@\
  506. @(set -x; cd $(BUILDINCDIR)/dstsubdir; for i in srclist; do \ @@\
  507. RemoveFile($$i); \ @@\
  508. $(LN) $(BUILDINCTOP)/dstupdir/$(CURRENT_DIR)/$$i .; \ @@\
  509. done)
  510. #endif /* BuildInterfaces */
  511. /*
  512. * LinkRule - link a program
  513. */
  514. #ifndef LinkRule
  515. #define LinkRule(program,options,objects,libraries) \
  516. $(CCLINK) -o program options objects libraries $(EXTRA_LOAD_FLAGS)
  517. #endif /* LinkRule */
  518. /*
  519. * HostLinkRule - link a utility to be used on the build host
  520. * (differs from LinkRule if cross compiling)
  521. */
  522. #ifndef HostLinkRule
  523. #define HostLinkRule LinkRule
  524. #endif
  525. #ifndef CplusplusLinkRule
  526. #define CplusplusLinkRule(program,options,objects,libraries) \
  527. $(CXXLINK) -o program options objects libraries $(EXTRA_LOAD_FLAGS)
  528. #endif /* CplusplusLinkRule */
  529. /*
  530. * NormalProgramTarget - generate rules to compile and link the indicated
  531. * program; since it does not use any default object files, it may be used for
  532. * multiple programs in the same Imakefile.
  533. */
  534. #ifndef NormalProgramTarget
  535. #define NormalProgramTarget(program,objects,deplibs,locallibs,syslibs) @@\
  536. ProgramTargetName(program): objects deplibs @@\
  537. RemoveTargetProgram($@) @@\
  538. LinkRule($@,$(LDOPTIONS),objects,locallibs $(LDLIBS) syslibs) @@\
  539. @@\
  540. SentinelProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
  541. PurifyProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
  542. ProofProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
  543. @@\
  544. clean:: @@\
  545. RemoveFile(ProgramTargetName(program))
  546. #endif /* NormalProgramTarget */
  547. /*
  548. * NormalCplusplusProgramTarget - Like NormalTargetProgram, but uses
  549. * C++ linking rules.
  550. */
  551. #ifndef NormalCplusplusProgramTarget
  552. #define NormalCplusplusProgramTarget(program,objects,deplibs,locallibs,syslibs) @@\
  553. ProgramTargetName(program): objects deplibs @@\
  554. RemoveTargetProgram($@) @@\
  555. CplusplusLinkRule($@,$(CXXLDOPTIONS),objects,locallibs $(LDLIBS) syslibs) @@\
  556. @@\
  557. SentinelCplusplusProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
  558. PurifyCplusplusProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
  559. ProofCplusplusProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
  560. @@\
  561. clean:: @@\
  562. RemoveFile(ProgramTargetName(program))
  563. #endif /* NormalCplusplusProgramTarget */
  564. #ifndef SetUIDProgramTarget
  565. #define SetUIDProgramTarget NormalProgramTarget
  566. #endif
  567. /*
  568. * SingleProgramTarget - obsolete version of NormalProgramTarget that does
  569. * not have deplibs.
  570. */
  571. #ifndef SingleProgramTarget
  572. #define SingleProgramTarget(program,objects,locallibs,syslibs) @@\
  573. NormalProgramTarget(program,objects,NullParameter,locallibs,syslibs)
  574. #endif /* SingleProgramTarget */
  575. /*
  576. * SimpleProgramTarget - generate rules for compiling and linking programs
  577. * that only have one C source file. It should only be used in Imakefiles
  578. * that describe a single program.
  579. */
  580. #ifndef SimpleProgramTarget
  581. #define SimpleProgramTarget(program) @@\
  582. OBJS = program.o @@\
  583. SRCS = program.c @@\
  584. @@\
  585. ComplexProgramTarget(program)
  586. #endif /* SimpleProgramTarget */
  587. #ifndef SimpleCplusplusProgramTarget
  588. #define SimpleCplusplusProgramTarget(program) @@\
  589. OBJS = program.o @@\
  590. SRCS = program.CCsuf @@\
  591. @@\
  592. ComplexCplusplusProgramTarget(program)
  593. #endif /* SimpleCplusplusProgramTarget */
  594. #ifndef ProgramTargetHelper
  595. #define ProgramTargetHelper(program,srcs,objs,deplib,locallib,syslib) @@\
  596. ProgramTargetName(program): $(objs) $(deplib) @@\
  597. RemoveTargetProgram($@) @@\
  598. LinkRule($@,$(LDOPTIONS),$(objs),locallib $(LDLIBS) syslib) @@\
  599. @@\
  600. CenterProgramTarget(program,$(srcs),$(objs),locallib,syslib) @@\
  601. SentinelProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
  602. PurifyProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
  603. ProofProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
  604. @@\
  605. InstallProgram(program,$(BINDIR)) @@\
  606. InstallManPage(program,$(MANDIR))
  607. #endif /* ProgramTargetHelper */
  608. #ifndef CplusplusProgramTargetHelper
  609. #define CplusplusProgramTargetHelper(program,srcs,objs,deplib,locallib,syslib) @@\
  610. ProgramTargetName(program): $(objs) $(deplib) @@\
  611. RemoveTargetProgram($@) @@\
  612. CplusplusLinkRule($@,$(CXXLDOPTIONS),$(objs),locallib $(LDLIBS) syslib) @@\
  613. @@\
  614. CenterProgramTarget(program,$(srcs),$(objs),locallib,syslib) @@\
  615. SentinelCplusplusProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
  616. PurifyCplusplusProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
  617. ProofCplusplusProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
  618. @@\
  619. InstallProgram(program,$(BINDIR)) @@\
  620. InstallManPage(program,$(MANDIR))
  621. #endif /* CplusplusProgramTargetHelper */
  622. /*
  623. * ComplexProgramTarget - generate rules for compiling and linking the
  624. * program specified by $(OBJS) and $(SRCS), installing the program and its
  625. * man page, and generating dependencies. It should only be used in
  626. * Imakefiles that describe a single program.
  627. */
  628. #ifndef ComplexProgramTarget
  629. #define ComplexProgramTarget(program) @@\
  630. PROGRAM = program @@\
  631. @@\
  632. AllTarget(program) @@\
  633. @@\
  634. ProgramTargetHelper(program,SRCS,OBJS,DEPLIBS,$(LOCAL_LIBRARIES),NullParameter) @@\
  635. @@\
  636. DependTarget() @@\
  637. LintTarget() @@\
  638. @@\
  639. clean:: @@\
  640. RemoveFile(ProgramTargetName(program))
  641. #endif /* ComplexProgramTarget */
  642. #ifndef ComplexCplusplusProgramTarget
  643. #define ComplexCplusplusProgramTarget(program) @@\
  644. PROGRAM = program @@\
  645. @@\
  646. AllTarget(program) @@\
  647. @@\
  648. CplusplusProgramTargetHelper(program,SRCS,OBJS,DEPLIBS,$(LOCAL_LIBRARIES),NullParameter) @@\
  649. @@\
  650. DependTarget() @@\
  651. LintTarget() @@\
  652. @@\
  653. clean:: @@\
  654. RemoveFile(ProgramTargetName(program))
  655. #endif /* ComplexCplusplusProgramTarget */
  656. /*
  657. * ComplexProgramTarget_1 - generate rules for compiling and linking the
  658. * program specified by $(OBJS1) and $(SRCS1), installing the program and its
  659. * man page, and generating dependencies for it and any programs described
  660. * by $(SRCS2) throgh $(SRCS10). It should be used to build the primary
  661. * program in Imakefiles that describe multiple programs.
  662. */
  663. #ifndef ComplexProgramTarget_1
  664. #define ComplexProgramTarget_1(program,locallib,syslib) @@\
  665. OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) \ @@\
  666. $(OBJS6) $(OBJS7) $(OBJS8) $(OBJS9) $(OBJS10) @@\
  667. SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(SRCS4) $(SRCS5) \ @@\
  668. $(SRCS6) $(SRCS7) $(SRCS8) $(SRCS9) $(SRCS10) @@\
  669. @@\
  670. AllTarget($(PROGRAMS)) @@\
  671. @@\
  672. ProgramTargetHelper(program,SRCS1,OBJS1,DEPLIBS1,locallib,syslib) @@\
  673. @@\
  674. DependTarget() @@\
  675. LintTarget() @@\
  676. @@\
  677. clean:: @@\
  678. RemoveFiles($(PROGRAMS))
  679. #endif /* ComplexProgramTarget_1 */
  680. #ifndef ComplexCplusplusProgramTarget_1
  681. #define ComplexCplusplusProgramTarget_1(program,locallib,syslib) @@\
  682. OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) \ @@\
  683. $(OBJS6) $(OBJS7) $(OBJS8) $(OBJS9) $(OBJS10) @@\
  684. SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(SRCS4) $(SRCS5) \ @@\
  685. $(SRCS6) $(SRCS7) $(SRCS8) $(SRCS9) $(SRCS10) @@\
  686. @@\
  687. AllTarget($(PROGRAMS)) @@\
  688. @@\
  689. CplusplusProgramTargetHelper(program,SRCS1,OBJS1,DEPLIBS1,locallib,syslib)@@\
  690. @@\
  691. DependTarget() @@\
  692. LintTarget() @@\
  693. @@\
  694. clean:: @@\
  695. RemoveFiles($(PROGRAMS))
  696. #endif /* ComplexCplusplusProgramTarget_1 */
  697. /*
  698. * ComplexProgramTarget_2 - generate rules for compiling and linking the
  699. * program specified by $(OBJS2) and $(SRCS2) and installing the program and
  700. * man page. It should be used to build the second program in Imakefiles
  701. * describing more than one program.
  702. */
  703. #ifndef ComplexProgramTarget_2
  704. #define ComplexProgramTarget_2(program,locallib,syslib) @@\
  705. ProgramTargetHelper(program,SRCS2,OBJS2,DEPLIBS2,locallib,syslib)
  706. #endif /* ComplexProgramTarget_2 */
  707. #ifndef ComplexCplusplusProgramTarget_2
  708. #define ComplexCplusplusProgramTarget_2(program,locallib,syslib) @@\
  709. CplusplusProgramTargetHelper(program,SRCS2,OBJS2,DEPLIBS2,locallib,syslib)
  710. #endif /* ComplexCplusplusProgramTarget_2 */
  711. /*
  712. * ComplexProgramTarget_3 - generate rules for compiling and linking the
  713. * program specified by $(OBJS3) and $(SRCS3) and installing the program and
  714. * man page. It should be used to build the third program in Imakefiles
  715. * describing more than one program.
  716. */
  717. #ifndef ComplexProgramTarget_3
  718. #define ComplexProgramTarget_3(program,locallib,syslib) @@\
  719. ProgramTargetHelper(program,SRCS3,OBJS3,DEPLIBS3,locallib,syslib)
  720. #endif /* ComplexProgramTarget_3 */
  721. #ifndef ComplexCplusplusProgramTarget_3
  722. #define ComplexCplusplusProgramTarget_3(program,locallib,syslib) @@\
  723. CplusplusProgramTargetHelper(program,SRCS3,OBJS3,DEPLIBS3,locallib,syslib)
  724. #endif /* ComplexCplusplusProgramTarget_3 */
  725. /*
  726. * ComplexProgramTarget_4 - generate rules for compiling and linking the
  727. * program specified by $(OBJS4) and $(SRCS4) and installing the program and
  728. * man page. It should be used to build the third program in Imakefiles
  729. * describing more than one program.
  730. */
  731. #ifndef ComplexProgramTarget_4
  732. #define ComplexProgramTarget_4(program,locallib,syslib) @@\
  733. ProgramTargetHelper(program,SRCS4,OBJS4,DEPLIBS4,locallib,syslib)
  734. #endif /* ComplexProgramTarget_4 */
  735. #ifndef ComplexCplusplusProgramTarget_4
  736. #define ComplexCplusplusProgramTarget_4(program,locallib,syslib) @@\
  737. CplusplusProgramTargetHelper(program,SRCS4,OBJS4,DEPLIBS4,locallib,syslib)
  738. #endif /* ComplexCplusplusProgramTarget_4 */
  739. /*
  740. * ComplexProgramTarget_5 - generate rules for compiling and linking the
  741. * program specified by $(OBJS5) and $(SRCS5) and installing the program and
  742. * man page. It should be used to build the third program in Imakefiles
  743. * describing more than one program.
  744. */
  745. #ifndef ComplexProgramTarget_5
  746. #define ComplexProgramTarget_5(program,locallib,syslib) @@\
  747. ProgramTargetHelper(program,SRCS5,OBJS5,DEPLIBS5,locallib,syslib)
  748. #endif /* ComplexProgramTarget_5 */
  749. #ifndef ComplexCplusplusProgramTarget_5
  750. #define ComplexCplusplusProgramTarget_5(program,locallib,syslib) @@\
  751. CplusplusProgramTargetHelper(program,SRCS5,OBJS5,DEPLIBS5,locallib,syslib)
  752. #endif /* ComplexCplusplusProgramTarget_5 */
  753. /*
  754. * ComplexProgramTarget_6 - generate rules for compiling and linking the
  755. * program specified by $(OBJS6) and $(SRCS6) and installing the program and
  756. * man page. It should be used to build the third program in Imakefiles
  757. * describing more than one program.
  758. */
  759. #ifndef ComplexProgramTarget_6
  760. #define ComplexProgramTarget_6(program,locallib,syslib) @@\
  761. ProgramTargetHelper(program,SRCS6,OBJS6,DEPLIBS6,locallib,syslib)
  762. #endif /* ComplexProgramTarget_6 */
  763. #ifndef ComplexCplusplusProgramTarget_6
  764. #define ComplexCplusplusProgramTarget_6(program,locallib,syslib) @@\
  765. CplusplusProgramTargetHelper(program,SRCS6,OBJS6,DEPLIBS6,locallib,syslib)
  766. #endif /* ComplexCplusplusProgramTarget_6 */
  767. /*
  768. * ComplexProgramTarget_7 - generate rules for compiling and linking the
  769. * program specified by $(OBJS7) and $(SRCS7) and installing the program and
  770. * man page. It should be used to build the third program in Imakefiles
  771. * describing more than one program.
  772. */
  773. #ifndef ComplexProgramTarget_7
  774. #define ComplexProgramTarget_7(program,locallib,syslib) @@\
  775. ProgramTargetHelper(program,SRCS7,OBJS7,DEPLIBS7,locallib,syslib)
  776. #endif /* ComplexProgramTarget_7 */
  777. #ifndef ComplexCplusplusProgramTarget_7
  778. #define ComplexCplusplusProgramTarget_7(program,locallib,syslib) @@\
  779. CplusplusProgramTargetHelper(program,SRCS7,OBJS7,DEPLIBS7,locallib,syslib)
  780. #endif /* ComplexCplusplusProgramTarget_7 */
  781. /*
  782. * ComplexProgramTarget_8 - generate rules for compiling and linking the
  783. * program specified by $(OBJS8) and $(SRCS8) and installing the program and
  784. * man page. It should be used to build the third program in Imakefiles
  785. * describing more than one program.
  786. */
  787. #ifndef ComplexProgramTarget_8
  788. #define ComplexProgramTarget_8(program,locallib,syslib) @@\
  789. ProgramTargetHelper(program,SRCS8,OBJS8,DEPLIBS8,locallib,syslib)
  790. #endif /* ComplexProgramTarget_8 */
  791. #ifndef ComplexCplusplusProgramTarget_8
  792. #define ComplexCplusplusProgramTarget_8(program,locallib,syslib) @@\
  793. CplusplusProgramTargetHelper(program,SRCS8,OBJS8,DEPLIBS8,locallib,syslib)
  794. #endif /* ComplexCplusplusProgramTarget_8 */
  795. /*
  796. * ComplexProgramTarget_9 - generate rules for compiling and linking the
  797. * program specified by $(OBJS9) and $(SRCS9) and installing the program and
  798. * man page. It should be used to build the third program in Imakefiles
  799. * describing more than one program.
  800. */
  801. #ifndef ComplexProgramTarget_9
  802. #define ComplexProgramTarget_9(program,locallib,syslib) @@\
  803. ProgramTargetHelper(program,SRCS9,OBJS9,DEPLIBS9,locallib,syslib)
  804. #endif /* ComplexProgramTarget_9 */
  805. #ifndef ComplexCplusplusProgramTarget_9
  806. #define ComplexCplusplusProgramTarget_9(program,locallib,syslib) @@\
  807. CplusplusProgramTargetHelper(program,SRCS9,OBJS9,DEPLIBS9,locallib,syslib)
  808. #endif /* ComplexCplusplusProgramTarget_9 */
  809. /*
  810. * ComplexProgramTarget_10 - generate rules for compiling and linking the
  811. * program specified by $(OBJS10) and $(SRCS10) and installing the program and
  812. * man page. It should be used to build the third program in Imakefiles
  813. * describing more than one program.
  814. */
  815. #ifndef ComplexProgramTarget_10
  816. #define ComplexProgramTarget_10(program,locallib,syslib) @@\
  817. ProgramTargetHelper(program,SRCS10,OBJS10,DEPLIBS10,locallib,syslib)
  818. #endif /* ComplexProgramTarget_10 */
  819. #ifndef ComplexCplusplusProgramTarget_10
  820. #define ComplexCplusplusProgramTarget_10(program,locallib,syslib) @@\
  821. CplusplusProgramTargetHelper(program,SRCS10,OBJS10,DEPLIBS10,locallib,syslib)
  822. #endif /* ComplexCplusplusProgramTarget_10 */
  823. #ifndef MoveToBakFile
  824. #define MoveToBakFile(file) -@if [ -f file ]; then set -x; \ @@\
  825. $(MV) file file.bak; else exit 0; fi
  826. #endif /* MoveToBakFile */
  827. #ifndef RMoveToBakFile
  828. #define RMoveToBakFile(file) -@if [ -f file ]; then set -x; \ @@\
  829. RemoveFile(file.bak); $(MV) file file.bak; \ @@\
  830. else exit 0; fi
  831. #endif /* RMoveToBakFile */
  832. /*
  833. * ServerTargetWithFlags - generate rules to compile, link, and relink a server
  834. */
  835. #ifndef ServerTargetWithFlags
  836. #define ServerTargetWithFlags(server,subdirs,objects,libs,syslibs,flags) @@\
  837. AllTarget(server) @@\
  838. ProgramTargetName(server): subdirs objects libs @@\
  839. MoveToBakFile($@) @@\
  840. LinkRule($@,$(LDOPTIONS),objects,libs $(LDLIBS) syslibs) @@\
  841. @@\
  842. Concat(load,server): @@\
  843. MoveToBakFile(ProgramTargetName(server)) @@\
  844. LinkRule(ProgramTargetName(server),$(LDOPTIONS),objects,libs $(LDLIBS) syslibs) @@\
  845. @@\
  846. loadX:: Concat(load,server) @@\
  847. @@\
  848. SentinelProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
  849. SentinelLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
  850. PurifyProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
  851. PurifyLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
  852. ProofProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
  853. ProofLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
  854. @@\
  855. InstallProgramWithFlags(server,$(BINDIR),flags) @@\
  856. @@\
  857. clean:: @@\
  858. RemoveFile(ProgramTargetName(server))
  859. #endif /* ServerTargetWithFlags */
  860. /*
  861. * ServerTarget - rules to compile, link, and relink a normal server
  862. */
  863. #ifndef ServerTarget
  864. #define ServerTarget(server,subdirs,objects,libs,syslibs) @@\
  865. ServerTargetWithFlags(server,subdirs,objects,libs,syslibs,$(_NOOP_))
  866. #endif /* ServerTarget */
  867. #if DoRanlibCmd
  868. #define RanLibrary(args) $(RANLIB) args
  869. #else
  870. #define RanLibrary(args) $(_NULLCMD_)
  871. #endif
  872. #ifndef LibraryTargetName
  873. #define LibraryTargetName(libname)Concat(lib,libname.a)
  874. #endif
  875. #ifndef LibraryTargetNameSuffix
  876. #define LibraryTargetNameSuffix(libname,suffix)Concat3(lib,libname,suffix.a)
  877. #endif
  878. #ifndef InstallNamedTarget
  879. #define InstallNamedTarget(step,srcname,flags,dest,dstname) @@\
  880. step:: srcname @@\
  881. MakeDir($(DESTDIR)dest) @@\
  882. $(INSTALL) $(INSTALLFLAGS) flags srcname $(DESTDIR)dest/dstname
  883. #endif /* InstallNamedTarget */
  884. /*
  885. * InstallNamedTargetNoClobber - Like InstallNamedTarget, but doesn't
  886. * do the install if an installed version already exists. Useful
  887. * for files that might have local customizations that you don't
  888. * want to clobber. Config files are good candidates for this.
  889. */
  890. #ifndef InstallNamedTargetNoClobber
  891. #define InstallNamedTargetNoClobber(step,srcname,flags,dest,dstname) @@\
  892. step:: srcname @@\
  893. MakeDir($(DESTDIR)dest) @@\
  894. @if [ -f $(DESTDIR)dest/dstname ]; then \ @@\
  895. echo "Not overwriting existing" $(DESTDIR)dest/dstname; \ @@\
  896. else set -x; \ @@\
  897. $(INSTALL) $(INSTALLFLAGS) flags srcname $(DESTDIR)dest/dstname; fi
  898. #endif /* InstallNamedTargetNoClobber */
  899. #ifndef InstallTarget
  900. #define InstallTarget(step,file,flags,dest) @@\
  901. InstallNamedTarget(step,file,flags,dest,file)
  902. #endif /* InstallTarget */
  903. /*
  904. * InstallLibrary - generate rules to install the indicated library.
  905. */
  906. #ifndef InstallLibrary
  907. #define InstallLibrary(libname,dest) @@\
  908. install:: LibraryTargetName(libname) @@\
  909. MakeDir($(DESTDIR)dest) @@\
  910. $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) LibraryTargetName(libname) $(DESTDIR)dest @@\
  911. RanLibrary($(RANLIBINSTFLAGS) $(DESTDIR)dest/LibraryTargetName(libname))
  912. #endif /* InstallLibrary */
  913. /*
  914. * InstallLinkKitLibrary - rule to install Link Kit library.
  915. * (only used for XFree86). This is a no-op
  916. * rule so that Imakefiles on non-XFree86 systems
  917. * continue to build Makefiles correctly.
  918. */
  919. #ifndef InstallLinkKitLibrary
  920. #define InstallLinkKitLibrary(lib,dir)
  921. #endif
  922. /*
  923. * InstallLinkKitNamedLibrary - rule to install Link Kit library.
  924. * (only used for XFree86). This is a no-op
  925. * rule so that Imakefiles on non-XFree86 systems
  926. * continue to build Makefiles correctly.
  927. */
  928. #ifndef InstallLinkKitNamedLibrary
  929. #define InstallLinkKitNamedLibrary(lib,dlib,dir)
  930. #endif
  931. /*
  932. * MergeIntoInstalledLibrary - generate rules to merge one library into another
  933. */
  934. #ifndef MergeIntoInstalledLibrary
  935. #define MergeIntoInstalledLibrary(tolib,fromlib) @@\
  936. install:: fromlib @@\
  937. $(SCRIPTSRC)/mergelib $(DESTDIR)tolib fromlib
  938. #endif /* MergeIntoInstalledLibrary */
  939. /*
  940. * InstallLibraryAlias - generate rules to create a link from one library name
  941. * to another for the purposes of aliasing.
  942. */
  943. #ifndef InstallLibraryAlias
  944. #define InstallLibraryAlias(libname,alias,dest) @@\
  945. install:: @@\
  946. -(cd $(DESTDIR)dest; \ @@\
  947. RemoveFile(LibraryTargetName(alias)); \ @@\
  948. $(LN) LibraryTargetName(libname) LibraryTargetName(alias))
  949. #endif /* InstallLibraryAlias */
  950. /*
  951. * InstallLintLibrary - generate rules to install the indicated lint library.
  952. */
  953. #ifndef InstallLintLibrary
  954. #define InstallLintLibrary(libname,dest) @@\
  955. InstallTarget(install.ln,Concat(llib-l,libname.ln),$(INSTLIBFLAGS),dest)
  956. #endif /* InstallLintLibrary */
  957. /*
  958. * InstallManPageLong - generate rules to install the indicated manual page,
  959. * giving it an alternate name. This is used for installing man pages whose
  960. * base name without the .man suffix would normally be longer than 8 characters
  961. * (the limit for using source code control systems on files systems with
  962. * short file names).
  963. */
  964. #ifndef InstallManPageLong
  965. #define InstallManPageLong(file,destdir,dest) @@\
  966. InstallNamedTarget(install.man,file.man,$(INSTMANFLAGS),destdir,dest.$(MANSUFFIX))
  967. #endif /* InstallManPageLong */
  968. /*
  969. * InstallManPage - generate rules to install the indicated manual page.
  970. */
  971. #ifndef InstallManPage
  972. #define InstallManPage(file,destdir) @@\
  973. InstallManPageLong(file,destdir,file)
  974. #endif /* InstallManPage */
  975. /*
  976. * InstallManPageAliases - generate rules to install manual page aliases.
  977. */
  978. #ifndef InstallManPageAliases
  979. #define InstallManPageAliases(file,destdir,aliases) @@\
  980. install.man:: @@\
  981. @(TMP=/tmp/tmp.$$$$; \ @@\
  982. RemoveFile($${TMP}); \ @@\
  983. echo .so `basename destdir`/file.$(MANSUFFIX) > $${TMP}; \ @@\
  984. for i in aliases; do (set -x; \ @@\
  985. $(INSTALL) $(INSTALLFLAGS) $(INSTMANFLAGS) $${TMP} $(DESTDIR)destdir/$$i.$(MANSUFFIX)); \ @@\
  986. done; \ @@\
  987. RemoveFile($${TMP}))
  988. #endif /* InstallManPageAliases */
  989. /*
  990. * ManKeywordsTarget - generate the database used by "man -k".
  991. * This rule updates the index in the directory "manpath", which
  992. * indexes all the manual pages in the section subdirectories under
  993. * it. An update command is defined only on systems that have a
  994. * per MANPATH element index. If the OS supports only one system-wide
  995. * database, we don't update it, because then we can't do cross
  996. * installations or use a non-empty DESTDIR for testing.
  997. */
  998. #ifndef ManKeywordsTarget
  999. #define ManKeywordsTarget(manpath) man_keywords::
  1000. #endif
  1001. /*
  1002. * InstallNamedNonExec - generate rules to install a data file
  1003. */
  1004. #ifndef InstallNamedNonExec
  1005. #define InstallNamedNonExec(srcname,dstname,dest) @@\
  1006. InstallNamedTarget(install,srcname,$(INSTDATFLAGS),dest,dstname)
  1007. #endif /* InstallNamedNonExec */
  1008. /*
  1009. * InstallNonExecFile - generate rules to install a data file
  1010. */
  1011. #ifndef InstallNonExecFile
  1012. #define InstallNonExecFile(file,dest) @@\
  1013. InstallTarget(install,file,$(INSTDATFLAGS),dest)
  1014. #endif /* InstallNonExecFile */
  1015. /*
  1016. * InstallNonExecFileNoClobber - install a data file once
  1017. */
  1018. #ifndef InstallNonExecFileNoClobber
  1019. #define InstallNonExecFileNoClobber(file,dest) @@\
  1020. InstallNamedTargetNoClobber(install,file,$(INSTDATFLAGS),dest,file)
  1021. #endif /* InstallNonExecFileNoClobber */
  1022. /*
  1023. * InstallLinkKitNonExecFile - rule for installing server Link Kit files.
  1024. * (only used for XFree86). This is a no-op
  1025. * rule so that Imakefiles on non-XFree86 systems
  1026. * continue to build Makefiles correctly.
  1027. */
  1028. #ifndef InstallLinkKitNonExecFile
  1029. #define InstallLinkKitNonExecFile(file,dir)
  1030. #endif
  1031. /*
  1032. * InstallNonExec - generate rules to install a data file, but does not
  1033. * try to create the destination directory (deprecated)
  1034. */
  1035. #ifndef InstallNonExec
  1036. #define InstallNonExec(file,dest) @@\
  1037. install:: file @@\
  1038. $(INSTALL) $(INSTALLFLAGS) $(INSTDATFLAGS) file $(DESTDIR)dest
  1039. #endif /* InstallNonExec */
  1040. /*
  1041. * InstallProgramWithFlags - generate rules to install an executable program
  1042. * using given install flags.
  1043. */
  1044. #ifndef InstallProgramWithFlags
  1045. #define InstallProgramWithFlags(program,dest,flags) @@\
  1046. InstallTarget(install,ProgramTargetName(program),$(INSTPGMFLAGS) flags,dest)
  1047. #endif /* InstallProgramWithFlags */
  1048. /*
  1049. * InstallProgram - generate rules to install an executable program using any
  1050. * special install flags set in $(INSTALLFLAGS).
  1051. */
  1052. #ifndef InstallProgram
  1053. #define InstallProgram(program,dest) @@\
  1054. InstallProgramWithFlags(program,dest,NullParameter)
  1055. #endif /* InstallProgram */
  1056. /*
  1057. * InstallScript - install a shell script.
  1058. */
  1059. #ifndef InstallScript
  1060. #define InstallScript(program,dest) @@\
  1061. InstallNamedTarget(install,program.script,$(INSTBINFLAGS),dest,program)
  1062. #endif /* InstallScript */
  1063. /*
  1064. * InstallNamedProg - install a program with renaming and no stripping.
  1065. */
  1066. #ifndef InstallNamedProg
  1067. #define InstallNamedProg(srcname,dstname,dest) @@\
  1068. InstallNamedTarget(install,srcname,$(INSTBINFLAGS),dest,dstname)
  1069. #endif /* InstallNamedProg */
  1070. /*
  1071. * InstallNamedProgNoClobber - Like InstallNamedProg, but doesn't
  1072. * do the install if an installed version already exists.
  1073. */
  1074. #ifndef InstallNamedProgNoClobber
  1075. #define InstallNamedProgNoClobber(srcname,dstname,dest) @@\
  1076. InstallNamedTargetNoClobber(install,srcname,$(INSTBINFLAGS),dest,dstname)
  1077. #endif /* InstallNamedProgNoClobber */
  1078. /*
  1079. * MakeFlagsToShellFlags - set variables before starting a loop.
  1080. * makeflags is the set of "make" flags to check.
  1081. * shellcmd is the shell command to execute if any of the flags are set.
  1082. *
  1083. * The usual use of this rule is to translate make's "don't quit on error"
  1084. * flags into the equivalent for the shell. To do this, "make -i" always
  1085. * becomes "set +e". "make -k" should also turn on "set +e" if the target
  1086. * is building subdirectories. That is, subdirectories are independent
  1087. * and should appear to be multiple targets, even though they are
  1088. * implemented in a loop in a single target.
  1089. */
  1090. #ifndef MakeFlagsToShellFlags
  1091. #define MakeFlagsToShellFlags(makeflags,shellcmd)\
  1092. for flag in ${MAKEFLAGS} ''; do \ @@\
  1093. case "$$flag" in *=*) ;; *[makeflags]*) shellcmd;; esac; done
  1094. #endif
  1095. /*
  1096. * LinkFileList - link a list of files from one place to another
  1097. */
  1098. #ifndef LinkFileList
  1099. #define LinkFileList(step,list,dir,sub) @@\
  1100. step:: list @@\
  1101. @MakeFlagsToShellFlags(i,set +e); \ @@\
  1102. echo " cd" dir; cd dir && \ @@\
  1103. for i in list; do (set -x; RemoveFile($$i); $(LN) sub/$$i .); done
  1104. #endif
  1105. /*
  1106. * LinkVarDirectory
  1107. *
  1108. * Make links from $LIBDIR (<ProjectRoot>/lib/X11) to /var/X11/
  1109. * For example /usr/X11R6/lib/X11/xdm ==> /var/X11/xdm so that X
  1110. * binaries can be mounted from a read-only volume like a CD-ROM;
  1111. * but files that may need to be edited can be stored locally on
  1112. * read-write media. If someone has an existing installation, be
  1113. * careful and move existing files to the new location in /var.
  1114. */
  1115. #ifndef LinkVarDirectory
  1116. #if HasVarDirectory
  1117. #define LinkVarDirectory(mdir,cdir,rdir,ldir) @@\
  1118. install:: @@\
  1119. MakeDir(Concat($(DESTDIR)$(LIBDIR)/,cdir)) @@\
  1120. MakeDir(Concat($(VARDIR)/,mdir)) @@\
  1121. @MakeFlagsToShellFlags(i,set +e); \ @@\
  1122. if [ -d Concat($(DESTDIR)$(LIBDIR)/,cdir) ]; then \ @@\
  1123. cd Concat($(DESTDIR)$(LIBDIR)/,cdir); \ @@\
  1124. if [ -d rdir -a ! -h rdir ]; then \ @@\
  1125. (cd rdir; tar cf - . | (cd Concat($(VARDIR)/,mdir); tar xf -; exit 0); exit 0); \ @@\
  1126. fi; \ @@\
  1127. $(RM) -r rdir; \ @@\
  1128. $(LN) Concat($(VARDIR)/,mdir) ldir; \ @@\
  1129. fi
  1130. #else
  1131. #define LinkVarDirectory(mdir,cdir,rdir,ldir)
  1132. #endif
  1133. #endif
  1134. /*
  1135. * InstallMultipleDestFlags - generate rules to install multiple files at
  1136. * once during a particular step in the build using a specific set of install
  1137. * flags.
  1138. */
  1139. #ifndef InstallMultipleDestFlags
  1140. #define InstallMultipleDestFlags(step,list,dest,flags) @@\
  1141. step:: list @@\
  1142. MakeDir($(DESTDIR)dest) @@\
  1143. @MakeFlagsToShellFlags(i,set +e); \ @@\
  1144. for i in list; do \ @@\
  1145. (set -x; $(INSTALL) $(INSTALLFLAGS) flags $$i $(DESTDIR)dest); \ @@\
  1146. done
  1147. #endif /* InstallMultipleDestFlags */
  1148. /*
  1149. * InstallMultipleDest - generate rules to install multiple files at once
  1150. * during a particular step in the build using any install flags set in
  1151. * $(INSTDATFLAGS).
  1152. */
  1153. #ifndef InstallMultipleDest
  1154. #define InstallMultipleDest(step,list,dest) @@\
  1155. InstallMultipleDestFlags(step,list,dest,$(INSTDATFLAGS))
  1156. #endif /* InstallMultipleDest */
  1157. /*
  1158. * InstallMultiple - generate rules to install multiple files at once
  1159. * during the install step of the build using any install flags set in
  1160. * $(INSTALLFLAGS).
  1161. */
  1162. #ifndef InstallMultiple
  1163. #define InstallMultiple(list,dest) @@\
  1164. InstallMultipleDest(install,list,dest)
  1165. #endif /* InstallMultiple */
  1166. /*
  1167. * InstallMultipleFlags - generate rules to install multiple files at once
  1168. * during the install step of the build using the given install flags.
  1169. */
  1170. #ifndef InstallMultipleFlags
  1171. #define InstallMultipleFlags(list,dest,flags) @@\
  1172. InstallMultipleDestFlags(install,list,dest,flags)
  1173. #endif /* InstallMultipleFlags */
  1174. /*
  1175. * InstallMultipleMan - generate rules to install a variety of manual pages
  1176. * during the install.man step of the build.
  1177. */
  1178. #ifndef InstallMultipleMan
  1179. #define InstallMultipleMan(list,dest) @@\
  1180. InstallMultipleDestFlags(install.man,list,dest,$(INSTMANFLAGS))
  1181. #endif /* InstallMultipleMan */
  1182. /*
  1183. * IncludeMakefile - rule to include another Makefile.
  1184. * Must not generate an error or even a warning if the named file
  1185. * is not present, since we use this to include Makefile.dep, which
  1186. * may not be built yet.
  1187. * This is defined non-null iff HasMakefileSafeInclude is YES.
  1188. * The double-@ is to ensure no leading spaces on the line.
  1189. */
  1190. #ifndef IncludeMakefile
  1191. #if HasClearmake
  1192. #define IncludeMakefile(file) @@sinclude file
  1193. #else
  1194. #define IncludeMakefile(file) /**/
  1195. #endif
  1196. #endif
  1197. /*
  1198. * DependDependencyStatement - Used by DependDependency to set up the
  1199. * most specific dependency, which differs based on whether we support
  1200. * a separate Makefile.dep on this platform.
  1201. */
  1202. #ifndef DependDependencyStatement
  1203. #if HasMakefileSafeInclude
  1204. #define DependDependencyStatement() @@\
  1205. DependFileName:: ProgramTargetName($(DEPEND))
  1206. #else
  1207. #define DependDependencyStatement() @@\
  1208. depend:: ProgramTargetName($(DEPEND))
  1209. #endif
  1210. #endif
  1211. /*
  1212. * DependDependency - generate rules to build the makedepend program if
  1213. * this Imakefile is within the source tree.
  1214. */
  1215. #ifndef DependDependency
  1216. #ifdef UseInstalled
  1217. #define DependDependency() /**/
  1218. #else
  1219. #define DependDependency() @@\
  1220. DependDependencyStatement() @@\
  1221. @@\
  1222. NoCmpScript(ProgramTargetName($(DEPEND))) @@\
  1223. @@\
  1224. ProgramTargetName($(DEPEND)): @@\
  1225. @echo "checking $@ over in $(DEPENDSRC) first..."; \ @@\
  1226. cd $(DEPENDSRC) && $(MAKE); \ @@\
  1227. echo "okay, continuing in $(CURRENT_DIR)"
  1228. #endif /* UseInstalled */
  1229. #endif /* DependDependency */
  1230. /*
  1231. * DependTarget - generate rules to compute dependencies for all files listed
  1232. * in $(SRCS).
  1233. */
  1234. #ifndef DependTarget
  1235. #if HasMakefileSafeInclude
  1236. #define DependTarget() @@\
  1237. DependDependency() @@\
  1238. @@\
  1239. depend:: DependFileName @@\
  1240. @@\
  1241. DependFileName:: @@\
  1242. RunProgram(DEPEND,-f- $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- $(SRCS)) > $@
  1243. #else /* HasMakefileSafeInclude */
  1244. #define DependTarget() @@\
  1245. DependDependency() @@\
  1246. @@\
  1247. depend:: @@\
  1248. RunProgram(DEPEND,$(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- $(SRCS))
  1249. #endif /* HasMakefileSafeInclude else */
  1250. #endif /* DependTarget */
  1251. /*
  1252. * DependTarget3 - generate rules to compute dependencies for all files given.
  1253. */
  1254. #ifndef DependTarget3
  1255. #if HasMakefileSafeInclude
  1256. #define DependTarget3(srcs1,srcs2,srcs3) @@\
  1257. DependDependency() @@\
  1258. @@\
  1259. depend:: DependFileName @@\
  1260. @@\
  1261. DependFileName:: @@\
  1262. RunProgram(DEPEND,-f- $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs1) > $@ @@\
  1263. RunProgram(DEPEND,-f- $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs2) >> $@ @@\
  1264. RunProgram(DEPEND,-f- $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs3) >> $@
  1265. #else /* HasMakefileSafeInclude */
  1266. #define DependTarget3(srcs1,srcs2,srcs3) @@\
  1267. DependDependency() @@\
  1268. @@\
  1269. depend:: @@\
  1270. RunProgram(DEPEND,$(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs1) @@\
  1271. RunProgram(DEPEND,-a $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs2) @@\
  1272. RunProgram(DEPEND,-a $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs3)
  1273. #endif /* HasMakefileSafeInclude else */
  1274. #endif /* DependTarget3 */
  1275. /*
  1276. * CleanTarget - generate rules to remove any garbage files
  1277. */
  1278. #ifndef CleanTarget
  1279. #define CleanTarget() @@\
  1280. clean:: @@\
  1281. $(RM) FilesToClean ExtraFilesToClean "#"* @@\
  1282. @@\
  1283. ProofCleanTarget()
  1284. #endif /* CleanTarget */
  1285. /*
  1286. * TagsTarget - generate rules to compute tags files for C source code.
  1287. */
  1288. #ifndef TagsTarget
  1289. #define TagsTarget() @@\
  1290. tags:: @@\
  1291. $(TAGS) -w *.[ch] @@\
  1292. $(TAGS) -xw *.[ch] > TAGS
  1293. #endif /* TagsTarget */
  1294. /*
  1295. * ImakeDependency - generate rules to compile imake if this Imakefile is
  1296. * within the source tree.
  1297. */
  1298. #ifndef ImakeDependency
  1299. #ifdef UseInstalled
  1300. #define ImakeDependency(target) /**/
  1301. #else
  1302. #define ImakeDependency(target) @@\
  1303. target:: ProgramTargetName($(IMAKE)) @@\
  1304. @@\
  1305. NoCmpScript(ProgramTargetName($(IMAKE)) $(IMAKE).Osuf) @@\
  1306. @@\
  1307. ProgramTargetName($(IMAKE)) $(IMAKE).Osuf: @@\
  1308. -@(cd $(IMAKESRC); if [ -f Makefile ]; then \ @@\
  1309. echo "checking $@ in $(IMAKESRC) first..."; $(MAKE) all; else \ @@\
  1310. echo "bootstrapping $@ from Makefile.ini in $(IMAKESRC) first..."; \ @@\
  1311. $(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; fi; \ @@\
  1312. echo "okay, continuing in $(CURRENT_DIR)")
  1313. #endif /* UseInstalled */
  1314. #endif /* ImakeDependency */
  1315. /*
  1316. * BuildMakefileTarget - generate rules to build a Makefile from an Imakefile
  1317. * and any special imake flags. This is generally done automatically by the
  1318. * template or by any special Imakefiles. The first argument exists just
  1319. * because imakeflags is usually empty and some preprocessors will complain
  1320. * if an empty argument is passed as the sole argument to a macro.
  1321. */
  1322. #ifndef BuildMakefileTarget
  1323. #define BuildMakefileTarget(notused,imakeflags) @@\
  1324. ImakeDependency(Makefile) @@\
  1325. @@\
  1326. Makefile:: @@\
  1327. RMoveToBakFile(Makefile) @@\
  1328. $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) imakeflags
  1329. #endif /* BuildMakefileTarget */
  1330. /*
  1331. * MakefileTarget - generate rules to build a normal Makefile.
  1332. */
  1333. #ifndef MakefileTarget
  1334. #define MakefileTarget() @@\
  1335. BuildMakefileTarget(Imakefile,NullParameter)
  1336. #endif /* MakefileTarget */
  1337. /*
  1338. * LibMkdir - helper for creating library object subdirectories
  1339. */
  1340. #ifndef LibMkdir
  1341. #define LibMkdir(dir) DirFailPrefix@if [ -d dir ]; then exit 0; else set -x; mkdir dir; fi
  1342. #endif
  1343. #ifndef LibMkdirLinkSubdirs
  1344. #define LibMkdirLinkSubdirs(dir) DirFailPrefix@if [ -d dir ]; then \ @@\
  1345. exit 0; \ @@\
  1346. else \ @@\
  1347. echo "mkdir dir"; mkdir dir; \ @@\
  1348. for i in $(SUBDIRS); do \ @@\
  1349. j=`echo "$$i" | $(SED) -e 's;[^/]\{1,\};..;g'`; \ @@\
  1350. $(MKDIRHIER) "dir/`dirname $$i`"; \ @@\
  1351. echo $(LN) "$$j/$$i/dir" "dir/$$i"; \ @@\
  1352. $(LN) "$$j/$$i/dir" "dir/$$i"; \ @@\
  1353. done; \ @@\
  1354. fi
  1355. #endif
  1356. /*
  1357. * LibCleanDir - helper for cleaning library object subdirectories
  1358. */
  1359. #ifndef LibCleanDir
  1360. #define LibCleanDir(dir) -@if [ -d dir ]; then \ @@\
  1361. set -x; $(RM) -r dir; else exit 0; fi
  1362. #endif
  1363. /*
  1364. * LintLibReferences - variables for lint libraries
  1365. */
  1366. #ifndef LintLibReferences
  1367. #define LintLibReferences(varname,libname,libsource) @@\
  1368. Concat(LINT,varname) = _UseCat($(LINTLIBDIR)/llib-l,libsource/llib-,libname.ln)
  1369. #endif
  1370. /*
  1371. * UnsharedLibReferences - variables for unshared libraries
  1372. */
  1373. #ifndef UnsharedLibReferences
  1374. #define UnsharedLibReferences(varname,libname,libsource) @@\
  1375. ProjectUnsharedLibReferences(varname,libname,libsource,$(BUILDLIBDIR))
  1376. #endif
  1377. /*
  1378. * ProjectUnsharedLibReferences - variables for unshared libraries
  1379. */
  1380. #ifndef ProjectUnsharedLibReferences
  1381. #define ProjectUnsharedLibReferences(varname,libname,libsource,buildlibdir) @@\
  1382. Concat3(DEP,varname,LIB) = _UseCat($(USRLIBDIR)/lib,buildlibdir/lib,libname.a) @@\
  1383. Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\
  1384. LintLibReferences(varname,libname,libsource)
  1385. #endif
  1386. /*
  1387. * SharedLibDependencies - shared library dependencies
  1388. */
  1389. #ifndef SharedLibDependencies
  1390. #define SharedLibDependencies(libname,libsource,revname) /**/
  1391. #endif
  1392. /*
  1393. * SharedDSLibDependencies - shared library dependencies with data separation
  1394. */
  1395. #ifndef SharedDSLibDependencies
  1396. #define SharedDSLibDependencies(libname,libsource,revname) /**/
  1397. #endif
  1398. /*
  1399. * SharedLibReferences - variables for shared libraries
  1400. */
  1401. #ifndef SharedLibReferences
  1402. #define SharedLibReferences(varname,libname,libsource,revname,rev) @@\
  1403. revname = rev @@\
  1404. Concat3(DEP,varname,LIB) = SharedLibDependencies(libname,libsource,revname) @@\
  1405. Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\
  1406. LintLibReferences(varname,libname,libsource)
  1407. #endif
  1408. /*
  1409. * SharedDSLibReferences - variables for shared libraries with data separation
  1410. */
  1411. #ifndef SharedDSLibReferences
  1412. #define SharedDSLibReferences(varname,libname,libsource,revname,rev) @@\
  1413. revname = rev @@\
  1414. Concat3(DEP,varname,LIB) = SharedDSLibDependencies(libname,libsource,revname) @@\
  1415. Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\
  1416. LintLibReferences(varname,libname,libsource)
  1417. #endif
  1418. /*
  1419. * CPPOnlyCompile - run C compiler's preprocessor only
  1420. */
  1421. #ifndef CPPOnlyCompile
  1422. #define CPPOnlyCompile(src,options) RemoveFile($@) @@\
  1423. ClearmakeOSName \
  1424. $(CC) -E $(CFLAGS) options src > $@
  1425. #endif
  1426. /*
  1427. * ObjectCompile - compile fragment for a normal object file
  1428. */
  1429. #ifndef ObjectCompile
  1430. #define ObjectCompile(options) RemoveFile($@) @@\
  1431. ClearmakeOSName \
  1432. $(CC) -c $(CFLAGS) options $*.c
  1433. #endif
  1434. #ifndef ObjectCplusplusCompile
  1435. #define ObjectCplusplusCompile(options) RemoveFile($@) @@\
  1436. ClearmakeOSName \
  1437. $(CXX) -c $(CXXFLAGS) options $*.CCsuf
  1438. #endif
  1439. /*
  1440. * NormalLibObjCompile - compile fragment for a normal library object file
  1441. */
  1442. #ifndef NormalLibObjCompile
  1443. #define NormalLibObjCompile(options) ObjectCompile(options)
  1444. #endif
  1445. #ifndef NormalLibObjCplusplusCompile
  1446. #define NormalLibObjCplusplusCompile(options) ObjectCplusplusCompile(options)
  1447. #endif
  1448. /*
  1449. * NormalSharedLibObjCompile - compile fragment for shared objects
  1450. */
  1451. #ifndef NormalSharedLibObjCompile
  1452. #define NormalSharedLibObjCompile(options) NormalLibObjCompile(options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS))
  1453. #endif
  1454. #ifndef NormalSharedLibObjCplusplusCompile
  1455. #define NormalSharedLibObjCplusplusCompile(options) NormalLibObjCplusplusCompile(options $(SHLIBDEF) $(SHAREDCODEDEF) $(CXXPICFLAGS))
  1456. #endif
  1457. /*
  1458. * LibObjCompile - compile fragment for unshared/profiled/debugged objects
  1459. */
  1460. #ifndef LibObjCompile
  1461. #define LibObjCompile(dir,options) RemoveFiles($@ dir/$@) @@\
  1462. ClearmakeOSName \
  1463. $(CC) -c $(CCOPTIONS) $(ALLDEFINES) options $*.c @@\
  1464. $(MV) $@ dir/$@
  1465. #endif
  1466. #ifndef LibObjCplusplusCompile
  1467. #define LibObjCplusplusCompile(dir,options) RemoveFiles($@ dir/$@) @@\
  1468. ClearmakeOSName \
  1469. $(CXX) -c $(CXXOPTIONS) $(CXXDEFINES) options $*.CCsuf @@\
  1470. $(MV) $@ dir/$@
  1471. #endif
  1472. /*
  1473. * DebuggedLibObjCompile - compile fragment for debugged objects
  1474. */
  1475. #ifndef DebuggedLibObjCompile
  1476. #define DebuggedLibObjCompile(options) LibObjCompile(debugger,DebuggableCDebugFlags options)
  1477. #endif
  1478. #ifndef DebuggedLibObjCplusplusCompile
  1479. #define DebuggedLibObjCplusplusCompile(options) LibObjCplusplusCompile(debugger,DebuggableCplusplusDebugFlags options)
  1480. #endif
  1481. /*
  1482. * ProfiledLibObjCompile - compile fragment for profiled objects
  1483. */
  1484. #ifndef ProfiledLibObjCompile
  1485. #define ProfiledLibObjCompile(options) LibObjCompile(profiled,ProfiledCDebugFlags options)
  1486. #endif
  1487. #ifndef ProfiledLibObjCplusplusCompile
  1488. #define ProfiledLibObjCplusplusCompile(options) LibObjCplusplusCompile(profiled,ProfiledCplusplusDebugFlags options)
  1489. #endif
  1490. /*
  1491. * UnsharedLibObjCompile - compile fragment for unshared objects
  1492. */
  1493. #ifndef UnsharedLibObjCompile
  1494. #define UnsharedLibObjCompile(options) LibObjCompile(unshared,$(CDEBUGFLAGS) options)
  1495. #endif
  1496. #ifndef UnsharedLibObjCplusplusCompile
  1497. #define UnsharedLibObjCplusplusCompile(options) LibObjCplusplusCompile(unshared,$(CXXDEBUGFLAGS) options)
  1498. #endif
  1499. /*
  1500. * SharedLibObjCompile - compile fragment for shared objects
  1501. */
  1502. #ifndef SharedLibObjCompile
  1503. #define SharedLibObjCompile(options) LibObjCompile(shared,options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS) $(CDEBUGFLAGS))
  1504. #endif
  1505. /*
  1506. * NormalLibraryObjectRule - for simple libraries
  1507. */
  1508. #ifndef NormalLibraryObjectRule
  1509. #define NormalLibraryObjectRule() @@\
  1510. .c.Osuf: @@\
  1511. NormalLibObjCompile($(_NOOP_))
  1512. #endif /* NormalLibraryObjectRule */
  1513. #ifndef NormalCplusplusObjectRule
  1514. #define NormalCplusplusObjectRule() @@\
  1515. .CCsuf.Osuf: @@\
  1516. NormalLibObjCplusplusCompile($(_NOOP_))
  1517. #endif
  1518. #ifndef NormalFortranObjectRule
  1519. #define NormalFortranObjectRule() @@\
  1520. .f.Osuf: @@\
  1521. RemoveFile($@) @@\
  1522. ClearmakeOSName \
  1523. $(FC) -c $(FCFLAGS) $*.f
  1524. #endif
  1525. /*
  1526. * SpecialObjectRule - generate rules to compile a file with special flags.
  1527. */
  1528. #ifndef SpecialObjectRule
  1529. #define SpecialObjectRule(objs,depends,options) @@\
  1530. objs: depends @@\
  1531. ObjectCompile(options)
  1532. #endif /* SpecialObjectRule */
  1533. #ifndef SpecialCplusplusObjectRule
  1534. #define SpecialCplusplusObjectRule(baseobj,basedep,options) @@\
  1535. baseobj.Osuf: basedep.CCsuf @@\
  1536. ObjectCplusplusCompile(options)
  1537. #endif /* SpecialCplusplusObjectRule */
  1538. /*
  1539. * SpecialCObjectRule - generate rules to compile a C file with special flags.
  1540. * also handles CodeCenter rules
  1541. */
  1542. #ifndef SpecialCObjectRule
  1543. #define SpecialCObjectRule(basename,depends,options) @@\
  1544. SpecialObjectRule(basename.Osuf,basename.c depends,options) @@\
  1545. @@\
  1546. basename.i: basename.c depends @@\
  1547. CPPOnlyCompile(basename.c,options) @@\
  1548. @@\
  1549. CenterLoadTarget(debug_src,basename.c,NullParameter,$(ALLDEFINES) options)
  1550. #endif /* SpecialCObjectRule */
  1551. #ifndef ObjectFromSpecialSource
  1552. #define ObjectFromSpecialSource(dst,src,flags) @@\
  1553. NoConfigRec(dst.c) @@\
  1554. @@\
  1555. dst.c: src.c @@\
  1556. RemoveFile($@) @@\
  1557. $(LN) $? $@ @@\
  1558. @@\
  1559. SpecialCObjectRule(dst,NullParameter,flags) @@\
  1560. @@\
  1561. depend:: dst.c @@\
  1562. @@\
  1563. clean:: @@\
  1564. RemoveFile(dst.c)
  1565. #endif /* ObjectFromSpecialSource */
  1566. #ifndef LexFileExplicit
  1567. #if HasClearmake /* provide a place to hang ClearmakeOSName */
  1568. #define LexFileExplicit(file) @@\
  1569. file.c: file.l @@\
  1570. ClearmakeOSName \
  1571. $(LEX) $(LFLAGS) file.l @@\
  1572. $(MV) lex.yy.c file.c
  1573. #else
  1574. #define LexFileExplicit(file) /* the default rule is fine */
  1575. #endif
  1576. #endif
  1577. #ifndef LexFile
  1578. #define LexFile(file) @@\
  1579. LexFileExplicit(file) @@\
  1580. @@\
  1581. depend:: file.c @@\
  1582. @@\
  1583. clean:: @@\
  1584. RemoveFiles(lex.yy.c file.c)
  1585. #endif /* LexFile */
  1586. #ifndef YaccFile
  1587. #define YaccFile(file,flags) @@\
  1588. depend:: file.c @@\
  1589. @@\
  1590. file.h file.c: file.y @@\
  1591. ClearmakeOSName \
  1592. $(YACC) flags file.y @@\
  1593. $(MV) y.tab.c file.c @@\
  1594. @if [ -f y.tab.h ]; then set -x; $(MV) y.tab.h file.h; \ @@\
  1595. else exit 0; fi @@\
  1596. @@\
  1597. clean:: @@\
  1598. RemoveFiles(y.tab.c y.tab.h file.h file.c)
  1599. #endif /* YaccFile */
  1600. #ifndef YaccFileNoFlags
  1601. #define YaccFileNoFlags(file) @@\
  1602. depend:: file.c @@\
  1603. @@\
  1604. file.c: file.y @@\
  1605. ClearmakeOSName \
  1606. $(YACC) file.y @@\
  1607. $(MV) y.tab.c file.c @@\
  1608. @@\
  1609. clean:: @@\
  1610. RemoveFiles(y.tab.c file.c)
  1611. #endif /* YaccFileNoFlags */
  1612. #ifndef MakeLibrary
  1613. #define MakeLibrary(libname,objlist) $(AR) libname objlist
  1614. #endif
  1615. #ifndef LinkBuildLibrary
  1616. #ifdef UseInstalled
  1617. #define LinkBuildLibrary(lib) $(_NULLCMD_)
  1618. #else
  1619. #define LinkBuildLibrary(lib) MakeDir($(BUILDLIBDIR)) @@\
  1620. RemoveFile($(BUILDLIBDIR)/lib) @@\
  1621. cd $(BUILDLIBDIR) && $(LN) $(BUILDLIBTOP)/$(CURRENT_DIR)/lib .
  1622. #endif
  1623. #endif /* LinkBuildLibrary */
  1624. #ifndef _LinkBuildLibrary /* will get redefined elsewhere */
  1625. #define _LinkBuildLibrary(lib) $(_NULLCMD_)
  1626. #endif /* _LinkBuildLibrary */
  1627. /*
  1628. * NormalLibraryTarget - generate rules to create a library.
  1629. */
  1630. #ifndef NormalLibraryTarget
  1631. #define NormalLibraryTarget(libname,objlist) @@\
  1632. AllTarget(LibraryTargetName(libname)) @@\
  1633. @@\
  1634. LibraryTargetName(libname): objlist $(EXTRALIBRARYDEPS) @@\
  1635. RemoveFile($@) @@\
  1636. MakeLibrary($@,objlist) @@\
  1637. RanLibrary($@) @@\
  1638. _LinkBuildLibrary($@)
  1639. #endif /* NormalLibraryTarget */
  1640. /*
  1641. * NormalLibraryTarget2 - generate rules to create a library in two steps.
  1642. * This is used to create libraries with large numbers of files.
  1643. */
  1644. #ifndef NormalLibraryTarget2
  1645. #define NormalLibraryTarget2(libname,objlist1,objlist2) @@\
  1646. AllTarget(LibraryTargetName(libname)) @@\
  1647. @@\
  1648. LibraryTargetName(libname): objlist1 objlist2 $(EXTRALIBRARYDEPS) @@\
  1649. RemoveFile($@) @@\
  1650. MakeLibrary($@,objlist1) @@\
  1651. MakeLibrary($@,objlist2) @@\
  1652. RanLibrary($@) @@\
  1653. _LinkBuildLibrary($@)
  1654. #endif /* NormalLibraryTarget2 */
  1655. /*
  1656. * NormalLibraryTarget3 - generate rules to create a library in three steps.
  1657. * This is used to create libraries with very large numbers of files.
  1658. */
  1659. #ifndef NormalLibraryTarget3
  1660. #define NormalLibraryTarget3(libname,objlist1,objlist2,objlist3) @@\
  1661. AllTarget(LibraryTargetName(libname)) @@\
  1662. @@\
  1663. LibraryTargetName(libname): objlist1 objlist2 objlist3 $(EXTRALIBRARYDEPS) @@\
  1664. RemoveFile($@) @@\
  1665. MakeLibrary($@,objlist1) @@\
  1666. MakeLibrary($@,objlist2) @@\
  1667. MakeLibrary($@,objlist3) @@\
  1668. RanLibrary($@) @@\
  1669. _LinkBuildLibrary($@)
  1670. #endif /* NormalLibraryTarget3 */
  1671. /*
  1672. * NormalDepLibraryTarget - generate rules to create a library.
  1673. */
  1674. #ifndef NormalDepLibraryTarget
  1675. #define NormalDepLibraryTarget(libname,deplist,objlist) @@\
  1676. AllTarget(LibraryTargetName(libname)) @@\
  1677. @@\
  1678. LibraryTargetName(libname): deplist $(EXTRALIBRARYDEPS) @@\
  1679. RemoveFile($@) @@\
  1680. MakeLibrary($@,objlist) @@\
  1681. RanLibrary($@) @@\
  1682. _LinkBuildLibrary($@)
  1683. #endif /* NormalDepLibraryTarget */
  1684. /*
  1685. * UnsharedLibraryTarget - generate rules to create a library.
  1686. */
  1687. #ifndef UnsharedLibraryTarget
  1688. #define UnsharedLibraryTarget(libname,objlist,down,up) @@\
  1689. AllTarget(LibraryTargetName(libname)) @@\
  1690. @@\
  1691. LibraryTargetName(libname): objlist $(EXTRALIBRARYDEPS) @@\
  1692. RemoveFile($@) @@\
  1693. (cd down && MakeLibrary(up/$@,objlist)) @@\
  1694. RanLibrary($@) @@\
  1695. _LinkBuildLibrary($@)
  1696. #endif /* UnsharedLibraryTarget */
  1697. /*
  1698. * UnsharedLibraryTarget3 - generate rules to create a library in three steps.
  1699. * This is used to create libraries with very large numbers of files.
  1700. */
  1701. #ifndef UnsharedLibraryTarget3
  1702. #define UnsharedLibraryTarget3(libname,objlist1,objlist2,objlist3,down,up) @@\
  1703. AllTarget(LibraryTargetName(libname)) @@\
  1704. @@\
  1705. LibraryTargetName(libname): objlist1 objlist2 objlist3 $(EXTRALIBRARYDEPS) @@\
  1706. RemoveFile($@) @@\
  1707. (cd down && MakeLibrary(up/$@,objlist1)) @@\
  1708. (cd down && MakeLibrary(up/$@,objlist2)) @@\
  1709. (cd down && MakeLibrary(up/$@,objlist3)) @@\
  1710. RanLibrary($@) @@\
  1711. _LinkBuildLibrary($@)
  1712. #endif /* UnsharedLibraryTarget3 */
  1713. /*
  1714. * SubdirLibraryRule -
  1715. */
  1716. #ifndef SubdirLibraryRule
  1717. #define SubdirLibraryRule(objlist) @@\
  1718. all:: DONE @@\
  1719. @@\
  1720. DONE: objlist @@\
  1721. RemoveFile($@) @@\
  1722. touch $@ @@\
  1723. @@\
  1724. clean:: @@\
  1725. RemoveFile(DONE)
  1726. #endif /* SubdirLibraryRule */
  1727. /*
  1728. * ProfiledLibraryTarget - generate rules to create a profiled library.
  1729. */
  1730. #ifndef ProfiledLibraryTarget
  1731. #define ProfiledLibraryTarget(libname,objlist) @@\
  1732. AllTarget(LibraryTargetNameSuffix(libname,_p)) @@\
  1733. @@\
  1734. LibraryTargetNameSuffix(libname,_p): objlist $(EXTRALIBRARYDEPS) @@\
  1735. RemoveFile($@) @@\
  1736. cd profiled && MakeLibrary(../$@,objlist) @@\
  1737. RanLibrary($@)
  1738. #endif /* ProfiledLibraryTarget */
  1739. /*
  1740. * DebuggedLibraryTarget - generate rules to create a debuggable library.
  1741. */
  1742. #ifndef DebuggedLibraryTarget
  1743. #define DebuggedLibraryTarget(libname,objlist) @@\
  1744. AllTarget(LibraryTargetNameSuffix(libname,_d)) @@\
  1745. @@\
  1746. LibraryTargetNameSuffix(libname,_d): objlist $(EXTRALIBRARYDEPS) @@\
  1747. RemoveFile($@) @@\
  1748. cd debugger && MakeLibrary(../$@,objlist) @@\
  1749. RanLibrary($@)
  1750. #endif /* DebuggedLibraryTarget */
  1751. /*
  1752. * AliasedLibraryTarget - generate rules to link one library to another.
  1753. */
  1754. #ifndef AliasedLibraryTarget
  1755. #define AliasedLibraryTarget(libname,alias) @@\
  1756. AllTarget(LibraryTargetName(alias)) @@\
  1757. @@\
  1758. LibraryTargetName(alias): LibraryTargetName(libname) @@\
  1759. RemoveFile($@) @@\
  1760. $(LN) LibraryTargetName(libname) $@ @@\
  1761. @@\
  1762. clean:: @@\
  1763. RemoveFile(LibraryTargetName(alias))
  1764. #endif /* AliasedLibraryTarget */
  1765. /*
  1766. * NormalRelocatableTarget - generate rules to produce a relocatable object
  1767. * file instead of a library.
  1768. */
  1769. #ifndef NormalRelocatableTarget
  1770. #define NormalRelocatableTarget(objname,objlist) @@\
  1771. AllTarget(objname.Osuf) @@\
  1772. @@\
  1773. objname.Osuf: objlist $(EXTRALIBRARYDEPS) @@\
  1774. RemoveFile($@) @@\
  1775. $(LD) $(LDCOMBINEFLAGS) objlist -o $@
  1776. #endif /* NormalRelocatableTarget */
  1777. /*
  1778. * ProfiledRelocatableTarget - generate rules to produce a profiled relocatable
  1779. * object file instead of a library.
  1780. */
  1781. #ifndef ProfiledRelocatableTarget
  1782. #define ProfiledRelocatableTarget(objname,objlist) @@\
  1783. AllTarget(Concat(objname,_p.Osuf)) @@\
  1784. @@\
  1785. Concat(objname,_p.Osuf): objlist $(EXTRALIBRARYDEPS) @@\
  1786. RemoveFile($@) @@\
  1787. $(LD) -X -r objlist -o $@
  1788. #endif /* ProfiledRelocatableTarget */
  1789. /*
  1790. * DebuggedRelocatableTarget - generate rules to produce a debuggable
  1791. * relocatable object file instead of a library.
  1792. */
  1793. #ifndef DebuggedRelocatableTarget
  1794. #define DebuggedRelocatableTarget(objname,objlist) @@\
  1795. AllTarget(Concat(objname,_d.Osuf)) @@\
  1796. @@\
  1797. Concat(objname,_d.Osuf): objlist $(EXTRALIBRARYDEPS) @@\
  1798. RemoveFile($@) @@\
  1799. $(LD) -X -r objlist -o $@
  1800. #endif /* DebuggedRelocatableTarget */
  1801. /*
  1802. * LintLibraryTarget - generate rules to create a lint library. Note that the
  1803. * lint library is always forced to be newer than the library itself.
  1804. */
  1805. #ifndef LintLibraryTarget
  1806. #define LintLibraryTarget(libname,srclist) @@\
  1807. lintlib:: Concat(llib-l,libname.ln) @@\
  1808. @@\
  1809. Concat(llib-l,libname.ln): srclist $(EXTRALIBRARYDEPS) @@\
  1810. RemoveFile($@) @@\
  1811. $(LINT) Concat($(LINTLIBFLAG),libname) $(LINTFLAGS) srclist
  1812. #endif /* LintLibraryTarget */
  1813. /*
  1814. * NormalLintTarget - generate rules to lint a set of sources.
  1815. */
  1816. #ifndef NormalLintTarget
  1817. #define NormalLintTarget(srclist) @@\
  1818. lint: @@\
  1819. $(LINT) $(LINTFLAGS) srclist $(LINTLIBS) @@\
  1820. lint1: @@\
  1821. $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  1822. #endif /* NormalLintTarget */
  1823. /*
  1824. * LintTarget - generate rules to lint $(SRCS)
  1825. */
  1826. #ifndef LintTarget
  1827. #define LintTarget() @@\
  1828. NormalLintTarget($(SRCS))
  1829. #endif
  1830. /*
  1831. * LinkSourceFile - snag source file from some other directory
  1832. */
  1833. #ifndef LinkSourceFile
  1834. #define LinkSourceFile(src,dir) @@\
  1835. src: dir/src @@\
  1836. RemoveFile($@) @@\
  1837. $(LN) $? $@ @@\
  1838. @@\
  1839. NoConfigRec(src) @@\
  1840. @@\
  1841. includes:: src @@\
  1842. @@\
  1843. depend:: src @@\
  1844. @@\
  1845. clean:: @@\
  1846. RemoveFile(src)
  1847. #endif
  1848. /*
  1849. * CopySourceFile - snag source file from some other directory
  1850. */
  1851. #ifndef CopySourceFile
  1852. #define CopySourceFile(src,dir) @@\
  1853. src: dir/src @@\
  1854. RemoveFile($@) @@\
  1855. $(CP) $? $@ @@\
  1856. @@\
  1857. NoConfigRec(src) @@\
  1858. @@\
  1859. includes:: src @@\
  1860. @@\
  1861. depend:: src @@\
  1862. @@\
  1863. clean:: @@\
  1864. RemoveFile(src)
  1865. #endif
  1866. /*
  1867. * LinkFile - link a file
  1868. */
  1869. #ifndef LinkFile
  1870. #define LinkFile(tofile,fromfile) @@\
  1871. tofile:: fromfile @@\
  1872. RemoveFile($@) @@\
  1873. $(LN) $? $@ @@\
  1874. @@\
  1875. NoConfigRec(tofile) @@\
  1876. @@\
  1877. includes:: tofile @@\
  1878. @@\
  1879. depend:: tofile @@\
  1880. @@\
  1881. clean:: @@\
  1882. RemoveFile(tofile)
  1883. #endif
  1884. #ifndef MakeSubincludesForBuild
  1885. #define MakeSubincludesForBuild(step,dir,srclist) @@\
  1886. step:: dir srclist @@\
  1887. @-(list=`echo srclist | $(SED) -e 's/[^ ]*\///g'`; \ @@\
  1888. set -x; cd dir; RemoveFiles($$list)) @@\
  1889. @for i in srclist; do \ @@\
  1890. (set -x; cd dir; $(LN) ../$$i .); \ @@\
  1891. done @@\
  1892. @@\
  1893. dir:: @@\
  1894. $(MKDIRHIER) dir @@\
  1895. @@\
  1896. clean:: @@\
  1897. @-(if [ -d dir ]; then \ @@\
  1898. list=`echo srclist | $(SED) -e 's/[^ ]*\///g'`; \ @@\
  1899. set -x; cd dir; RemoveFile($$list); else exit 0; fi)
  1900. #endif
  1901. /*
  1902. * LangNamedTargetSubdirs - recursively make a series of steps
  1903. */
  1904. #ifndef LangNamedTargetSubdirs
  1905. #define LangNamedTargetSubdirs(lang,name,dirs,verb,flags,subname) @@\
  1906. name:: @@\
  1907. @MakeFlagsToShellFlags(ik,set +e); \ @@\
  1908. for i in dirs ;\ @@\
  1909. do \ @@\
  1910. echo verb "in $(CURRENT_DIR)/$$i..."; \ @@\
  1911. (cd $$i && LANG=lang $(MAKE) $(MFLAGS) flags subname);\ @@\
  1912. done
  1913. #endif
  1914. /*
  1915. * NamedMakeSubdirs - generate rules to do makes in the given subdirectories.
  1916. * If you want CDEBUGFLAGS passed along to subdirectories, provide a line like
  1917. * the following in the appropriate Imakefile
  1918. *
  1919. * #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
  1920. */
  1921. #ifndef LangNamedMakeSubdirs
  1922. #define LangNamedMakeSubdirs(lang,name,dirs) \
  1923. LangNamedTargetSubdirs(lang,name,dirs,"making" name,PassCDebugFlags,all)
  1924. #endif /* LangNamedMakeSubdirs */
  1925. #ifndef LangMakeSubdirs
  1926. #define LangMakeSubdirs(lang,dirs) @@\
  1927. LangNamedMakeSubdirs(lang,all,dirs)
  1928. #endif /* LangMakeSubdirs */
  1929. /*
  1930. * NamedTargetSubdirs - recursively make a series of steps
  1931. */
  1932. #ifndef NamedTargetSubdirs
  1933. #define NamedTargetSubdirs(name,dirs,verb,flags,subname) @@\
  1934. name:: @@\
  1935. @MakeFlagsToShellFlags(ik,set +e); \ @@\
  1936. for i in dirs ;\ @@\
  1937. do \ @@\
  1938. echo verb "in $(CURRENT_DIR)/$$i..."; \ @@\
  1939. (cd $$i && $(MAKE) $(MFLAGS) flags subname); \ @@\
  1940. done
  1941. #endif
  1942. /*
  1943. * NamedMakeSubdirs - generate rules to do makes in the given subdirectories.
  1944. * If you want CDEBUGFLAGS passed along to subdirectories, provide a line like
  1945. * the following in the appropriate Imakefile
  1946. *
  1947. * #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
  1948. */
  1949. #ifndef NamedMakeSubdirs
  1950. #define NamedMakeSubdirs(name,dirs) \
  1951. NamedTargetSubdirs(name,dirs,"making" name,PassCDebugFlags,all)
  1952. #endif /* NamedMakeSubdirs */
  1953. #ifndef MakeSubdirs
  1954. #define MakeSubdirs(dirs) @@\
  1955. NamedMakeSubdirs(all,dirs)
  1956. #endif /* MakeSubdirs */
  1957. /*
  1958. * DependSubdirs - generate rules to recursively compute dependencies as
  1959. * part of the make depend step.
  1960. */
  1961. #ifndef DependSubdirs
  1962. #define DependSubdirs(dirs) \
  1963. NamedTargetSubdirs(depend,dirs,"depending",NullParameter,depend)
  1964. #endif /* DependSubdirs */
  1965. /*
  1966. * ForceSubdirs - force make to build subdirectories
  1967. */
  1968. #ifndef ForceSubdirs
  1969. #define ForceSubdirs(dirs) @@\
  1970. dirs: FRC @@\
  1971. @cd $@ ; echo "making all in $(CURRENT_DIR)/$@..."; \ @@\
  1972. $(MAKE) $(MFLAGS) PassCDebugFlags all @@\
  1973. @@\
  1974. FRC:
  1975. #endif /* ForceSubdirs */
  1976. /*
  1977. * InstallSubdirs - generate rules to recursively install programs and files.
  1978. */
  1979. #ifndef InstallSubdirs
  1980. #define InstallSubdirs(dirs) \
  1981. NamedTargetSubdirs(install,dirs,"installing",DESTDIR=$(DESTDIR),install)
  1982. #endif /* InstallSubdirs */
  1983. /*
  1984. * InstallManSubdirs - generate rules to recursively install manual pages.
  1985. */
  1986. #ifndef InstallManSubdirs
  1987. #define InstallManSubdirs(dirs) \
  1988. NamedTargetSubdirs(install.man,dirs,"installing man pages",DESTDIR=$(DESTDIR),install.man)
  1989. #endif /* InstallManSubdirs */
  1990. /*
  1991. * IncludesSubdirs - generate rules to recursively put include files in build
  1992. */
  1993. #ifndef IncludesSubdirs
  1994. #define IncludesSubdirs(dirs) \
  1995. NamedTargetSubdirs(includes,dirs,including,NullParameter,includes)
  1996. #endif
  1997. /*
  1998. * InstallLinkKitSubdirs - generate rules to recursively install server Link
  1999. * Kit (only used for XFree86). This is a no-op
  2000. * rule so that Imakefiles on non-XFree86 systems
  2001. * continue to build Makefiles correctly.
  2002. */
  2003. #ifndef InstallLinkKitSubdirs
  2004. #define InstallLinkKitSubdirs(dirs)
  2005. #endif
  2006. /*
  2007. * CleanSubdirs - generate rules to recursively clean out garbage files.
  2008. */
  2009. #define BootstrapCleanSubdirs /**/ /* used at top-level */
  2010. #ifndef NamedCleanSubdirs
  2011. #define NamedCleanSubdirs(name,dirs) \
  2012. NamedTargetSubdirs(name,dirs,"cleaning",BootstrapCleanSubdirs,clean)
  2013. #endif /* NamedCleanSubdirs */
  2014. #ifndef CleanSubdirs
  2015. #define CleanSubdirs(dirs) \
  2016. NamedCleanSubdirs(clean,dirs)
  2017. #endif
  2018. /*
  2019. * TagSubdirs - generate rules to recursively create tags files.
  2020. */
  2021. #ifndef NamedTagSubdirs
  2022. #define NamedTagSubdirs(name,dirs) \
  2023. NamedTargetSubdirs(name,dirs,"tagging",TAGS='$(TAGS)',tags)
  2024. #endif /* TagSubdirs */
  2025. #ifndef TagSubdirs
  2026. #define TagSubdirs(dirs) \
  2027. NamedTagSubdirs(tags,dirs)
  2028. #endif
  2029. /*
  2030. * MakeLintSubdirs - generate rules to recursively lint directories as part
  2031. * of the named step.
  2032. */
  2033. #ifndef MakeLintSubdirs
  2034. #define MakeLintSubdirs(dirs,target,subtarget) \
  2035. NamedTargetSubdirs(target,dirs,"linting" for target and subtarget,DESTDIR=$(DESTDIR) LINTOPTS='$(LINTOPTS)',subtarget)
  2036. #endif /* MakeLintSubdirs */
  2037. /*
  2038. * LintSubdirs - generate rules to recursively lint directories as part of
  2039. * the make lint step.
  2040. */
  2041. #ifndef LintSubdirs
  2042. #define LintSubdirs(dirs) @@\
  2043. MakeLintSubdirs(dirs,lint,lint)
  2044. #endif /* LintSubdirs */
  2045. /*
  2046. * MakeLintLibSubdirs - generate rules to recursively create lint libraries.
  2047. */
  2048. #ifndef MakeLintLibSubdirs
  2049. #define MakeLintLibSubdirs(dirs) @@\
  2050. MakeLintSubdirs(dirs,lintlib,lintlib)
  2051. #endif /* MakeLintLibSubdirs */
  2052. /*
  2053. * MakeMakeOneSubdirs - generate rules to recreate $(ONESUBDIR)/Makefile
  2054. * as part of the specified step in the build. This separate, explicit target
  2055. * exists so that clearmake will know what its goal is and do wink-in.
  2056. */
  2057. #ifndef MakeMakeOneSubdirs
  2058. #define MakeMakeOneSubdirs() @@\
  2059. $(ONESUBDIR)/Makefile: @@\
  2060. @MakeFlagsToShellFlags(n,executeit="no"); \ @@\
  2061. cd $(ONESUBDIR); \ @@\
  2062. if [ "$$executeit" != "no" ]; then \ @@\
  2063. ImakeSubCmdHelper -DTOPDIR=$(IMAKETOP) -DCURDIR=$(ONECURDIR)$(ONESUBDIR); \ @@\
  2064. fi;
  2065. #endif /* MakeMakeOneSubdirs */
  2066. /*
  2067. * MakeMakeSubdirs - generate rules to recursively recreate Makefiles as part
  2068. * of the specified step in the build. If $(TOP) is set to an absolute path,
  2069. * do not prepend the ../ prefix. This makes running things outside of the
  2070. * source tree much easier.
  2071. */
  2072. #ifndef MakeMakeSubdirs
  2073. #define MakeMakeSubdirs(dirs,target) @@\
  2074. target:: @@\
  2075. -@MakeFlagsToShellFlags(ik,set +e); \ @@\
  2076. MakeFlagsToShellFlags(n,executeit="no"); \ @@\
  2077. for i in dirs ;\ @@\
  2078. do \ @@\
  2079. case "$(CURRENT_DIR)" in \ @@\
  2080. .) curdir= ;; \ @@\
  2081. *) curdir=$(CURRENT_DIR)/ ;; \ @@\
  2082. esac; \ @@\
  2083. echo "making Makefiles in $$curdir$$i..."; \ @@\
  2084. itmp=`echo $$i | $(SED) -e 's;^\./;;g' -e 's;/\./;/;g'`; \ @@\
  2085. curtmp="$(CURRENT_DIR)" \ @@\
  2086. toptmp=""; \ @@\
  2087. case "$$itmp" in \ @@\
  2088. ../?*) \ @@\
  2089. while echo "$$itmp" | grep '^\.\./' > /dev/null;\ @@\
  2090. do \ @@\
  2091. toptmp="/`basename $$curtmp`$$toptmp"; \ @@\
  2092. curtmp="`dirname $$curtmp`"; \ @@\
  2093. itmp="`echo $$itmp | $(SED) 's;\.\./;;'`"; \ @@\
  2094. done \ @@\
  2095. ;; \ @@\
  2096. esac; \ @@\
  2097. case "$$itmp" in \ @@\
  2098. */?*/?*/?*/?*) newtop=../../../../..;; \ @@\
  2099. */?*/?*/?*) newtop=../../../..;; \ @@\
  2100. */?*/?*) newtop=../../..;; \ @@\
  2101. */?*) newtop=../..;; \ @@\
  2102. *) newtop=..;; \ @@\
  2103. esac; \ @@\
  2104. newtop="$$newtop$$toptmp"; \ @@\
  2105. case "$(TOP)" in \ @@\
  2106. /?*) imaketop=$(TOP) \ @@\
  2107. imakeprefix= ;; \ @@\
  2108. .) imaketop=$$newtop \ @@\
  2109. imakeprefix=$$newtop/ ;; \ @@\
  2110. *) imaketop=$$newtop/$(TOP) \ @@\
  2111. imakeprefix=$$newtop/ ;; \ @@\
  2112. esac; \ @@\
  2113. RemoveFile($$i/Makefile.bak); \ @@\
  2114. if [ -f $$i/Makefile ]; then \ @@\
  2115. echo " $(MV) Makefile Makefile.bak"; \ @@\
  2116. if [ "$$executeit" != "no" ]; then \ @@\
  2117. $(MV) $$i/Makefile $$i/Makefile.bak; \ @@\
  2118. fi; \ @@\
  2119. fi; \ @@\
  2120. $(MAKE) $(MFLAGS) $(MAKE_OPTS) ONESUBDIR=$$i ONECURDIR=$$curdir IMAKETOP=$$imaketop IMAKEPREFIX=$$imakeprefix $$i/Makefile; \ @@\
  2121. cd $$i; \ @@\
  2122. $(MAKE) $(MFLAGS) Makefiles; \ @@\
  2123. cd $$newtop; \ @@\
  2124. done
  2125. #ifdef UseInstalled
  2126. #define ImakeSubCmdHelper $(IMAKE_CMD)
  2127. #else
  2128. #define ImakeSubCmdHelper $(IMAKEPREFIX)$(IMAKE) -I$(IMAKEPREFIX)$(IRULESRC) $(IMAKE_DEFINES) $(IMAKE_DEF_DTINFO)
  2129. #endif
  2130. #endif /* MakeMakeSubdirs */
  2131. /*
  2132. * MakefileSubdirs - generate rules to create Makefiles.
  2133. */
  2134. #ifndef MakefileSubdirs
  2135. #define MakefileSubdirs(dirs) @@\
  2136. MakeMakeOneSubdirs() @@\
  2137. MakeMakeSubdirs(dirs,Makefiles)
  2138. #endif /* MakefileSubdirs */
  2139. /*
  2140. * Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
  2141. * to cpp, because that trick does not work on all ANSI C preprocessors.
  2142. * Also delete line numbers from the cpp output (-P is not portable, I guess).
  2143. */
  2144. #ifndef CppSedMagic
  2145. #define CppSedMagic $(SED) -e '/^#[line]* *[0-9][0-9]* *.*$$/d' -e '/^XCOMM$$/s//#/' -e '/^XCOMM[^a-zA-Z0-9_]/s/^XCOMM/#/'
  2146. #endif /* CppSedMagic */
  2147. #ifndef CppFileTarget
  2148. #define CppFileTarget(dst,src,defs,deplist) @@\
  2149. dst:: src deplist @@\
  2150. RemoveFile($@) @@\
  2151. ClearmakeOSName \
  2152. $(CPP) CppNoLineInfoOption defs <src | CppSedMagic >$@ @@\
  2153. @@\
  2154. clean:: @@\
  2155. RemoveFiles(dst)
  2156. #endif /* CppFileTarget */
  2157. /*
  2158. * CppScriptTarget - generate rules to create a shell script by running the
  2159. * input through cpp. If the ExecableScripts configuration parameter is not
  2160. * set, then make sure that the first line begins with a colon.
  2161. */
  2162. #ifndef CppScriptTarget
  2163. #if ExecableScripts /* can use #! instead of colon */
  2164. #define CppScriptTarget(dst,src,defs,deplist) @@\
  2165. dst:: src deplist @@\
  2166. RemoveFile($@) @@\
  2167. ClearmakeOSName \
  2168. $(CPP) CppNoLineInfoOption defs <src | CppSedMagic >$@ @@\
  2169. chmod a+x $@ @@\
  2170. @@\
  2171. clean:: @@\
  2172. RemoveFiles(dst)
  2173. #else
  2174. #define CppScriptTarget(dst,src,defs,deplist) @@\
  2175. dst:: src deplist @@\
  2176. RemoveFile($@) @@\
  2177. ClearmakeOSName \
  2178. echo \: >$@ @@\
  2179. $(SED) '1d' src | $(CPP) CppNoLineInfoOption defs | CppSedMagic >>$@ @@\
  2180. chmod a+x $@ @@\
  2181. @@\
  2182. clean:: @@\
  2183. RemoveFile(dst)
  2184. #endif /* ExecableScripts */
  2185. #endif /* CppScriptTarget */
  2186. /*
  2187. * MakeScriptFromCpp - generate rules to create a script from a file with a
  2188. * .cpp suffix.
  2189. */
  2190. #ifndef MakeScriptFromCpp
  2191. #define MakeScriptFromCpp(name,defs) @@\
  2192. CppScriptTarget(name,name.cpp,defs,NullParameter)
  2193. #endif /* MakeScriptFromCpp */
  2194. #ifndef CppSourceFile
  2195. #define CppSourceFile(dst,src,defs,deplist) @@\
  2196. CppFileTarget(dst,src,defs,deplist) @@\
  2197. @@\
  2198. includes:: dst @@\
  2199. @@\
  2200. depend:: dst
  2201. #endif /* CppSourceFile */
  2202. /*
  2203. * SedFileTarget - generate rules to create a file by running the
  2204. * input through sed.
  2205. */
  2206. #ifndef SedFileTarget
  2207. #define SedFileTarget(dst,src,cmds) @@\
  2208. dst:: src @@\
  2209. RemoveFile($@) @@\
  2210. $(SED) cmds src >$@ @@\
  2211. chmod a+x $@ @@\
  2212. @@\
  2213. clean:: @@\
  2214. RemoveFiles(dst)
  2215. #endif /* SedFileTarget */
  2216. #ifndef SedSourceFile
  2217. #define SedSourceFile(dst,src,cmds) @@\
  2218. SedFileTarget(dst,src,cmds) @@\
  2219. @@\
  2220. includes:: dst @@\
  2221. @@\
  2222. depend:: dst
  2223. #endif /* SedSourceFile */
  2224. /*
  2225. * MakeDirectories - generate rules to create a hierarchy of directories.
  2226. */
  2227. #ifndef MakeDirectories
  2228. #define MakeDirectories(step,dirs) @@\
  2229. step:: @@\
  2230. DirFailPrefix@MakeFlagsToShellFlags(i,set +e); \ @@\
  2231. for i in dirs; do if [ -d $(DESTDIR)$$i ]; then \ @@\
  2232. set +x; else (set -x; $(MKDIRHIER) $(DESTDIR)$$i); fi \ @@\
  2233. done
  2234. #endif /* MakeDirectories */
  2235. /*
  2236. * AllTarget - generate rules to build necessary things during make all.
  2237. */
  2238. #ifndef AllTarget
  2239. #define AllTarget(depends) @@\
  2240. all:: depends
  2241. #endif /* AllTarget */
  2242. /*
  2243. * MakeImakeDir - call make in imake directory.
  2244. */
  2245. #ifndef MakeImakeDir
  2246. #define MakeImakeDir() cd $(IMAKESRC) && \ @@\
  2247. if [ -f Makefile ]; then \ @@\
  2248. $(MAKE) $(MFLAGS) BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ @@\
  2249. else \ @@\
  2250. $(MAKE) $(MFLAGS) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ @@\
  2251. fi
  2252. #endif /* MakeImakeDir */
  2253. /*
  2254. * DoUDB_SCRIPT3 - macro for creation of udb scripts for installation
  2255. */
  2256. #ifndef DoUDB_SCRIPT3
  2257. #define DoUDB_SCRIPT3(target, file, script, build) @@\
  2258. target:: $(DATABASE_DIR)/file.udb @@\
  2259. script -toLst -ReleaseStream $(PLATFORM) \ @@\
  2260. $(DATABASE_DIR)/file.udb > file.lst @@\
  2261. build file ../../..
  2262. #endif
  2263. /*
  2264. * DoUDB_SCRIPT4 - macro for creation of udb scripts for installation
  2265. */
  2266. #ifndef DoUDB_SCRIPT4
  2267. #define DoUDB_SCRIPT4(target, file, script, build) @@\
  2268. target:: $(DATABASE_DIR)/file.udb @@\
  2269. script -toLst -ReleaseStream $(PLATFORM) \ @@\
  2270. $(DATABASE_DIR)/file.udb > file.lst @@\
  2271. build file ../../../..
  2272. #endif
  2273. #ifdef DefineOldLibraryRules
  2274. #include <oldlib.rules>
  2275. #endif