1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572 |
- XCOMM ---------------------------------------------------------------------
- XCOMM Imake rules for building libraries, programs, scripts, and data files
- XCOMM rules: $TOG: Imake.rules /main/227 1998/02/02 12:07:57 kaleb $
- /*
- * MACHINE-INDEPENDENT RULES; DO NOT MODIFY
- *
- * Warning, when defining rules: make sure you do not include both a trailing
- * backslash and double ampersand backslash or else you will get an extra
- * backslash in the Makefile.
- *
- * The following macros are defined for the various templates and Imakefiles
- * (for a list of the applicable make variables, see the template files):
- *
- * Concat (a,b)
- * Concat3 (a,b,c)
- * Concat4 (a,b,c,d)
- * _Use (a,b)
- * _UseCat (a,b,c)
- * ProgramTargetName (target)
- * RunProgram (progvar,options)
- * RunProgramWithSetup (setup,progvar,options)
- * RemoveFile (file)
- * RemoveFiles (files)
- * CenterLoadTarget (target,srclist,libs,defines)
- * CenterProgramTarget (program,srclist,objlist,locallibs,syslibs)
- * SentinelLinkTarget (step,program,linklist)
- * SentinelProgramTarget (program,deplist,linklist)
- * SentinelCplusplusProgramTarget (program,deplist,linklist)
- * PurifyLinkTarget (step,program,linklist)
- * PurifyProgramTarget (program,deplist,linklist)
- * PurifyCplusplusProgramTarget (program,deplist,linklist)
- * ProofLinkTarget (step,program,linklist)
- * ProofProgramTarget (program,deplist,linklist)
- * ProofCplusplusProgramTarget (program,deplist,linklist)
- * ProofCleanTarget ()
- * RemoveTargetProgram (program)
- * MakeDir (dir)
- * BuildIncludesTop (srclist)
- * BuildIncludes (srclist,dstsubdir,dstupdir)
- * LinkRule (program,options,objects,libraries)
- * HostLinkRule (program,options,objects,libraries)
- * NoCmpScript (target)
- * NoConfigRec (target)
- * NormalProgramTarget (program,objects,deplibs,locallibs,syslibs)
- * SetUIDProgramTarget (program,objects,deplibs,locallibs,syslibs)
- * SingleProgramTarget (program,objects,locallibs,syslibs)
- * SimpleProgramTarget (program)
- * ComplexProgramTarget (program)
- * ComplexProgramTarget_1 (program,locallib,syslib)
- * ComplexProgramTarget_2 (program,locallib,syslib)
- * ComplexProgramTarget_3 (program,locallib,syslib)
- * ServerTargetWithFlags (server,subdirs,objects,libs,syslibs,flags)
- * ServerTarget (server,subdirs,objects,libs,syslibs)
- * MoveToBakFile (file)
- * RMoveToBakFile (file)
- * RanLibrary (args)
- * LibraryTargetName (libname)
- * LibraryTargetNameSuffix (libname,suffix)
- * InstallNamedTarget (step,srcname,flags,dest,dstname)
- * InstallTarget (step,file,flags,dest)
- * InstallLibrary (libname,dest)
- * MergeIntoInstalledLibrary (tolib,fromlib)
- * InstallLibraryAlias (libname,alias,dest)
- * InstallLintLibrary (libname,dest)
- * InstallManPageLong (file,destdir,dest)
- * InstallManPage (file,destdir)
- * InstallManPageAliases (file,destdir,aliases)
- * ManKeywordsTarget (manpath)
- * InstallNamedNonExec (srcname,dstname,dest)
- * InstallNonExecFile (file,dest)
- * InstallNonExecFileNoClobber (file,dest)
- * InstallNonExec (file,dest)
- * InstallProgramWithFlags (program,dest,flags)
- * InstallProgram (program,dest)
- * InstallScript (program,dest)
- * InstallNamedProg (srcname,dstname,dest)
- * InstallNamedProgNoClobber (srcname,dstname,dest)
- * MakeFlagsToShellFlags (makeflags,shellcmd)
- * LinkFileList (step,list,dir,sub)
- * LinkVarDirectory (mdir,cdir,rdir,ldir)
- * InstallMultipleDestFlags (step,list,dest,flags)
- * InstallMultipleDest (step,list,dest)
- * InstallMultiple (list,dest)
- * InstallMultipleFlags (list,dest,flags)
- * InstallMultipleMan (list,dest)
- * DependDependency ()
- * DependTarget ()
- * DependTarget3 (srcs1,srcs2,srcs3)
- * CleanTarget ()
- * TagsTarget ()
- * ImakeDependency (target)
- * BuildMakefileTarget (notused,imakeflags)
- * MakefileTarget ()
- * LibMkdir (dir)
- * LibCleanDir (dir)
- * LintLibReferences (varname,libname,libsource)
- * UnsharedLibReferences (varname,libname,libsource)
- * ProjectUnsharedLibReferences (varname,libname,libsource,buildlibdir)
- * SharedLibDependencies (libname,libsource,revname)
- * SharedDSLibDependencies (libname,libsource,revname)
- * SharedLibReferences (varname,libname,libsource,revname,rev)
- * SharedDSLibReferences (varname,libname,libsource,revname,rev)
- * ObjectCompile (options)
- * NormalLibObjCompile (options)
- * NormalSharedLibObjCompile (options)
- * LibObjCompile (dir,options)
- * DebuggedLibObjCompile (options)
- * ProfiledLibObjCompile (options)
- * SharedLibObjCompile (options)
- * NormalLibraryObjectRule ()
- * NormalFortranObjectRule ()
- * ObjectFromSpecialSource (dst,src,flags)
- * SpecialObjectRule (objs,depends,options)
- * SpecialCObjectRule (basename,depends,options)
- * LexFile (file)
- * YaccFile (file,flags)
- * YaccFileNoFlags (file)
- * MakeLibrary (libname,objlist)
- * NormalLibraryTarget (libname,objlist)
- * NormalLibraryTarget2 (libname,objlist1,objlist2)
- * NormalLibraryTarget3 (libname,objlist1,objlist2,objlist3)
- * NormalDepLibraryTarget (libname,deplist,objlist)
- * UnsharedLibraryTarget (libname,objlist,down,up)
- * UnsharedLibraryTarget3 (libname,objlist1,objlist2,objlist3,down,up)
- * SubdirLibraryRule (objlist)
- * ProfiledLibraryTarget (libname,objlist)
- * DebuggedLibraryTarget (libname,objlist)
- * AliasedLibraryTarget (libname,alias)
- * NormalRelocatableTarget (objname,objlist)
- * ProfiledRelocatableTarget (objname,objlist)
- * DebuggedRelocatableTarget (objname,objlist)
- * LintLibraryTarget (libname,srclist)
- * NormalLintTarget (srclist)
- * LintTarget ()
- * LinkSourceFile (src,dir)
- * CopySourceFile (src,dir)
- * LinkFile (tofile,fromfile)
- * MakeSubincludesForBuild (step,dir,srclist)
- * LangNamedTargetSubdirs (lang,name,dirs,verb,flags,subname)
- * LangNamedMakeSubdirs (lang,name,dirs)
- * LangMakeSubdirs (lang,dirs)
- * NamedTargetSubdirs (name,dirs,verb,flags,subname)
- * NamedMakeSubdirs (name,dirs)
- * MakeSubdirs (dirs)
- * DependSubdirs (dirs)
- * ForceSubdirs (dirs)
- * InstallSubdirs (dirs)
- * InstallManSubdirs (dirs)
- * IncludesSubdirs (dirs)
- * NamedCleanSubdirs (name,dirs)
- * CleanSubdirs (dirs)
- * NamedTagSubdirs (name,dirs)
- * TagSubdirs (dirs)
- * MakeLintSubdirs (dirs,target,subtarget)
- * LintSubdirs (dirs)
- * MakeLintLibSubdirs (dirs)
- * MakeMakeOneSubdirs ()
- * MakeMakeSubdirs (dirs,target)
- * MakefileSubdirs (dirs)
- * CppScriptTarget (dst,src,defs,deplist)
- * MakeScriptFromCpp (name,defs)
- * CppFileTarget (dst,src,defs,deplist)
- * CppSourceFile (dst,src,defs,deplist)
- * MakeDirectories (step,dirs)
- * AllTarget (depends)
- * MakeImakeDir ()
- * DoUDB_SCRIPT3 (target, file, script, build)
- * DoUDB_SCRIPT4 (target, file, script, build)
- *
- *
- * The following are in specific <os>Lib.rules:
- *
- * SharedLibraryTarget (libname,rev,solist,down,up)
- * SharedLibraryDataTarget (libname,rev,salist)
- * InstallSharedLibrary (libname,rev,dest)
- * InstallSharedLibraryData (libname,rev,dest)
- *
- */
- #define NullParameter
- /* stringify macro */
- #ifndef STR
- # if defined(__llvm__)
- # define STR2(x) #x
- # else
- # define STR2(x) "x"
- # endif
- #define STR(x) STR2(x)
- #endif
- /* if [ -d ] or [ ! -d ] causes make to fail, define this as - */
- #ifndef DirFailPrefix
- #define DirFailPrefix
- #endif
- /*
- * NoCmpScript - suppress clearmake build script comparison.
- */
- #ifndef NoCmpScript
- #if HasClearmake
- #define NoCmpScript(targ) @@\
- XCOMM special target for clearmake @@\
- .NO_CMP_SCRIPT: targ
- #else
- #define NoCmpScript(targ) /**/
- #endif
- #endif
- /*
- * NoConfigRec - suppress using clearmake configuration records.
- */
- #ifndef NoConfigRec
- #if HasClearmake
- #define NoConfigRec(targ) @@\
- XCOMM special target for clearmake @@\
- .NO_CONFIG_REC: targ
- #else
- #define NoConfigRec(targ) /**/
- #endif
- #endif
- /*
- * Concat - concatenates two strings.
- */
- #ifndef Concat
- #if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
- #define Concat(a,b)a##b
- #else
- #define Concat(a,b)a/**/b
- #endif
- #endif
- /*
- * Concat3 - concatenates three strings.
- */
- #ifndef Concat3
- #if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
- #define Concat3(a,b,c)a##b##c
- #else
- #define Concat3(a,b,c)a/**/b/**/c
- #endif
- #endif
- /*
- * Concat4 - concatenates four strings.
- */
- #ifndef Concat4
- #if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
- #define Concat4(a,b,c,d)a##b##c##d
- #else
- #define Concat4(a,b,c,d)a/**/b/**/c/**/d
- #endif
- #endif
- /*
- * _XUse - makes a choice based on UseInstalledX11.
- */
- #ifndef _XUse
- # if defined(UseInstalled) || UseInstalledX11
- # define _XUse(a,b) a
- # else
- # define _XUse(a,b) b
- # endif
- #endif /* _XUse */
- /*
- * _Use - makes a choice based on UseInstalled.
- */
- #ifndef _Use
- # define _Use _XUse
- #endif /* _Use */
- /*
- * _XUseCat - combination of _XUse and Concat.
- * exists to avoid problems with some preprocessors
- */
- #ifndef _XUseCat
- # if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) || defined(__llvm__)
- # if defined(UseInstalled) || UseInstalledX11
- # define _XUseCat(a,b,c) a##c
- # else
- # define _XUseCat(a,b,c) b##c
- # endif
- # else
- # if defined(UseInstalled) || UseInstalledX11
- # define _XUseCat(a,b,c) a/**/c
- # else
- # define _XUseCat(a,b,c) b/**/c
- # endif
- # endif
- #endif /* _XUseCat */
- /*
- * _UseCat - combination of _Use and Concat.
- * exists to avoid problems with some preprocessors
- */
- #ifndef _UseCat
- # define _UseCat _XUseCat
- #endif /* _UseCat */
- #ifndef ProgramTargetName
- #define ProgramTargetName(target)target
- #endif
- #ifndef RunProgram
- #define RunProgram(progvar,options) $(progvar) options
- #endif
- #ifndef RunProgramWithSetup
- #define RunProgramWithSetup(setup,progvar,options) setup $(progvar) options
- #endif
- #ifndef RemoveFile
- #define RemoveFile(file) $(RM) file
- #endif /* RemoveFile */
- #ifndef RemoveFiles
- #define RemoveFiles(files) $(RM) files
- #endif /* RemoveFiles */
- /*
- * CenterLoadTarget - generate rules to load files into CodeCenter
- */
- #ifndef CenterLoadTarget
- #if HasCodeCenter
- #define CenterLoadTarget(target,srclist,libs,defines) @@\
- ProgramTargetName(target):: srclist @@\
- XCOMM load defines srclist libs
- #else
- #define CenterLoadTarget(target,srclist,libs,defines) /**/
- #endif
- #endif /* CenterLoadTarget */
- /*
- * CenterProgramTarget - generate rules to make CodeCenter read in sources
- * and objects.
- */
- #ifndef CenterProgramTarget
- #define CenterProgramTarget(program,srclist,objlist,locallibs,syslibs) @@\
- CenterLoadTarget(Concat(debug_,program),srclist,$(EXTRA_LDOPTIONS) $(LOCAL_LDFLAGS) $(LDPRELIBS) locallibs $(LDLIBS) syslibs,$(ALLDEFINES)) @@\
- @@\
- CenterLoadTarget(Concat(odebug_,program),objlist,$(EXTRA_LDOPTIONS) $(LOCAL_LDFLAGS) $(LDPRELIBS) locallibs $(LDLIBS) syslibs,$(ALLDEFINES))
- #endif /* CenterProgramTarget */
- #ifndef SentinelLinkTarget
- #if HasSentinel
- #define SentinelLinkTarget(step,program,linklist) @@\
- ProgramTargetName(step.sentinel): @@\
- RemoveTargetProgram($@) @@\
- $(CCENVSETUP) $(SENTINEL) $(SENTINELOPTIONS) $(CC) -o program.sentinel $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS)
- #else
- #define SentinelLinkTarget(step,program,linklist) /**/
- #endif
- #endif /* SentinelLinkTarget */
- /*
- * SentinelProgramTarget - generate rules to make Sentinel image
- */
- #ifndef SentinelProgramTarget
- #if HasSentinel
- #define SentinelProgramTarget(program,deplist,linklist) @@\
- ProgramTargetName(program.sentinel): deplist @@\
- RemoveTargetProgram($@) @@\
- $(CCENVSETUP) $(SENTINEL) $(SENTINELOPTIONS) $(CC) -o $@ $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
- @@\
- clean clean.sentinel:: @@\
- RemoveFile(program.sentinel)
- #else
- #define SentinelProgramTarget(program,deplist,linklist) /**/
- #endif
- #endif /* SentinelProgramTarget */
- /*
- * SentinelCplusplusProgramTarget - generate rules to make Sentinel image
- */
- #ifndef SentinelCplusplusProgramTarget
- #if HasSentinel
- #define SentinelCplusplusProgramTarget(program,deplist,linklist) @@\
- ProgramTargetName(program.sentinel): deplist @@\
- RemoveTargetProgram($@) @@\
- $(CXXENVSETUP) $(SENTINEL) $(SENTINELOPTIONS) $(CXX) -o $@ $(CXXLDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
- @@\
- clean clean.sentinel:: @@\
- RemoveFile(program.sentinel)
- #else
- #define SentinelCplusplusProgramTarget(program,deplist,linklist) /**/
- #endif
- #endif /* SentinelCplusplusProgramTarget */
- #ifndef PurifyLinkTarget
- #if HasPurify
- #define PurifyLinkTarget(step,program,linklist) @@\
- ProgramTargetName(step.pure): @@\
- RemoveTargetProgram($@) @@\
- $(CCENVSETUP) $(PURIFY) $(PURIFYOPTIONS) $(CC) -o program.pure $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS)
- #else
- #define PurifyLinkTarget(step,program,linklist) /**/
- #endif
- #endif /* PurifyLinkTarget */
- /*
- * PurifyProgramTarget - generate rules to make Purify'ed image
- */
- #ifndef PurifyProgramTarget
- #if HasPurify
- #define PurifyProgramTarget(program,deplist,linklist) @@\
- ProgramTargetName(program.pure): deplist @@\
- RemoveTargetProgram($@) @@\
- $(CCENVSETUP) $(PURIFY) $(PURIFYOPTIONS) $(CC) -o $@ $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
- @@\
- clean clean.pure:: @@\
- RemoveFile(program.pure)
- #else
- #define PurifyProgramTarget(program,deplist,linklist) /**/
- #endif
- #endif /* PurifyProgramTarget */
- /*
- * PurifyCplusplusProgramTarget - generate rules to make Purify'ed image
- */
- #ifndef PurifyCplusplusProgramTarget
- #if HasPurify
- #define PurifyCplusplusProgramTarget(program,deplist,linklist) @@\
- ProgramTargetName(program.pure): deplist @@\
- RemoveTargetProgram($@) @@\
- $(CXXENVSETUP) $(PURIFY) $(PURIFYOPTIONS) $(CXX) -o $@ $(CXXLDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
- @@\
- clean clean.pure:: @@\
- RemoveFile(program.pure)
- #else
- #define PurifyCplusplusProgramTarget(program,deplist,linklist) /**/
- #endif
- #endif /* PurifyCplusplusProgramTarget */
- #ifndef ProofLinkTarget
- #if HasTestCenter
- #define ProofLinkTarget(step,program,linklist) @@\
- ProgramTargetName(step.tc): @@\
- RemoveTargetProgram($@) @@\
- $(CCENVSETUP) $(PROOF) $(PROOFOPTIONS) $(CC) -o program.tc $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS)
- #else
- #define ProofLinkTarget(step,program,linklist) /**/
- #endif
- #endif /* ProofLinkTarget */
- /*
- * ProofProgramTarget - generate rules to make Proof'ed image
- */
- #ifndef ProofProgramTarget
- #if HasTestCenter
- #define ProofProgramTarget(program,deplist,linklist) @@\
- ProgramTargetName(program.tc): deplist @@\
- RemoveTargetProgram($@) @@\
- $(CCENVSETUP) $(PROOF) $(PROOFOPTIONS) $(CC) -o $@ $(LDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
- @@\
- clean clean.tc:: @@\
- RemoveFiles(program.tc program.tc.*.*)
- #else
- #define ProofProgramTarget(program,deplist,linklist) /**/
- #endif
- #endif /* ProofProgramTarget */
- /*
- * ProofCplusplusProgramTarget - generate rules to make Proof'ed image
- */
- #ifndef ProofCplusplusProgramTarget
- #if HasTestCenter
- #define ProofCplusplusProgramTarget(program,deplist,linklist) @@\
- ProgramTargetName(program.tc): deplist @@\
- RemoveTargetProgram($@) @@\
- $(CXXENVSETUP) $(PROOF) $(PROOFOPTIONS) $(CXX) -o $@ $(CXXLDOPTIONS) linklist $(EXTRA_LOAD_FLAGS) @@\
- @@\
- clean clean.tc:: @@\
- RemoveFiles(program.tc program.tc.*.*)
- #else
- #define ProofCplusplusProgramTarget(program,deplist,linklist) /**/
- #endif
- #endif /* ProofCplusplusProgramTarget */
- #ifndef ProofCleanTarget
- #if HasTestCenter
- #define ProofCleanTarget() @@\
- clean clean.tc:: @@\
- $(RM) -r TC.Cache
- #else
- #define ProofCleanTarget() /**/
- #endif
- #endif /* ProofCleanTarget */
- #ifndef RemoveTargetProgram
- #if RemoveTargetProgramByMoving
- #define RemoveTargetProgram(program) \
- -if [ -f program ]; then RemoveFile(Concat(program,~)); $(MV) program Concat(program,~); fi
- #else
- #define RemoveTargetProgram(program) RemoveFile(program)
- #endif
- #endif /* RemoveTargetProgram */
- #ifndef MakeDir
- #define MakeDir(dir) DirFailPrefix@if [ -d dir ]; then set +x; \ @@\
- else (set -x; $(MKDIRHIER) dir); fi
- #endif /* MakeDir */
- #ifndef BuildIncludesTop
- #define BuildIncludesTop(srclist) @@\
- includes:: srclist @@\
- MakeDir($(BUILDINCDIR)) @@\
- @(set -x; cd $(BUILDINCDIR); for i in srclist; do \ @@\
- RemoveFile($$i); \ @@\
- $(LN) $(BUILDINCTOP)/$(CURRENT_DIR)/$$i .; \ @@\
- done)
- #endif /* BuildIncludesTop */
- #ifndef BuildIncludes
- #define BuildIncludes(srclist,dstsubdir,dstupdir) @@\
- includes:: srclist @@\
- MakeDir($(BUILDINCDIR)/dstsubdir) @@\
- @(set -x; cd $(BUILDINCDIR)/dstsubdir; for i in srclist; do \ @@\
- RemoveFile($$i); \ @@\
- $(LN) $(BUILDINCTOP)/dstupdir/$(CURRENT_DIR)/$$i .; \ @@\
- done)
- #endif /* BuildIncludes */
- /*
- * LinkBuildBinary - export a binary from the build tree.
- */
- #ifndef LinkBuildBinary
- #define LinkBuildBinary(binary) @@\
- all:: $(BUILDBINDIR)/binary binary @@\
- @@\
- $(BUILDBINDIR)/binary: binary @@\
- RemoveFile($@) @@\
- cd $(BUILDBINDIR) && $(LN) $(BUILDBINTOP)/$(CURRENT_DIR)/binary .
- #endif /* LinkBuildBinary */
- #ifndef BuildInterfaces
- #define BuildInterfaces(srclist,dstsubdir,dstupdir) @@\
- interfaces:: @@\
- MakeDir($(BUILDINCDIR)/dstsubdir) @@\
- @(set -x; cd $(BUILDINCDIR)/dstsubdir; for i in srclist; do \ @@\
- RemoveFile($$i); \ @@\
- $(LN) $(BUILDINCTOP)/dstupdir/$(CURRENT_DIR)/$$i .; \ @@\
- done)
- #endif /* BuildInterfaces */
- /*
- * LinkRule - link a program
- */
- #ifndef LinkRule
- #define LinkRule(program,options,objects,libraries) \
- $(CCLINK) -o program options objects libraries $(EXTRA_LOAD_FLAGS)
- #endif /* LinkRule */
- /*
- * HostLinkRule - link a utility to be used on the build host
- * (differs from LinkRule if cross compiling)
- */
- #ifndef HostLinkRule
- #define HostLinkRule LinkRule
- #endif
- #ifndef CplusplusLinkRule
- #define CplusplusLinkRule(program,options,objects,libraries) \
- $(CXXLINK) -o program options objects libraries $(EXTRA_LOAD_FLAGS)
- #endif /* CplusplusLinkRule */
- /*
- * NormalProgramTarget - generate rules to compile and link the indicated
- * program; since it does not use any default object files, it may be used for
- * multiple programs in the same Imakefile.
- */
- #ifndef NormalProgramTarget
- #define NormalProgramTarget(program,objects,deplibs,locallibs,syslibs) @@\
- ProgramTargetName(program): objects deplibs @@\
- RemoveTargetProgram($@) @@\
- LinkRule($@,$(LDOPTIONS),objects,locallibs $(LDLIBS) syslibs) @@\
- @@\
- SentinelProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
- PurifyProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
- ProofProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
- @@\
- clean:: @@\
- RemoveFile(ProgramTargetName(program))
- #endif /* NormalProgramTarget */
- /*
- * NormalCplusplusProgramTarget - Like NormalTargetProgram, but uses
- * C++ linking rules.
- */
- #ifndef NormalCplusplusProgramTarget
- #define NormalCplusplusProgramTarget(program,objects,deplibs,locallibs,syslibs) @@\
- ProgramTargetName(program): objects deplibs @@\
- RemoveTargetProgram($@) @@\
- CplusplusLinkRule($@,$(CXXLDOPTIONS),objects,locallibs $(LDLIBS) syslibs) @@\
- @@\
- SentinelCplusplusProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
- PurifyCplusplusProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
- ProofCplusplusProgramTarget(program,objects deplibs,objects locallibs $(LDLIBS) syslibs) @@\
- @@\
- clean:: @@\
- RemoveFile(ProgramTargetName(program))
- #endif /* NormalCplusplusProgramTarget */
- #ifndef SetUIDProgramTarget
- #define SetUIDProgramTarget NormalProgramTarget
- #endif
- /*
- * SingleProgramTarget - obsolete version of NormalProgramTarget that does
- * not have deplibs.
- */
- #ifndef SingleProgramTarget
- #define SingleProgramTarget(program,objects,locallibs,syslibs) @@\
- NormalProgramTarget(program,objects,NullParameter,locallibs,syslibs)
- #endif /* SingleProgramTarget */
- /*
- * SimpleProgramTarget - generate rules for compiling and linking programs
- * that only have one C source file. It should only be used in Imakefiles
- * that describe a single program.
- */
- #ifndef SimpleProgramTarget
- #define SimpleProgramTarget(program) @@\
- OBJS = program.o @@\
- SRCS = program.c @@\
- @@\
- ComplexProgramTarget(program)
- #endif /* SimpleProgramTarget */
- #ifndef SimpleCplusplusProgramTarget
- #define SimpleCplusplusProgramTarget(program) @@\
- OBJS = program.o @@\
- SRCS = program.CCsuf @@\
- @@\
- ComplexCplusplusProgramTarget(program)
- #endif /* SimpleCplusplusProgramTarget */
- #ifndef ProgramTargetHelper
- #define ProgramTargetHelper(program,srcs,objs,deplib,locallib,syslib) @@\
- ProgramTargetName(program): $(objs) $(deplib) @@\
- RemoveTargetProgram($@) @@\
- LinkRule($@,$(LDOPTIONS),$(objs),locallib $(LDLIBS) syslib) @@\
- @@\
- CenterProgramTarget(program,$(srcs),$(objs),locallib,syslib) @@\
- SentinelProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
- PurifyProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
- ProofProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
- @@\
- InstallProgram(program,$(BINDIR)) @@\
- InstallManPage(program,$(MANDIR))
- #endif /* ProgramTargetHelper */
- #ifndef CplusplusProgramTargetHelper
- #define CplusplusProgramTargetHelper(program,srcs,objs,deplib,locallib,syslib) @@\
- ProgramTargetName(program): $(objs) $(deplib) @@\
- RemoveTargetProgram($@) @@\
- CplusplusLinkRule($@,$(CXXLDOPTIONS),$(objs),locallib $(LDLIBS) syslib) @@\
- @@\
- CenterProgramTarget(program,$(srcs),$(objs),locallib,syslib) @@\
- SentinelCplusplusProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
- PurifyCplusplusProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
- ProofCplusplusProgramTarget(program,$(objs) $(deplib),$(objs) locallib $(LDLIBS) syslib) @@\
- @@\
- InstallProgram(program,$(BINDIR)) @@\
- InstallManPage(program,$(MANDIR))
- #endif /* CplusplusProgramTargetHelper */
- /*
- * ComplexProgramTarget - generate rules for compiling and linking the
- * program specified by $(OBJS) and $(SRCS), installing the program and its
- * man page, and generating dependencies. It should only be used in
- * Imakefiles that describe a single program.
- */
- #ifndef ComplexProgramTarget
- #define ComplexProgramTarget(program) @@\
- PROGRAM = program @@\
- @@\
- AllTarget(program) @@\
- @@\
- ProgramTargetHelper(program,SRCS,OBJS,DEPLIBS,$(LOCAL_LIBRARIES),NullParameter) @@\
- @@\
- DependTarget() @@\
- LintTarget() @@\
- @@\
- clean:: @@\
- RemoveFile(ProgramTargetName(program))
- #endif /* ComplexProgramTarget */
- #ifndef ComplexCplusplusProgramTarget
- #define ComplexCplusplusProgramTarget(program) @@\
- PROGRAM = program @@\
- @@\
- AllTarget(program) @@\
- @@\
- CplusplusProgramTargetHelper(program,SRCS,OBJS,DEPLIBS,$(LOCAL_LIBRARIES),NullParameter) @@\
- @@\
- DependTarget() @@\
- LintTarget() @@\
- @@\
- clean:: @@\
- RemoveFile(ProgramTargetName(program))
- #endif /* ComplexCplusplusProgramTarget */
- /*
- * ComplexProgramTarget_1 - generate rules for compiling and linking the
- * program specified by $(OBJS1) and $(SRCS1), installing the program and its
- * man page, and generating dependencies for it and any programs described
- * by $(SRCS2) throgh $(SRCS10). It should be used to build the primary
- * program in Imakefiles that describe multiple programs.
- */
- #ifndef ComplexProgramTarget_1
- #define ComplexProgramTarget_1(program,locallib,syslib) @@\
- OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) \ @@\
- $(OBJS6) $(OBJS7) $(OBJS8) $(OBJS9) $(OBJS10) @@\
- SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(SRCS4) $(SRCS5) \ @@\
- $(SRCS6) $(SRCS7) $(SRCS8) $(SRCS9) $(SRCS10) @@\
- @@\
- AllTarget($(PROGRAMS)) @@\
- @@\
- ProgramTargetHelper(program,SRCS1,OBJS1,DEPLIBS1,locallib,syslib) @@\
- @@\
- DependTarget() @@\
- LintTarget() @@\
- @@\
- clean:: @@\
- RemoveFiles($(PROGRAMS))
- #endif /* ComplexProgramTarget_1 */
- #ifndef ComplexCplusplusProgramTarget_1
- #define ComplexCplusplusProgramTarget_1(program,locallib,syslib) @@\
- OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) \ @@\
- $(OBJS6) $(OBJS7) $(OBJS8) $(OBJS9) $(OBJS10) @@\
- SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(SRCS4) $(SRCS5) \ @@\
- $(SRCS6) $(SRCS7) $(SRCS8) $(SRCS9) $(SRCS10) @@\
- @@\
- AllTarget($(PROGRAMS)) @@\
- @@\
- CplusplusProgramTargetHelper(program,SRCS1,OBJS1,DEPLIBS1,locallib,syslib)@@\
- @@\
- DependTarget() @@\
- LintTarget() @@\
- @@\
- clean:: @@\
- RemoveFiles($(PROGRAMS))
- #endif /* ComplexCplusplusProgramTarget_1 */
- /*
- * ComplexProgramTarget_2 - generate rules for compiling and linking the
- * program specified by $(OBJS2) and $(SRCS2) and installing the program and
- * man page. It should be used to build the second program in Imakefiles
- * describing more than one program.
- */
- #ifndef ComplexProgramTarget_2
- #define ComplexProgramTarget_2(program,locallib,syslib) @@\
- ProgramTargetHelper(program,SRCS2,OBJS2,DEPLIBS2,locallib,syslib)
- #endif /* ComplexProgramTarget_2 */
- #ifndef ComplexCplusplusProgramTarget_2
- #define ComplexCplusplusProgramTarget_2(program,locallib,syslib) @@\
- CplusplusProgramTargetHelper(program,SRCS2,OBJS2,DEPLIBS2,locallib,syslib)
- #endif /* ComplexCplusplusProgramTarget_2 */
- /*
- * ComplexProgramTarget_3 - generate rules for compiling and linking the
- * program specified by $(OBJS3) and $(SRCS3) and installing the program and
- * man page. It should be used to build the third program in Imakefiles
- * describing more than one program.
- */
- #ifndef ComplexProgramTarget_3
- #define ComplexProgramTarget_3(program,locallib,syslib) @@\
- ProgramTargetHelper(program,SRCS3,OBJS3,DEPLIBS3,locallib,syslib)
- #endif /* ComplexProgramTarget_3 */
- #ifndef ComplexCplusplusProgramTarget_3
- #define ComplexCplusplusProgramTarget_3(program,locallib,syslib) @@\
- CplusplusProgramTargetHelper(program,SRCS3,OBJS3,DEPLIBS3,locallib,syslib)
- #endif /* ComplexCplusplusProgramTarget_3 */
- /*
- * ComplexProgramTarget_4 - generate rules for compiling and linking the
- * program specified by $(OBJS4) and $(SRCS4) and installing the program and
- * man page. It should be used to build the third program in Imakefiles
- * describing more than one program.
- */
- #ifndef ComplexProgramTarget_4
- #define ComplexProgramTarget_4(program,locallib,syslib) @@\
- ProgramTargetHelper(program,SRCS4,OBJS4,DEPLIBS4,locallib,syslib)
- #endif /* ComplexProgramTarget_4 */
- #ifndef ComplexCplusplusProgramTarget_4
- #define ComplexCplusplusProgramTarget_4(program,locallib,syslib) @@\
- CplusplusProgramTargetHelper(program,SRCS4,OBJS4,DEPLIBS4,locallib,syslib)
- #endif /* ComplexCplusplusProgramTarget_4 */
- /*
- * ComplexProgramTarget_5 - generate rules for compiling and linking the
- * program specified by $(OBJS5) and $(SRCS5) and installing the program and
- * man page. It should be used to build the third program in Imakefiles
- * describing more than one program.
- */
- #ifndef ComplexProgramTarget_5
- #define ComplexProgramTarget_5(program,locallib,syslib) @@\
- ProgramTargetHelper(program,SRCS5,OBJS5,DEPLIBS5,locallib,syslib)
- #endif /* ComplexProgramTarget_5 */
- #ifndef ComplexCplusplusProgramTarget_5
- #define ComplexCplusplusProgramTarget_5(program,locallib,syslib) @@\
- CplusplusProgramTargetHelper(program,SRCS5,OBJS5,DEPLIBS5,locallib,syslib)
- #endif /* ComplexCplusplusProgramTarget_5 */
- /*
- * ComplexProgramTarget_6 - generate rules for compiling and linking the
- * program specified by $(OBJS6) and $(SRCS6) and installing the program and
- * man page. It should be used to build the third program in Imakefiles
- * describing more than one program.
- */
- #ifndef ComplexProgramTarget_6
- #define ComplexProgramTarget_6(program,locallib,syslib) @@\
- ProgramTargetHelper(program,SRCS6,OBJS6,DEPLIBS6,locallib,syslib)
- #endif /* ComplexProgramTarget_6 */
- #ifndef ComplexCplusplusProgramTarget_6
- #define ComplexCplusplusProgramTarget_6(program,locallib,syslib) @@\
- CplusplusProgramTargetHelper(program,SRCS6,OBJS6,DEPLIBS6,locallib,syslib)
- #endif /* ComplexCplusplusProgramTarget_6 */
- /*
- * ComplexProgramTarget_7 - generate rules for compiling and linking the
- * program specified by $(OBJS7) and $(SRCS7) and installing the program and
- * man page. It should be used to build the third program in Imakefiles
- * describing more than one program.
- */
- #ifndef ComplexProgramTarget_7
- #define ComplexProgramTarget_7(program,locallib,syslib) @@\
- ProgramTargetHelper(program,SRCS7,OBJS7,DEPLIBS7,locallib,syslib)
- #endif /* ComplexProgramTarget_7 */
- #ifndef ComplexCplusplusProgramTarget_7
- #define ComplexCplusplusProgramTarget_7(program,locallib,syslib) @@\
- CplusplusProgramTargetHelper(program,SRCS7,OBJS7,DEPLIBS7,locallib,syslib)
- #endif /* ComplexCplusplusProgramTarget_7 */
- /*
- * ComplexProgramTarget_8 - generate rules for compiling and linking the
- * program specified by $(OBJS8) and $(SRCS8) and installing the program and
- * man page. It should be used to build the third program in Imakefiles
- * describing more than one program.
- */
- #ifndef ComplexProgramTarget_8
- #define ComplexProgramTarget_8(program,locallib,syslib) @@\
- ProgramTargetHelper(program,SRCS8,OBJS8,DEPLIBS8,locallib,syslib)
- #endif /* ComplexProgramTarget_8 */
- #ifndef ComplexCplusplusProgramTarget_8
- #define ComplexCplusplusProgramTarget_8(program,locallib,syslib) @@\
- CplusplusProgramTargetHelper(program,SRCS8,OBJS8,DEPLIBS8,locallib,syslib)
- #endif /* ComplexCplusplusProgramTarget_8 */
- /*
- * ComplexProgramTarget_9 - generate rules for compiling and linking the
- * program specified by $(OBJS9) and $(SRCS9) and installing the program and
- * man page. It should be used to build the third program in Imakefiles
- * describing more than one program.
- */
- #ifndef ComplexProgramTarget_9
- #define ComplexProgramTarget_9(program,locallib,syslib) @@\
- ProgramTargetHelper(program,SRCS9,OBJS9,DEPLIBS9,locallib,syslib)
- #endif /* ComplexProgramTarget_9 */
- #ifndef ComplexCplusplusProgramTarget_9
- #define ComplexCplusplusProgramTarget_9(program,locallib,syslib) @@\
- CplusplusProgramTargetHelper(program,SRCS9,OBJS9,DEPLIBS9,locallib,syslib)
- #endif /* ComplexCplusplusProgramTarget_9 */
- /*
- * ComplexProgramTarget_10 - generate rules for compiling and linking the
- * program specified by $(OBJS10) and $(SRCS10) and installing the program and
- * man page. It should be used to build the third program in Imakefiles
- * describing more than one program.
- */
- #ifndef ComplexProgramTarget_10
- #define ComplexProgramTarget_10(program,locallib,syslib) @@\
- ProgramTargetHelper(program,SRCS10,OBJS10,DEPLIBS10,locallib,syslib)
- #endif /* ComplexProgramTarget_10 */
- #ifndef ComplexCplusplusProgramTarget_10
- #define ComplexCplusplusProgramTarget_10(program,locallib,syslib) @@\
- CplusplusProgramTargetHelper(program,SRCS10,OBJS10,DEPLIBS10,locallib,syslib)
- #endif /* ComplexCplusplusProgramTarget_10 */
- #ifndef MoveToBakFile
- #define MoveToBakFile(file) -@if [ -f file ]; then set -x; \ @@\
- $(MV) file file.bak; else exit 0; fi
- #endif /* MoveToBakFile */
- #ifndef RMoveToBakFile
- #define RMoveToBakFile(file) -@if [ -f file ]; then set -x; \ @@\
- RemoveFile(file.bak); $(MV) file file.bak; \ @@\
- else exit 0; fi
- #endif /* RMoveToBakFile */
- /*
- * ServerTargetWithFlags - generate rules to compile, link, and relink a server
- */
- #ifndef ServerTargetWithFlags
- #define ServerTargetWithFlags(server,subdirs,objects,libs,syslibs,flags) @@\
- AllTarget(server) @@\
- ProgramTargetName(server): subdirs objects libs @@\
- MoveToBakFile($@) @@\
- LinkRule($@,$(LDOPTIONS),objects,libs $(LDLIBS) syslibs) @@\
- @@\
- Concat(load,server): @@\
- MoveToBakFile(ProgramTargetName(server)) @@\
- LinkRule(ProgramTargetName(server),$(LDOPTIONS),objects,libs $(LDLIBS) syslibs) @@\
- @@\
- loadX:: Concat(load,server) @@\
- @@\
- SentinelProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
- SentinelLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
- PurifyProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
- PurifyLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
- ProofProgramTarget(server,subdirs objects libs,objects libs $(LDLIBS) syslibs) @@\
- ProofLinkTarget(Concat(load,server),server,objects libs $(LDLIBS) syslibs) @@\
- @@\
- InstallProgramWithFlags(server,$(BINDIR),flags) @@\
- @@\
- clean:: @@\
- RemoveFile(ProgramTargetName(server))
- #endif /* ServerTargetWithFlags */
- /*
- * ServerTarget - rules to compile, link, and relink a normal server
- */
- #ifndef ServerTarget
- #define ServerTarget(server,subdirs,objects,libs,syslibs) @@\
- ServerTargetWithFlags(server,subdirs,objects,libs,syslibs,$(_NOOP_))
- #endif /* ServerTarget */
- #if DoRanlibCmd
- #define RanLibrary(args) $(RANLIB) args
- #else
- #define RanLibrary(args) $(_NULLCMD_)
- #endif
- #ifndef LibraryTargetName
- #define LibraryTargetName(libname)Concat(lib,libname.a)
- #endif
- #ifndef LibraryTargetNameSuffix
- #define LibraryTargetNameSuffix(libname,suffix)Concat3(lib,libname,suffix.a)
- #endif
- #ifndef InstallNamedTarget
- #define InstallNamedTarget(step,srcname,flags,dest,dstname) @@\
- step:: srcname @@\
- MakeDir($(DESTDIR)dest) @@\
- $(INSTALL) $(INSTALLFLAGS) flags srcname $(DESTDIR)dest/dstname
- #endif /* InstallNamedTarget */
- /*
- * InstallNamedTargetNoClobber - Like InstallNamedTarget, but doesn't
- * do the install if an installed version already exists. Useful
- * for files that might have local customizations that you don't
- * want to clobber. Config files are good candidates for this.
- */
- #ifndef InstallNamedTargetNoClobber
- #define InstallNamedTargetNoClobber(step,srcname,flags,dest,dstname) @@\
- step:: srcname @@\
- MakeDir($(DESTDIR)dest) @@\
- @if [ -f $(DESTDIR)dest/dstname ]; then \ @@\
- echo "Not overwriting existing" $(DESTDIR)dest/dstname; \ @@\
- else set -x; \ @@\
- $(INSTALL) $(INSTALLFLAGS) flags srcname $(DESTDIR)dest/dstname; fi
- #endif /* InstallNamedTargetNoClobber */
- #ifndef InstallTarget
- #define InstallTarget(step,file,flags,dest) @@\
- InstallNamedTarget(step,file,flags,dest,file)
- #endif /* InstallTarget */
- /*
- * InstallLibrary - generate rules to install the indicated library.
- */
- #ifndef InstallLibrary
- #define InstallLibrary(libname,dest) @@\
- install:: LibraryTargetName(libname) @@\
- MakeDir($(DESTDIR)dest) @@\
- $(INSTALL) $(INSTALLFLAGS) $(INSTLIBFLAGS) LibraryTargetName(libname) $(DESTDIR)dest @@\
- RanLibrary($(RANLIBINSTFLAGS) $(DESTDIR)dest/LibraryTargetName(libname))
- #endif /* InstallLibrary */
- /*
- * InstallLinkKitLibrary - rule to install Link Kit library.
- * (only used for XFree86). This is a no-op
- * rule so that Imakefiles on non-XFree86 systems
- * continue to build Makefiles correctly.
- */
- #ifndef InstallLinkKitLibrary
- #define InstallLinkKitLibrary(lib,dir)
- #endif
- /*
- * InstallLinkKitNamedLibrary - rule to install Link Kit library.
- * (only used for XFree86). This is a no-op
- * rule so that Imakefiles on non-XFree86 systems
- * continue to build Makefiles correctly.
- */
- #ifndef InstallLinkKitNamedLibrary
- #define InstallLinkKitNamedLibrary(lib,dlib,dir)
- #endif
- /*
- * MergeIntoInstalledLibrary - generate rules to merge one library into another
- */
- #ifndef MergeIntoInstalledLibrary
- #define MergeIntoInstalledLibrary(tolib,fromlib) @@\
- install:: fromlib @@\
- $(SCRIPTSRC)/mergelib $(DESTDIR)tolib fromlib
- #endif /* MergeIntoInstalledLibrary */
- /*
- * InstallLibraryAlias - generate rules to create a link from one library name
- * to another for the purposes of aliasing.
- */
- #ifndef InstallLibraryAlias
- #define InstallLibraryAlias(libname,alias,dest) @@\
- install:: @@\
- -(cd $(DESTDIR)dest; \ @@\
- RemoveFile(LibraryTargetName(alias)); \ @@\
- $(LN) LibraryTargetName(libname) LibraryTargetName(alias))
- #endif /* InstallLibraryAlias */
- /*
- * InstallLintLibrary - generate rules to install the indicated lint library.
- */
- #ifndef InstallLintLibrary
- #define InstallLintLibrary(libname,dest) @@\
- InstallTarget(install.ln,Concat(llib-l,libname.ln),$(INSTLIBFLAGS),dest)
- #endif /* InstallLintLibrary */
- /*
- * InstallManPageLong - generate rules to install the indicated manual page,
- * giving it an alternate name. This is used for installing man pages whose
- * base name without the .man suffix would normally be longer than 8 characters
- * (the limit for using source code control systems on files systems with
- * short file names).
- */
- #ifndef InstallManPageLong
- #define InstallManPageLong(file,destdir,dest) @@\
- InstallNamedTarget(install.man,file.man,$(INSTMANFLAGS),destdir,dest.$(MANSUFFIX))
- #endif /* InstallManPageLong */
- /*
- * InstallManPage - generate rules to install the indicated manual page.
- */
- #ifndef InstallManPage
- #define InstallManPage(file,destdir) @@\
- InstallManPageLong(file,destdir,file)
- #endif /* InstallManPage */
- /*
- * InstallManPageAliases - generate rules to install manual page aliases.
- */
- #ifndef InstallManPageAliases
- #define InstallManPageAliases(file,destdir,aliases) @@\
- install.man:: @@\
- @(TMP=/tmp/tmp.$$$$; \ @@\
- RemoveFile($${TMP}); \ @@\
- echo .so `basename destdir`/file.$(MANSUFFIX) > $${TMP}; \ @@\
- for i in aliases; do (set -x; \ @@\
- $(INSTALL) $(INSTALLFLAGS) $(INSTMANFLAGS) $${TMP} $(DESTDIR)destdir/$$i.$(MANSUFFIX)); \ @@\
- done; \ @@\
- RemoveFile($${TMP}))
- #endif /* InstallManPageAliases */
- /*
- * ManKeywordsTarget - generate the database used by "man -k".
- * This rule updates the index in the directory "manpath", which
- * indexes all the manual pages in the section subdirectories under
- * it. An update command is defined only on systems that have a
- * per MANPATH element index. If the OS supports only one system-wide
- * database, we don't update it, because then we can't do cross
- * installations or use a non-empty DESTDIR for testing.
- */
- #ifndef ManKeywordsTarget
- #define ManKeywordsTarget(manpath) man_keywords::
- #endif
- /*
- * InstallNamedNonExec - generate rules to install a data file
- */
- #ifndef InstallNamedNonExec
- #define InstallNamedNonExec(srcname,dstname,dest) @@\
- InstallNamedTarget(install,srcname,$(INSTDATFLAGS),dest,dstname)
- #endif /* InstallNamedNonExec */
- /*
- * InstallNonExecFile - generate rules to install a data file
- */
- #ifndef InstallNonExecFile
- #define InstallNonExecFile(file,dest) @@\
- InstallTarget(install,file,$(INSTDATFLAGS),dest)
- #endif /* InstallNonExecFile */
- /*
- * InstallNonExecFileNoClobber - install a data file once
- */
- #ifndef InstallNonExecFileNoClobber
- #define InstallNonExecFileNoClobber(file,dest) @@\
- InstallNamedTargetNoClobber(install,file,$(INSTDATFLAGS),dest,file)
- #endif /* InstallNonExecFileNoClobber */
- /*
- * InstallLinkKitNonExecFile - rule for installing server Link Kit files.
- * (only used for XFree86). This is a no-op
- * rule so that Imakefiles on non-XFree86 systems
- * continue to build Makefiles correctly.
- */
- #ifndef InstallLinkKitNonExecFile
- #define InstallLinkKitNonExecFile(file,dir)
- #endif
- /*
- * InstallNonExec - generate rules to install a data file, but does not
- * try to create the destination directory (deprecated)
- */
- #ifndef InstallNonExec
- #define InstallNonExec(file,dest) @@\
- install:: file @@\
- $(INSTALL) $(INSTALLFLAGS) $(INSTDATFLAGS) file $(DESTDIR)dest
- #endif /* InstallNonExec */
- /*
- * InstallProgramWithFlags - generate rules to install an executable program
- * using given install flags.
- */
- #ifndef InstallProgramWithFlags
- #define InstallProgramWithFlags(program,dest,flags) @@\
- InstallTarget(install,ProgramTargetName(program),$(INSTPGMFLAGS) flags,dest)
- #endif /* InstallProgramWithFlags */
- /*
- * InstallProgram - generate rules to install an executable program using any
- * special install flags set in $(INSTALLFLAGS).
- */
- #ifndef InstallProgram
- #define InstallProgram(program,dest) @@\
- InstallProgramWithFlags(program,dest,NullParameter)
- #endif /* InstallProgram */
- /*
- * InstallScript - install a shell script.
- */
- #ifndef InstallScript
- #define InstallScript(program,dest) @@\
- InstallNamedTarget(install,program.script,$(INSTBINFLAGS),dest,program)
- #endif /* InstallScript */
- /*
- * InstallNamedProg - install a program with renaming and no stripping.
- */
- #ifndef InstallNamedProg
- #define InstallNamedProg(srcname,dstname,dest) @@\
- InstallNamedTarget(install,srcname,$(INSTBINFLAGS),dest,dstname)
- #endif /* InstallNamedProg */
- /*
- * InstallNamedProgNoClobber - Like InstallNamedProg, but doesn't
- * do the install if an installed version already exists.
- */
- #ifndef InstallNamedProgNoClobber
- #define InstallNamedProgNoClobber(srcname,dstname,dest) @@\
- InstallNamedTargetNoClobber(install,srcname,$(INSTBINFLAGS),dest,dstname)
- #endif /* InstallNamedProgNoClobber */
- /*
- * MakeFlagsToShellFlags - set variables before starting a loop.
- * makeflags is the set of "make" flags to check.
- * shellcmd is the shell command to execute if any of the flags are set.
- *
- * The usual use of this rule is to translate make's "don't quit on error"
- * flags into the equivalent for the shell. To do this, "make -i" always
- * becomes "set +e". "make -k" should also turn on "set +e" if the target
- * is building subdirectories. That is, subdirectories are independent
- * and should appear to be multiple targets, even though they are
- * implemented in a loop in a single target.
- */
- #ifndef MakeFlagsToShellFlags
- #define MakeFlagsToShellFlags(makeflags,shellcmd)\
- for flag in ${MAKEFLAGS} ''; do \ @@\
- case "$$flag" in *=*) ;; *[makeflags]*) shellcmd;; esac; done
- #endif
- /*
- * LinkFileList - link a list of files from one place to another
- */
- #ifndef LinkFileList
- #define LinkFileList(step,list,dir,sub) @@\
- step:: list @@\
- @MakeFlagsToShellFlags(i,set +e); \ @@\
- echo " cd" dir; cd dir && \ @@\
- for i in list; do (set -x; RemoveFile($$i); $(LN) sub/$$i .); done
- #endif
- /*
- * LinkVarDirectory
- *
- * Make links from $LIBDIR (<ProjectRoot>/lib/X11) to /var/X11/
- * For example /usr/X11R6/lib/X11/xdm ==> /var/X11/xdm so that X
- * binaries can be mounted from a read-only volume like a CD-ROM;
- * but files that may need to be edited can be stored locally on
- * read-write media. If someone has an existing installation, be
- * careful and move existing files to the new location in /var.
- */
- #ifndef LinkVarDirectory
- #if HasVarDirectory
- #define LinkVarDirectory(mdir,cdir,rdir,ldir) @@\
- install:: @@\
- MakeDir(Concat($(DESTDIR)$(LIBDIR)/,cdir)) @@\
- MakeDir(Concat($(VARDIR)/,mdir)) @@\
- @MakeFlagsToShellFlags(i,set +e); \ @@\
- if [ -d Concat($(DESTDIR)$(LIBDIR)/,cdir) ]; then \ @@\
- cd Concat($(DESTDIR)$(LIBDIR)/,cdir); \ @@\
- if [ -d rdir -a ! -h rdir ]; then \ @@\
- (cd rdir; tar cf - . | (cd Concat($(VARDIR)/,mdir); tar xf -; exit 0); exit 0); \ @@\
- fi; \ @@\
- $(RM) -r rdir; \ @@\
- $(LN) Concat($(VARDIR)/,mdir) ldir; \ @@\
- fi
- #else
- #define LinkVarDirectory(mdir,cdir,rdir,ldir)
- #endif
- #endif
- /*
- * InstallMultipleDestFlags - generate rules to install multiple files at
- * once during a particular step in the build using a specific set of install
- * flags.
- */
- #ifndef InstallMultipleDestFlags
- #define InstallMultipleDestFlags(step,list,dest,flags) @@\
- step:: list @@\
- MakeDir($(DESTDIR)dest) @@\
- @MakeFlagsToShellFlags(i,set +e); \ @@\
- for i in list; do \ @@\
- (set -x; $(INSTALL) $(INSTALLFLAGS) flags $$i $(DESTDIR)dest); \ @@\
- done
- #endif /* InstallMultipleDestFlags */
- /*
- * InstallMultipleDest - generate rules to install multiple files at once
- * during a particular step in the build using any install flags set in
- * $(INSTDATFLAGS).
- */
- #ifndef InstallMultipleDest
- #define InstallMultipleDest(step,list,dest) @@\
- InstallMultipleDestFlags(step,list,dest,$(INSTDATFLAGS))
- #endif /* InstallMultipleDest */
- /*
- * InstallMultiple - generate rules to install multiple files at once
- * during the install step of the build using any install flags set in
- * $(INSTALLFLAGS).
- */
- #ifndef InstallMultiple
- #define InstallMultiple(list,dest) @@\
- InstallMultipleDest(install,list,dest)
- #endif /* InstallMultiple */
- /*
- * InstallMultipleFlags - generate rules to install multiple files at once
- * during the install step of the build using the given install flags.
- */
- #ifndef InstallMultipleFlags
- #define InstallMultipleFlags(list,dest,flags) @@\
- InstallMultipleDestFlags(install,list,dest,flags)
- #endif /* InstallMultipleFlags */
- /*
- * InstallMultipleMan - generate rules to install a variety of manual pages
- * during the install.man step of the build.
- */
- #ifndef InstallMultipleMan
- #define InstallMultipleMan(list,dest) @@\
- InstallMultipleDestFlags(install.man,list,dest,$(INSTMANFLAGS))
- #endif /* InstallMultipleMan */
- /*
- * IncludeMakefile - rule to include another Makefile.
- * Must not generate an error or even a warning if the named file
- * is not present, since we use this to include Makefile.dep, which
- * may not be built yet.
- * This is defined non-null iff HasMakefileSafeInclude is YES.
- * The double-@ is to ensure no leading spaces on the line.
- */
- #ifndef IncludeMakefile
- #if HasClearmake
- #define IncludeMakefile(file) @@sinclude file
- #else
- #define IncludeMakefile(file) /**/
- #endif
- #endif
- /*
- * DependDependencyStatement - Used by DependDependency to set up the
- * most specific dependency, which differs based on whether we support
- * a separate Makefile.dep on this platform.
- */
- #ifndef DependDependencyStatement
- #if HasMakefileSafeInclude
- #define DependDependencyStatement() @@\
- DependFileName:: ProgramTargetName($(DEPEND))
- #else
- #define DependDependencyStatement() @@\
- depend:: ProgramTargetName($(DEPEND))
- #endif
- #endif
- /*
- * DependDependency - generate rules to build the makedepend program if
- * this Imakefile is within the source tree.
- */
- #ifndef DependDependency
- #ifdef UseInstalled
- #define DependDependency() /**/
- #else
- #define DependDependency() @@\
- DependDependencyStatement() @@\
- @@\
- NoCmpScript(ProgramTargetName($(DEPEND))) @@\
- @@\
- ProgramTargetName($(DEPEND)): @@\
- @echo "checking $@ over in $(DEPENDSRC) first..."; \ @@\
- cd $(DEPENDSRC) && $(MAKE); \ @@\
- echo "okay, continuing in $(CURRENT_DIR)"
- #endif /* UseInstalled */
- #endif /* DependDependency */
- /*
- * DependTarget - generate rules to compute dependencies for all files listed
- * in $(SRCS).
- */
- #ifndef DependTarget
- #if HasMakefileSafeInclude
- #define DependTarget() @@\
- DependDependency() @@\
- @@\
- depend:: DependFileName @@\
- @@\
- DependFileName:: @@\
- RunProgram(DEPEND,-f- $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- $(SRCS)) > $@
- #else /* HasMakefileSafeInclude */
- #define DependTarget() @@\
- DependDependency() @@\
- @@\
- depend:: @@\
- RunProgram(DEPEND,$(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- $(SRCS))
- #endif /* HasMakefileSafeInclude else */
- #endif /* DependTarget */
- /*
- * DependTarget3 - generate rules to compute dependencies for all files given.
- */
- #ifndef DependTarget3
- #if HasMakefileSafeInclude
- #define DependTarget3(srcs1,srcs2,srcs3) @@\
- DependDependency() @@\
- @@\
- depend:: DependFileName @@\
- @@\
- DependFileName:: @@\
- RunProgram(DEPEND,-f- $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs1) > $@ @@\
- RunProgram(DEPEND,-f- $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs2) >> $@ @@\
- RunProgram(DEPEND,-f- $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs3) >> $@
- #else /* HasMakefileSafeInclude */
- #define DependTarget3(srcs1,srcs2,srcs3) @@\
- DependDependency() @@\
- @@\
- depend:: @@\
- RunProgram(DEPEND,$(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs1) @@\
- RunProgram(DEPEND,-a $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs2) @@\
- RunProgram(DEPEND,-a $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- srcs3)
- #endif /* HasMakefileSafeInclude else */
- #endif /* DependTarget3 */
- /*
- * CleanTarget - generate rules to remove any garbage files
- */
- #ifndef CleanTarget
- #define CleanTarget() @@\
- clean:: @@\
- $(RM) FilesToClean ExtraFilesToClean "#"* @@\
- @@\
- ProofCleanTarget()
- #endif /* CleanTarget */
- /*
- * TagsTarget - generate rules to compute tags files for C source code.
- */
- #ifndef TagsTarget
- #define TagsTarget() @@\
- tags:: @@\
- $(TAGS) -w *.[ch] @@\
- $(TAGS) -xw *.[ch] > TAGS
- #endif /* TagsTarget */
- /*
- * ImakeDependency - generate rules to compile imake if this Imakefile is
- * within the source tree.
- */
- #ifndef ImakeDependency
- #ifdef UseInstalled
- #define ImakeDependency(target) /**/
- #else
- #define ImakeDependency(target) @@\
- target:: ProgramTargetName($(IMAKE)) @@\
- @@\
- NoCmpScript(ProgramTargetName($(IMAKE)) $(IMAKE).Osuf) @@\
- @@\
- ProgramTargetName($(IMAKE)) $(IMAKE).Osuf: @@\
- -@(cd $(IMAKESRC); if [ -f Makefile ]; then \ @@\
- echo "checking $@ in $(IMAKESRC) first..."; $(MAKE) all; else \ @@\
- echo "bootstrapping $@ from Makefile.ini in $(IMAKESRC) first..."; \ @@\
- $(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; fi; \ @@\
- echo "okay, continuing in $(CURRENT_DIR)")
- #endif /* UseInstalled */
- #endif /* ImakeDependency */
- /*
- * BuildMakefileTarget - generate rules to build a Makefile from an Imakefile
- * and any special imake flags. This is generally done automatically by the
- * template or by any special Imakefiles. The first argument exists just
- * because imakeflags is usually empty and some preprocessors will complain
- * if an empty argument is passed as the sole argument to a macro.
- */
- #ifndef BuildMakefileTarget
- #define BuildMakefileTarget(notused,imakeflags) @@\
- ImakeDependency(Makefile) @@\
- @@\
- Makefile:: @@\
- RMoveToBakFile(Makefile) @@\
- $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) imakeflags
- #endif /* BuildMakefileTarget */
- /*
- * MakefileTarget - generate rules to build a normal Makefile.
- */
- #ifndef MakefileTarget
- #define MakefileTarget() @@\
- BuildMakefileTarget(Imakefile,NullParameter)
- #endif /* MakefileTarget */
- /*
- * LibMkdir - helper for creating library object subdirectories
- */
- #ifndef LibMkdir
- #define LibMkdir(dir) DirFailPrefix@if [ -d dir ]; then exit 0; else set -x; mkdir dir; fi
- #endif
- #ifndef LibMkdirLinkSubdirs
- #define LibMkdirLinkSubdirs(dir) DirFailPrefix@if [ -d dir ]; then \ @@\
- exit 0; \ @@\
- else \ @@\
- echo "mkdir dir"; mkdir dir; \ @@\
- for i in $(SUBDIRS); do \ @@\
- j=`echo "$$i" | $(SED) -e 's;[^/]\{1,\};..;g'`; \ @@\
- $(MKDIRHIER) "dir/`dirname $$i`"; \ @@\
- echo $(LN) "$$j/$$i/dir" "dir/$$i"; \ @@\
- $(LN) "$$j/$$i/dir" "dir/$$i"; \ @@\
- done; \ @@\
- fi
- #endif
- /*
- * LibCleanDir - helper for cleaning library object subdirectories
- */
- #ifndef LibCleanDir
- #define LibCleanDir(dir) -@if [ -d dir ]; then \ @@\
- set -x; $(RM) -r dir; else exit 0; fi
- #endif
- /*
- * LintLibReferences - variables for lint libraries
- */
- #ifndef LintLibReferences
- #define LintLibReferences(varname,libname,libsource) @@\
- Concat(LINT,varname) = _UseCat($(LINTLIBDIR)/llib-l,libsource/llib-,libname.ln)
- #endif
- /*
- * UnsharedLibReferences - variables for unshared libraries
- */
- #ifndef UnsharedLibReferences
- #define UnsharedLibReferences(varname,libname,libsource) @@\
- ProjectUnsharedLibReferences(varname,libname,libsource,$(BUILDLIBDIR))
- #endif
- /*
- * ProjectUnsharedLibReferences - variables for unshared libraries
- */
- #ifndef ProjectUnsharedLibReferences
- #define ProjectUnsharedLibReferences(varname,libname,libsource,buildlibdir) @@\
- Concat3(DEP,varname,LIB) = _UseCat($(USRLIBDIR)/lib,buildlibdir/lib,libname.a) @@\
- Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\
- LintLibReferences(varname,libname,libsource)
- #endif
- /*
- * SharedLibDependencies - shared library dependencies
- */
- #ifndef SharedLibDependencies
- #define SharedLibDependencies(libname,libsource,revname) /**/
- #endif
- /*
- * SharedDSLibDependencies - shared library dependencies with data separation
- */
- #ifndef SharedDSLibDependencies
- #define SharedDSLibDependencies(libname,libsource,revname) /**/
- #endif
- /*
- * SharedLibReferences - variables for shared libraries
- */
- #ifndef SharedLibReferences
- #define SharedLibReferences(varname,libname,libsource,revname,rev) @@\
- revname = rev @@\
- Concat3(DEP,varname,LIB) = SharedLibDependencies(libname,libsource,revname) @@\
- Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\
- LintLibReferences(varname,libname,libsource)
- #endif
- /*
- * SharedDSLibReferences - variables for shared libraries with data separation
- */
- #ifndef SharedDSLibReferences
- #define SharedDSLibReferences(varname,libname,libsource,revname,rev) @@\
- revname = rev @@\
- Concat3(DEP,varname,LIB) = SharedDSLibDependencies(libname,libsource,revname) @@\
- Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\
- LintLibReferences(varname,libname,libsource)
- #endif
- /*
- * CPPOnlyCompile - run C compiler's preprocessor only
- */
- #ifndef CPPOnlyCompile
- #define CPPOnlyCompile(src,options) RemoveFile($@) @@\
- ClearmakeOSName \
- $(CC) -E $(CFLAGS) options src > $@
- #endif
- /*
- * ObjectCompile - compile fragment for a normal object file
- */
- #ifndef ObjectCompile
- #define ObjectCompile(options) RemoveFile($@) @@\
- ClearmakeOSName \
- $(CC) -c $(CFLAGS) options $*.c
- #endif
- #ifndef ObjectCplusplusCompile
- #define ObjectCplusplusCompile(options) RemoveFile($@) @@\
- ClearmakeOSName \
- $(CXX) -c $(CXXFLAGS) options $*.CCsuf
- #endif
- /*
- * NormalLibObjCompile - compile fragment for a normal library object file
- */
- #ifndef NormalLibObjCompile
- #define NormalLibObjCompile(options) ObjectCompile(options)
- #endif
- #ifndef NormalLibObjCplusplusCompile
- #define NormalLibObjCplusplusCompile(options) ObjectCplusplusCompile(options)
- #endif
- /*
- * NormalSharedLibObjCompile - compile fragment for shared objects
- */
- #ifndef NormalSharedLibObjCompile
- #define NormalSharedLibObjCompile(options) NormalLibObjCompile(options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS))
- #endif
- #ifndef NormalSharedLibObjCplusplusCompile
- #define NormalSharedLibObjCplusplusCompile(options) NormalLibObjCplusplusCompile(options $(SHLIBDEF) $(SHAREDCODEDEF) $(CXXPICFLAGS))
- #endif
- /*
- * LibObjCompile - compile fragment for unshared/profiled/debugged objects
- */
- #ifndef LibObjCompile
- #define LibObjCompile(dir,options) RemoveFiles($@ dir/$@) @@\
- ClearmakeOSName \
- $(CC) -c $(CCOPTIONS) $(ALLDEFINES) options $*.c @@\
- $(MV) $@ dir/$@
- #endif
- #ifndef LibObjCplusplusCompile
- #define LibObjCplusplusCompile(dir,options) RemoveFiles($@ dir/$@) @@\
- ClearmakeOSName \
- $(CXX) -c $(CXXOPTIONS) $(CXXDEFINES) options $*.CCsuf @@\
- $(MV) $@ dir/$@
- #endif
- /*
- * DebuggedLibObjCompile - compile fragment for debugged objects
- */
- #ifndef DebuggedLibObjCompile
- #define DebuggedLibObjCompile(options) LibObjCompile(debugger,DebuggableCDebugFlags options)
- #endif
- #ifndef DebuggedLibObjCplusplusCompile
- #define DebuggedLibObjCplusplusCompile(options) LibObjCplusplusCompile(debugger,DebuggableCplusplusDebugFlags options)
- #endif
- /*
- * ProfiledLibObjCompile - compile fragment for profiled objects
- */
- #ifndef ProfiledLibObjCompile
- #define ProfiledLibObjCompile(options) LibObjCompile(profiled,ProfiledCDebugFlags options)
- #endif
- #ifndef ProfiledLibObjCplusplusCompile
- #define ProfiledLibObjCplusplusCompile(options) LibObjCplusplusCompile(profiled,ProfiledCplusplusDebugFlags options)
- #endif
- /*
- * UnsharedLibObjCompile - compile fragment for unshared objects
- */
- #ifndef UnsharedLibObjCompile
- #define UnsharedLibObjCompile(options) LibObjCompile(unshared,$(CDEBUGFLAGS) options)
- #endif
- #ifndef UnsharedLibObjCplusplusCompile
- #define UnsharedLibObjCplusplusCompile(options) LibObjCplusplusCompile(unshared,$(CXXDEBUGFLAGS) options)
- #endif
- /*
- * SharedLibObjCompile - compile fragment for shared objects
- */
- #ifndef SharedLibObjCompile
- #define SharedLibObjCompile(options) LibObjCompile(shared,options $(SHLIBDEF) $(SHAREDCODEDEF) $(PICFLAGS) $(CDEBUGFLAGS))
- #endif
- /*
- * NormalLibraryObjectRule - for simple libraries
- */
- #ifndef NormalLibraryObjectRule
- #define NormalLibraryObjectRule() @@\
- .c.Osuf: @@\
- NormalLibObjCompile($(_NOOP_))
- #endif /* NormalLibraryObjectRule */
- #ifndef NormalCplusplusObjectRule
- #define NormalCplusplusObjectRule() @@\
- .CCsuf.Osuf: @@\
- NormalLibObjCplusplusCompile($(_NOOP_))
- #endif
- #ifndef NormalFortranObjectRule
- #define NormalFortranObjectRule() @@\
- .f.Osuf: @@\
- RemoveFile($@) @@\
- ClearmakeOSName \
- $(FC) -c $(FCFLAGS) $*.f
- #endif
- /*
- * SpecialObjectRule - generate rules to compile a file with special flags.
- */
- #ifndef SpecialObjectRule
- #define SpecialObjectRule(objs,depends,options) @@\
- objs: depends @@\
- ObjectCompile(options)
- #endif /* SpecialObjectRule */
- #ifndef SpecialCplusplusObjectRule
- #define SpecialCplusplusObjectRule(baseobj,basedep,options) @@\
- baseobj.Osuf: basedep.CCsuf @@\
- ObjectCplusplusCompile(options)
- #endif /* SpecialCplusplusObjectRule */
- /*
- * SpecialCObjectRule - generate rules to compile a C file with special flags.
- * also handles CodeCenter rules
- */
- #ifndef SpecialCObjectRule
- #define SpecialCObjectRule(basename,depends,options) @@\
- SpecialObjectRule(basename.Osuf,basename.c depends,options) @@\
- @@\
- basename.i: basename.c depends @@\
- CPPOnlyCompile(basename.c,options) @@\
- @@\
- CenterLoadTarget(debug_src,basename.c,NullParameter,$(ALLDEFINES) options)
- #endif /* SpecialCObjectRule */
- #ifndef ObjectFromSpecialSource
- #define ObjectFromSpecialSource(dst,src,flags) @@\
- NoConfigRec(dst.c) @@\
- @@\
- dst.c: src.c @@\
- RemoveFile($@) @@\
- $(LN) $? $@ @@\
- @@\
- SpecialCObjectRule(dst,NullParameter,flags) @@\
- @@\
- depend:: dst.c @@\
- @@\
- clean:: @@\
- RemoveFile(dst.c)
- #endif /* ObjectFromSpecialSource */
- #ifndef LexFileExplicit
- #if HasClearmake /* provide a place to hang ClearmakeOSName */
- #define LexFileExplicit(file) @@\
- file.c: file.l @@\
- ClearmakeOSName \
- $(LEX) $(LFLAGS) file.l @@\
- $(MV) lex.yy.c file.c
- #else
- #define LexFileExplicit(file) /* the default rule is fine */
- #endif
- #endif
- #ifndef LexFile
- #define LexFile(file) @@\
- LexFileExplicit(file) @@\
- @@\
- depend:: file.c @@\
- @@\
- clean:: @@\
- RemoveFiles(lex.yy.c file.c)
- #endif /* LexFile */
- #ifndef YaccFile
- #define YaccFile(file,flags) @@\
- depend:: file.c @@\
- @@\
- file.h file.c: file.y @@\
- ClearmakeOSName \
- $(YACC) flags file.y @@\
- $(MV) y.tab.c file.c @@\
- @if [ -f y.tab.h ]; then set -x; $(MV) y.tab.h file.h; \ @@\
- else exit 0; fi @@\
- @@\
- clean:: @@\
- RemoveFiles(y.tab.c y.tab.h file.h file.c)
- #endif /* YaccFile */
- #ifndef YaccFileNoFlags
- #define YaccFileNoFlags(file) @@\
- depend:: file.c @@\
- @@\
- file.c: file.y @@\
- ClearmakeOSName \
- $(YACC) file.y @@\
- $(MV) y.tab.c file.c @@\
- @@\
- clean:: @@\
- RemoveFiles(y.tab.c file.c)
- #endif /* YaccFileNoFlags */
- #ifndef MakeLibrary
- #define MakeLibrary(libname,objlist) $(AR) libname objlist
- #endif
- #ifndef LinkBuildLibrary
- #ifdef UseInstalled
- #define LinkBuildLibrary(lib) $(_NULLCMD_)
- #else
- #define LinkBuildLibrary(lib) MakeDir($(BUILDLIBDIR)) @@\
- RemoveFile($(BUILDLIBDIR)/lib) @@\
- cd $(BUILDLIBDIR) && $(LN) $(BUILDLIBTOP)/$(CURRENT_DIR)/lib .
- #endif
- #endif /* LinkBuildLibrary */
- #ifndef _LinkBuildLibrary /* will get redefined elsewhere */
- #define _LinkBuildLibrary(lib) $(_NULLCMD_)
- #endif /* _LinkBuildLibrary */
- /*
- * NormalLibraryTarget - generate rules to create a library.
- */
- #ifndef NormalLibraryTarget
- #define NormalLibraryTarget(libname,objlist) @@\
- AllTarget(LibraryTargetName(libname)) @@\
- @@\
- LibraryTargetName(libname): objlist $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- MakeLibrary($@,objlist) @@\
- RanLibrary($@) @@\
- _LinkBuildLibrary($@)
- #endif /* NormalLibraryTarget */
- /*
- * NormalLibraryTarget2 - generate rules to create a library in two steps.
- * This is used to create libraries with large numbers of files.
- */
- #ifndef NormalLibraryTarget2
- #define NormalLibraryTarget2(libname,objlist1,objlist2) @@\
- AllTarget(LibraryTargetName(libname)) @@\
- @@\
- LibraryTargetName(libname): objlist1 objlist2 $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- MakeLibrary($@,objlist1) @@\
- MakeLibrary($@,objlist2) @@\
- RanLibrary($@) @@\
- _LinkBuildLibrary($@)
- #endif /* NormalLibraryTarget2 */
- /*
- * NormalLibraryTarget3 - generate rules to create a library in three steps.
- * This is used to create libraries with very large numbers of files.
- */
- #ifndef NormalLibraryTarget3
- #define NormalLibraryTarget3(libname,objlist1,objlist2,objlist3) @@\
- AllTarget(LibraryTargetName(libname)) @@\
- @@\
- LibraryTargetName(libname): objlist1 objlist2 objlist3 $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- MakeLibrary($@,objlist1) @@\
- MakeLibrary($@,objlist2) @@\
- MakeLibrary($@,objlist3) @@\
- RanLibrary($@) @@\
- _LinkBuildLibrary($@)
- #endif /* NormalLibraryTarget3 */
- /*
- * NormalDepLibraryTarget - generate rules to create a library.
- */
- #ifndef NormalDepLibraryTarget
- #define NormalDepLibraryTarget(libname,deplist,objlist) @@\
- AllTarget(LibraryTargetName(libname)) @@\
- @@\
- LibraryTargetName(libname): deplist $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- MakeLibrary($@,objlist) @@\
- RanLibrary($@) @@\
- _LinkBuildLibrary($@)
- #endif /* NormalDepLibraryTarget */
- /*
- * UnsharedLibraryTarget - generate rules to create a library.
- */
- #ifndef UnsharedLibraryTarget
- #define UnsharedLibraryTarget(libname,objlist,down,up) @@\
- AllTarget(LibraryTargetName(libname)) @@\
- @@\
- LibraryTargetName(libname): objlist $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- (cd down && MakeLibrary(up/$@,objlist)) @@\
- RanLibrary($@) @@\
- _LinkBuildLibrary($@)
- #endif /* UnsharedLibraryTarget */
- /*
- * UnsharedLibraryTarget3 - generate rules to create a library in three steps.
- * This is used to create libraries with very large numbers of files.
- */
- #ifndef UnsharedLibraryTarget3
- #define UnsharedLibraryTarget3(libname,objlist1,objlist2,objlist3,down,up) @@\
- AllTarget(LibraryTargetName(libname)) @@\
- @@\
- LibraryTargetName(libname): objlist1 objlist2 objlist3 $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- (cd down && MakeLibrary(up/$@,objlist1)) @@\
- (cd down && MakeLibrary(up/$@,objlist2)) @@\
- (cd down && MakeLibrary(up/$@,objlist3)) @@\
- RanLibrary($@) @@\
- _LinkBuildLibrary($@)
- #endif /* UnsharedLibraryTarget3 */
- /*
- * SubdirLibraryRule -
- */
- #ifndef SubdirLibraryRule
- #define SubdirLibraryRule(objlist) @@\
- all:: DONE @@\
- @@\
- DONE: objlist @@\
- RemoveFile($@) @@\
- touch $@ @@\
- @@\
- clean:: @@\
- RemoveFile(DONE)
- #endif /* SubdirLibraryRule */
- /*
- * ProfiledLibraryTarget - generate rules to create a profiled library.
- */
- #ifndef ProfiledLibraryTarget
- #define ProfiledLibraryTarget(libname,objlist) @@\
- AllTarget(LibraryTargetNameSuffix(libname,_p)) @@\
- @@\
- LibraryTargetNameSuffix(libname,_p): objlist $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- cd profiled && MakeLibrary(../$@,objlist) @@\
- RanLibrary($@)
- #endif /* ProfiledLibraryTarget */
- /*
- * DebuggedLibraryTarget - generate rules to create a debuggable library.
- */
- #ifndef DebuggedLibraryTarget
- #define DebuggedLibraryTarget(libname,objlist) @@\
- AllTarget(LibraryTargetNameSuffix(libname,_d)) @@\
- @@\
- LibraryTargetNameSuffix(libname,_d): objlist $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- cd debugger && MakeLibrary(../$@,objlist) @@\
- RanLibrary($@)
- #endif /* DebuggedLibraryTarget */
- /*
- * AliasedLibraryTarget - generate rules to link one library to another.
- */
- #ifndef AliasedLibraryTarget
- #define AliasedLibraryTarget(libname,alias) @@\
- AllTarget(LibraryTargetName(alias)) @@\
- @@\
- LibraryTargetName(alias): LibraryTargetName(libname) @@\
- RemoveFile($@) @@\
- $(LN) LibraryTargetName(libname) $@ @@\
- @@\
- clean:: @@\
- RemoveFile(LibraryTargetName(alias))
- #endif /* AliasedLibraryTarget */
- /*
- * NormalRelocatableTarget - generate rules to produce a relocatable object
- * file instead of a library.
- */
- #ifndef NormalRelocatableTarget
- #define NormalRelocatableTarget(objname,objlist) @@\
- AllTarget(objname.Osuf) @@\
- @@\
- objname.Osuf: objlist $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- $(LD) $(LDCOMBINEFLAGS) objlist -o $@
- #endif /* NormalRelocatableTarget */
- /*
- * ProfiledRelocatableTarget - generate rules to produce a profiled relocatable
- * object file instead of a library.
- */
- #ifndef ProfiledRelocatableTarget
- #define ProfiledRelocatableTarget(objname,objlist) @@\
- AllTarget(Concat(objname,_p.Osuf)) @@\
- @@\
- Concat(objname,_p.Osuf): objlist $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- $(LD) -X -r objlist -o $@
- #endif /* ProfiledRelocatableTarget */
- /*
- * DebuggedRelocatableTarget - generate rules to produce a debuggable
- * relocatable object file instead of a library.
- */
- #ifndef DebuggedRelocatableTarget
- #define DebuggedRelocatableTarget(objname,objlist) @@\
- AllTarget(Concat(objname,_d.Osuf)) @@\
- @@\
- Concat(objname,_d.Osuf): objlist $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- $(LD) -X -r objlist -o $@
- #endif /* DebuggedRelocatableTarget */
- /*
- * LintLibraryTarget - generate rules to create a lint library. Note that the
- * lint library is always forced to be newer than the library itself.
- */
- #ifndef LintLibraryTarget
- #define LintLibraryTarget(libname,srclist) @@\
- lintlib:: Concat(llib-l,libname.ln) @@\
- @@\
- Concat(llib-l,libname.ln): srclist $(EXTRALIBRARYDEPS) @@\
- RemoveFile($@) @@\
- $(LINT) Concat($(LINTLIBFLAG),libname) $(LINTFLAGS) srclist
- #endif /* LintLibraryTarget */
- /*
- * NormalLintTarget - generate rules to lint a set of sources.
- */
- #ifndef NormalLintTarget
- #define NormalLintTarget(srclist) @@\
- lint: @@\
- $(LINT) $(LINTFLAGS) srclist $(LINTLIBS) @@\
- lint1: @@\
- $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
- #endif /* NormalLintTarget */
- /*
- * LintTarget - generate rules to lint $(SRCS)
- */
- #ifndef LintTarget
- #define LintTarget() @@\
- NormalLintTarget($(SRCS))
- #endif
- /*
- * LinkSourceFile - snag source file from some other directory
- */
- #ifndef LinkSourceFile
- #define LinkSourceFile(src,dir) @@\
- src: dir/src @@\
- RemoveFile($@) @@\
- $(LN) $? $@ @@\
- @@\
- NoConfigRec(src) @@\
- @@\
- includes:: src @@\
- @@\
- depend:: src @@\
- @@\
- clean:: @@\
- RemoveFile(src)
- #endif
- /*
- * CopySourceFile - snag source file from some other directory
- */
- #ifndef CopySourceFile
- #define CopySourceFile(src,dir) @@\
- src: dir/src @@\
- RemoveFile($@) @@\
- $(CP) $? $@ @@\
- @@\
- NoConfigRec(src) @@\
- @@\
- includes:: src @@\
- @@\
- depend:: src @@\
- @@\
- clean:: @@\
- RemoveFile(src)
- #endif
- /*
- * LinkFile - link a file
- */
- #ifndef LinkFile
- #define LinkFile(tofile,fromfile) @@\
- tofile:: fromfile @@\
- RemoveFile($@) @@\
- $(LN) $? $@ @@\
- @@\
- NoConfigRec(tofile) @@\
- @@\
- includes:: tofile @@\
- @@\
- depend:: tofile @@\
- @@\
- clean:: @@\
- RemoveFile(tofile)
- #endif
- #ifndef MakeSubincludesForBuild
- #define MakeSubincludesForBuild(step,dir,srclist) @@\
- step:: dir srclist @@\
- @-(list=`echo srclist | $(SED) -e 's/[^ ]*\///g'`; \ @@\
- set -x; cd dir; RemoveFiles($$list)) @@\
- @for i in srclist; do \ @@\
- (set -x; cd dir; $(LN) ../$$i .); \ @@\
- done @@\
- @@\
- dir:: @@\
- $(MKDIRHIER) dir @@\
- @@\
- clean:: @@\
- @-(if [ -d dir ]; then \ @@\
- list=`echo srclist | $(SED) -e 's/[^ ]*\///g'`; \ @@\
- set -x; cd dir; RemoveFile($$list); else exit 0; fi)
- #endif
- /*
- * LangNamedTargetSubdirs - recursively make a series of steps
- */
- #ifndef LangNamedTargetSubdirs
- #define LangNamedTargetSubdirs(lang,name,dirs,verb,flags,subname) @@\
- name:: @@\
- @MakeFlagsToShellFlags(ik,set +e); \ @@\
- for i in dirs ;\ @@\
- do \ @@\
- echo verb "in $(CURRENT_DIR)/$$i..."; \ @@\
- (cd $$i && LANG=lang $(MAKE) $(MFLAGS) flags subname);\ @@\
- done
- #endif
- /*
- * NamedMakeSubdirs - generate rules to do makes in the given subdirectories.
- * If you want CDEBUGFLAGS passed along to subdirectories, provide a line like
- * the following in the appropriate Imakefile
- *
- * #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
- */
- #ifndef LangNamedMakeSubdirs
- #define LangNamedMakeSubdirs(lang,name,dirs) \
- LangNamedTargetSubdirs(lang,name,dirs,"making" name,PassCDebugFlags,all)
- #endif /* LangNamedMakeSubdirs */
- #ifndef LangMakeSubdirs
- #define LangMakeSubdirs(lang,dirs) @@\
- LangNamedMakeSubdirs(lang,all,dirs)
- #endif /* LangMakeSubdirs */
- /*
- * NamedTargetSubdirs - recursively make a series of steps
- */
- #ifndef NamedTargetSubdirs
- #define NamedTargetSubdirs(name,dirs,verb,flags,subname) @@\
- name:: @@\
- @MakeFlagsToShellFlags(ik,set +e); \ @@\
- for i in dirs ;\ @@\
- do \ @@\
- echo verb "in $(CURRENT_DIR)/$$i..."; \ @@\
- (cd $$i && $(MAKE) $(MFLAGS) flags subname); \ @@\
- done
- #endif
- /*
- * NamedMakeSubdirs - generate rules to do makes in the given subdirectories.
- * If you want CDEBUGFLAGS passed along to subdirectories, provide a line like
- * the following in the appropriate Imakefile
- *
- * #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
- */
- #ifndef NamedMakeSubdirs
- #define NamedMakeSubdirs(name,dirs) \
- NamedTargetSubdirs(name,dirs,"making" name,PassCDebugFlags,all)
- #endif /* NamedMakeSubdirs */
- #ifndef MakeSubdirs
- #define MakeSubdirs(dirs) @@\
- NamedMakeSubdirs(all,dirs)
- #endif /* MakeSubdirs */
- /*
- * DependSubdirs - generate rules to recursively compute dependencies as
- * part of the make depend step.
- */
- #ifndef DependSubdirs
- #define DependSubdirs(dirs) \
- NamedTargetSubdirs(depend,dirs,"depending",NullParameter,depend)
- #endif /* DependSubdirs */
- /*
- * ForceSubdirs - force make to build subdirectories
- */
- #ifndef ForceSubdirs
- #define ForceSubdirs(dirs) @@\
- dirs: FRC @@\
- @cd $@ ; echo "making all in $(CURRENT_DIR)/$@..."; \ @@\
- $(MAKE) $(MFLAGS) PassCDebugFlags all @@\
- @@\
- FRC:
- #endif /* ForceSubdirs */
- /*
- * InstallSubdirs - generate rules to recursively install programs and files.
- */
- #ifndef InstallSubdirs
- #define InstallSubdirs(dirs) \
- NamedTargetSubdirs(install,dirs,"installing",DESTDIR=$(DESTDIR),install)
- #endif /* InstallSubdirs */
- /*
- * InstallManSubdirs - generate rules to recursively install manual pages.
- */
- #ifndef InstallManSubdirs
- #define InstallManSubdirs(dirs) \
- NamedTargetSubdirs(install.man,dirs,"installing man pages",DESTDIR=$(DESTDIR),install.man)
- #endif /* InstallManSubdirs */
- /*
- * IncludesSubdirs - generate rules to recursively put include files in build
- */
- #ifndef IncludesSubdirs
- #define IncludesSubdirs(dirs) \
- NamedTargetSubdirs(includes,dirs,including,NullParameter,includes)
- #endif
- /*
- * InstallLinkKitSubdirs - generate rules to recursively install server Link
- * Kit (only used for XFree86). This is a no-op
- * rule so that Imakefiles on non-XFree86 systems
- * continue to build Makefiles correctly.
- */
- #ifndef InstallLinkKitSubdirs
- #define InstallLinkKitSubdirs(dirs)
- #endif
- /*
- * CleanSubdirs - generate rules to recursively clean out garbage files.
- */
- #define BootstrapCleanSubdirs /**/ /* used at top-level */
- #ifndef NamedCleanSubdirs
- #define NamedCleanSubdirs(name,dirs) \
- NamedTargetSubdirs(name,dirs,"cleaning",BootstrapCleanSubdirs,clean)
- #endif /* NamedCleanSubdirs */
- #ifndef CleanSubdirs
- #define CleanSubdirs(dirs) \
- NamedCleanSubdirs(clean,dirs)
- #endif
- /*
- * TagSubdirs - generate rules to recursively create tags files.
- */
- #ifndef NamedTagSubdirs
- #define NamedTagSubdirs(name,dirs) \
- NamedTargetSubdirs(name,dirs,"tagging",TAGS='$(TAGS)',tags)
- #endif /* TagSubdirs */
- #ifndef TagSubdirs
- #define TagSubdirs(dirs) \
- NamedTagSubdirs(tags,dirs)
- #endif
- /*
- * MakeLintSubdirs - generate rules to recursively lint directories as part
- * of the named step.
- */
- #ifndef MakeLintSubdirs
- #define MakeLintSubdirs(dirs,target,subtarget) \
- NamedTargetSubdirs(target,dirs,"linting" for target and subtarget,DESTDIR=$(DESTDIR) LINTOPTS='$(LINTOPTS)',subtarget)
- #endif /* MakeLintSubdirs */
- /*
- * LintSubdirs - generate rules to recursively lint directories as part of
- * the make lint step.
- */
- #ifndef LintSubdirs
- #define LintSubdirs(dirs) @@\
- MakeLintSubdirs(dirs,lint,lint)
- #endif /* LintSubdirs */
- /*
- * MakeLintLibSubdirs - generate rules to recursively create lint libraries.
- */
- #ifndef MakeLintLibSubdirs
- #define MakeLintLibSubdirs(dirs) @@\
- MakeLintSubdirs(dirs,lintlib,lintlib)
- #endif /* MakeLintLibSubdirs */
- /*
- * MakeMakeOneSubdirs - generate rules to recreate $(ONESUBDIR)/Makefile
- * as part of the specified step in the build. This separate, explicit target
- * exists so that clearmake will know what its goal is and do wink-in.
- */
- #ifndef MakeMakeOneSubdirs
- #define MakeMakeOneSubdirs() @@\
- $(ONESUBDIR)/Makefile: @@\
- @MakeFlagsToShellFlags(n,executeit="no"); \ @@\
- cd $(ONESUBDIR); \ @@\
- if [ "$$executeit" != "no" ]; then \ @@\
- ImakeSubCmdHelper -DTOPDIR=$(IMAKETOP) -DCURDIR=$(ONECURDIR)$(ONESUBDIR); \ @@\
- fi;
- #endif /* MakeMakeOneSubdirs */
- /*
- * MakeMakeSubdirs - generate rules to recursively recreate Makefiles as part
- * of the specified step in the build. If $(TOP) is set to an absolute path,
- * do not prepend the ../ prefix. This makes running things outside of the
- * source tree much easier.
- */
- #ifndef MakeMakeSubdirs
- #define MakeMakeSubdirs(dirs,target) @@\
- target:: @@\
- -@MakeFlagsToShellFlags(ik,set +e); \ @@\
- MakeFlagsToShellFlags(n,executeit="no"); \ @@\
- for i in dirs ;\ @@\
- do \ @@\
- case "$(CURRENT_DIR)" in \ @@\
- .) curdir= ;; \ @@\
- *) curdir=$(CURRENT_DIR)/ ;; \ @@\
- esac; \ @@\
- echo "making Makefiles in $$curdir$$i..."; \ @@\
- itmp=`echo $$i | $(SED) -e 's;^\./;;g' -e 's;/\./;/;g'`; \ @@\
- curtmp="$(CURRENT_DIR)" \ @@\
- toptmp=""; \ @@\
- case "$$itmp" in \ @@\
- ../?*) \ @@\
- while echo "$$itmp" | grep '^\.\./' > /dev/null;\ @@\
- do \ @@\
- toptmp="/`basename $$curtmp`$$toptmp"; \ @@\
- curtmp="`dirname $$curtmp`"; \ @@\
- itmp="`echo $$itmp | $(SED) 's;\.\./;;'`"; \ @@\
- done \ @@\
- ;; \ @@\
- esac; \ @@\
- case "$$itmp" in \ @@\
- */?*/?*/?*/?*) newtop=../../../../..;; \ @@\
- */?*/?*/?*) newtop=../../../..;; \ @@\
- */?*/?*) newtop=../../..;; \ @@\
- */?*) newtop=../..;; \ @@\
- *) newtop=..;; \ @@\
- esac; \ @@\
- newtop="$$newtop$$toptmp"; \ @@\
- case "$(TOP)" in \ @@\
- /?*) imaketop=$(TOP) \ @@\
- imakeprefix= ;; \ @@\
- .) imaketop=$$newtop \ @@\
- imakeprefix=$$newtop/ ;; \ @@\
- *) imaketop=$$newtop/$(TOP) \ @@\
- imakeprefix=$$newtop/ ;; \ @@\
- esac; \ @@\
- RemoveFile($$i/Makefile.bak); \ @@\
- if [ -f $$i/Makefile ]; then \ @@\
- echo " $(MV) Makefile Makefile.bak"; \ @@\
- if [ "$$executeit" != "no" ]; then \ @@\
- $(MV) $$i/Makefile $$i/Makefile.bak; \ @@\
- fi; \ @@\
- fi; \ @@\
- $(MAKE) $(MFLAGS) $(MAKE_OPTS) ONESUBDIR=$$i ONECURDIR=$$curdir IMAKETOP=$$imaketop IMAKEPREFIX=$$imakeprefix $$i/Makefile; \ @@\
- cd $$i; \ @@\
- $(MAKE) $(MFLAGS) Makefiles; \ @@\
- cd $$newtop; \ @@\
- done
- #ifdef UseInstalled
- #define ImakeSubCmdHelper $(IMAKE_CMD)
- #else
- #define ImakeSubCmdHelper $(IMAKEPREFIX)$(IMAKE) -I$(IMAKEPREFIX)$(IRULESRC) $(IMAKE_DEFINES) $(IMAKE_DEF_DTINFO)
- #endif
- #endif /* MakeMakeSubdirs */
- /*
- * MakefileSubdirs - generate rules to create Makefiles.
- */
- #ifndef MakefileSubdirs
- #define MakefileSubdirs(dirs) @@\
- MakeMakeOneSubdirs() @@\
- MakeMakeSubdirs(dirs,Makefiles)
- #endif /* MakefileSubdirs */
- /*
- * Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
- * to cpp, because that trick does not work on all ANSI C preprocessors.
- * Also delete line numbers from the cpp output (-P is not portable, I guess).
- */
- #ifndef CppSedMagic
- #define CppSedMagic $(SED) -e '/^#[line]* *[0-9][0-9]* *.*$$/d' -e '/^XCOMM$$/s//#/' -e '/^XCOMM[^a-zA-Z0-9_]/s/^XCOMM/#/'
- #endif /* CppSedMagic */
- #ifndef CppFileTarget
- #define CppFileTarget(dst,src,defs,deplist) @@\
- dst:: src deplist @@\
- RemoveFile($@) @@\
- ClearmakeOSName \
- $(CPP) CppNoLineInfoOption defs <src | CppSedMagic >$@ @@\
- @@\
- clean:: @@\
- RemoveFiles(dst)
- #endif /* CppFileTarget */
- /*
- * CppScriptTarget - generate rules to create a shell script by running the
- * input through cpp. If the ExecableScripts configuration parameter is not
- * set, then make sure that the first line begins with a colon.
- */
- #ifndef CppScriptTarget
- #if ExecableScripts /* can use #! instead of colon */
- #define CppScriptTarget(dst,src,defs,deplist) @@\
- dst:: src deplist @@\
- RemoveFile($@) @@\
- ClearmakeOSName \
- $(CPP) CppNoLineInfoOption defs <src | CppSedMagic >$@ @@\
- chmod a+x $@ @@\
- @@\
- clean:: @@\
- RemoveFiles(dst)
- #else
- #define CppScriptTarget(dst,src,defs,deplist) @@\
- dst:: src deplist @@\
- RemoveFile($@) @@\
- ClearmakeOSName \
- echo \: >$@ @@\
- $(SED) '1d' src | $(CPP) CppNoLineInfoOption defs | CppSedMagic >>$@ @@\
- chmod a+x $@ @@\
- @@\
- clean:: @@\
- RemoveFile(dst)
- #endif /* ExecableScripts */
- #endif /* CppScriptTarget */
- /*
- * MakeScriptFromCpp - generate rules to create a script from a file with a
- * .cpp suffix.
- */
- #ifndef MakeScriptFromCpp
- #define MakeScriptFromCpp(name,defs) @@\
- CppScriptTarget(name,name.cpp,defs,NullParameter)
- #endif /* MakeScriptFromCpp */
- #ifndef CppSourceFile
- #define CppSourceFile(dst,src,defs,deplist) @@\
- CppFileTarget(dst,src,defs,deplist) @@\
- @@\
- includes:: dst @@\
- @@\
- depend:: dst
- #endif /* CppSourceFile */
- /*
- * SedFileTarget - generate rules to create a file by running the
- * input through sed.
- */
- #ifndef SedFileTarget
- #define SedFileTarget(dst,src,cmds) @@\
- dst:: src @@\
- RemoveFile($@) @@\
- $(SED) cmds src >$@ @@\
- chmod a+x $@ @@\
- @@\
- clean:: @@\
- RemoveFiles(dst)
- #endif /* SedFileTarget */
- #ifndef SedSourceFile
- #define SedSourceFile(dst,src,cmds) @@\
- SedFileTarget(dst,src,cmds) @@\
- @@\
- includes:: dst @@\
- @@\
- depend:: dst
- #endif /* SedSourceFile */
- /*
- * MakeDirectories - generate rules to create a hierarchy of directories.
- */
- #ifndef MakeDirectories
- #define MakeDirectories(step,dirs) @@\
- step:: @@\
- DirFailPrefix@MakeFlagsToShellFlags(i,set +e); \ @@\
- for i in dirs; do if [ -d $(DESTDIR)$$i ]; then \ @@\
- set +x; else (set -x; $(MKDIRHIER) $(DESTDIR)$$i); fi \ @@\
- done
- #endif /* MakeDirectories */
- /*
- * AllTarget - generate rules to build necessary things during make all.
- */
- #ifndef AllTarget
- #define AllTarget(depends) @@\
- all:: depends
- #endif /* AllTarget */
- /*
- * MakeImakeDir - call make in imake directory.
- */
- #ifndef MakeImakeDir
- #define MakeImakeDir() cd $(IMAKESRC) && \ @@\
- if [ -f Makefile ]; then \ @@\
- $(MAKE) $(MFLAGS) BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ @@\
- else \ @@\
- $(MAKE) $(MFLAGS) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"; \ @@\
- fi
- #endif /* MakeImakeDir */
- /*
- * DoUDB_SCRIPT3 - macro for creation of udb scripts for installation
- */
- #ifndef DoUDB_SCRIPT3
- #define DoUDB_SCRIPT3(target, file, script, build) @@\
- target:: $(DATABASE_DIR)/file.udb @@\
- script -toLst -ReleaseStream $(PLATFORM) \ @@\
- $(DATABASE_DIR)/file.udb > file.lst @@\
- build file ../../..
- #endif
- /*
- * DoUDB_SCRIPT4 - macro for creation of udb scripts for installation
- */
- #ifndef DoUDB_SCRIPT4
- #define DoUDB_SCRIPT4(target, file, script, build) @@\
- target:: $(DATABASE_DIR)/file.udb @@\
- script -toLst -ReleaseStream $(PLATFORM) \ @@\
- $(DATABASE_DIR)/file.udb > file.lst @@\
- build file ../../../..
- #endif
- #ifdef DefineOldLibraryRules
- #include <oldlib.rules>
- #endif
|