home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / live / usr / X11R6 / lib / X11 / config / xf86.rules < prev    next >
Text File  |  1999-09-03  |  5KB  |  200 lines

  1. XCOMM $XConsortium: xf86.rules /main/9 1996/10/31 14:54:26 kaleb $
  2. XCOMM $XFree86: xc/config/cf/xf86.rules,v 3.16.2.2 1999/07/23 09:00:21 hohndel Exp $
  3.  
  4. /*
  5.  * These rules are needed to build the Xfree86 X Servers
  6.  */
  7.  
  8. #ifndef CPPOnlyAsm
  9. #define CPPOnlyAsm(basename,options) RemoveFile(basename.i)        @@\
  10.     $(CPP) AsmDefines $(DEFINES) $(INCLUDES) options basename.s | \    @@\
  11.         grep -v '^\#' > basename.i
  12. #endif
  13.  
  14. #ifndef AssembleObject
  15. #define AssembleObject(flags) CPPOnlyAsm($*,flags)            @@\
  16.     RemoveFile($*.o)                        @@\
  17.     $(AS) -o $*.o $*.i                        @@\
  18.     RemoveFile($*.i)
  19. #endif
  20.  
  21. #ifndef NormalAsmObjectRule
  22. #define NormalAsmObjectRule()                        @@\
  23. .s.o:                                    @@\
  24.     AssembleObject($(_NOOP_))                    @@\
  25.                                     @@\
  26. .s.i:                                    @@\
  27.     CPPOnlyAsm($*,$(_NOOP_))
  28. #endif
  29.  
  30. #ifndef ObjectFromSpecialAsmSource
  31. #define ObjectFromSpecialAsmSource(dst,src,flags)            @@\
  32. dst.s:  src.s                                @@\
  33.     RemoveFile($@)                            @@\
  34.     $(LN) $? $@                            @@\
  35.                                     @@\
  36. dst.o:  dst.s                                @@\
  37.     AssembleObject(flags)                        @@\
  38.                                     @@\
  39. dst.i:  dst.s                                @@\
  40.     CPPOnlyAsm(dst,flags)                        @@\
  41.                                     @@\
  42. depend:: dst.s                                @@\
  43.                                     @@\
  44. clean::                                    @@\
  45.     RemoveFile(dst.s)
  46. #endif
  47.  
  48. #ifndef ObjectFromAsmSource
  49. #define ObjectFromAsmSource(src,flags)                    @@\
  50.                                     @@\
  51. src.o:  src.s                                @@\
  52.     AssembleObject(flags)                        @@\
  53.                                     @@\
  54. src.i:  src.s                                @@\
  55.     CPPOnlyAsm(dst,flags)                        @@\
  56.                                     @@\
  57. depend:: src.s
  58. #endif
  59.  
  60. #ifndef ObjectMapIncludeFromSpecialSource
  61. #define ObjectMapIncludeFromSpecialSource(dst,src,flags)        @@\
  62. dst.c:    src.c                                @@\
  63.     RemoveFile($@)                            @@\
  64.     echo "#include \"mfbmap.h\"" > $@                @@\
  65.     echo "#include \"$?\"" >> $@                    @@\
  66.                                     @@\
  67. SpecialCObjectRule(dst,NullParameter,flags)                @@\
  68.                                     @@\
  69. depend::    dst.c                            @@\
  70.                                     @@\
  71. clean::                                    @@\
  72.     RemoveFile(dst.c)
  73. #endif
  74.  
  75.  
  76. /*
  77.  * Rules for building config files from scripts
  78.  */
  79.  
  80. #ifndef Depend
  81. # define Depend depend
  82. #endif
  83.  
  84. #ifndef ConfigTargetLong
  85. #define ConfigTargetLong(target,dep,script,args,extra)            @@\
  86. all:: Configure                                @@\
  87.                                     @@\
  88. Configure:: target.o                            @@\
  89.                                     @@\
  90. target.c: script dep                            @@\
  91.     $(MAKE) $(MFLAGS) Makefile                    @@\
  92.     $(MAKE) $(MFLAGS) extra Concat(Build,target)            @@\
  93.                                     @@\
  94. Concat(Build,target):                            @@\
  95.     $(RM) target.c                            @@\
  96.     $(SHELL) script args                        @@\
  97.                                     @@\
  98. clean::                                    @@\
  99.     $(RM) target.c
  100. #endif
  101.  
  102. #define ConfigTarget(target,dep,script,args) ConfigTargetLong(target,dep,script,args,Depend)
  103.  
  104. #define ConfigTargetNoDepend(target,dep,script,args) ConfigTargetLong(target,dep,script,args,)
  105.  
  106. #if !XF86LinkKit
  107.  
  108. /*
  109.  * Rules for installing LinkKit parts (target is install.linkkit)
  110.  */
  111.  
  112. #ifndef InstallLinkKitNonExecFile
  113. #define InstallLinkKitNonExecFile(file,dest)                @@\
  114. install.linkkit:: file                            @@\
  115.     MakeDir($(DESTDIR)dest)                        @@\
  116.     $(INSTALL) -c $(INSTDATFLAGS) file $(DESTDIR)dest
  117. #endif
  118.  
  119. #ifndef InstallLinkKitLibrary
  120. #define InstallLinkKitLibrary(libname,dest)                @@\
  121. install.linkkit:: Concat(lib,libname.a)                    @@\
  122.     MakeDir($(DESTDIR)dest)                        @@\
  123.     $(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.a) $(DESTDIR)dest @@\
  124.     RanLibrary($(RANLIBINSTFLAGS) Concat($(DESTDIR)dest/lib,libname.a))
  125. #endif
  126.  
  127. #ifndef InstallLinkKitNamedLibrary
  128. #define InstallLinkKitNamedLibrary(libname,dlibname,dest)        @@\
  129. install.linkkit:: Concat(lib,libname.a)                    @@\
  130.     MakeDir($(DESTDIR)dest)                        @@\
  131.     $(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.a) \        @@\
  132.       Concat($(DESTDIR)dest/lib,dlibname.a)                @@\
  133.     RanLibrary($(RANLIBINSTFLAGS) Concat($(DESTDIR)dest/lib,dlibname.a))
  134. #endif
  135.  
  136. #ifndef InstallLinkKitNamedNonExec
  137. #define InstallLinkKitNamedNonExec(srcname,dstname,dest)        @@\
  138. install.linkkit:: srcname                        @@\
  139.     MakeDir($(DESTDIR)dest)                        @@\
  140.     $(INSTALL) -c $(INSTDATFLAGS) srcname $(DESTDIR)dest/dstname
  141. #endif
  142.  
  143. #ifndef InstallLinkKitNamedProg
  144. #define InstallLinkKitNamedProg(srcname,dstname,dest)            @@\
  145. install.linkkit:: srcname                        @@\
  146.     MakeDir($(DESTDIR)dest)                        @@\
  147.     $(INSTALL) -c $(INSTBINFLAGS) srcname $(DESTDIR)dest/dstname
  148. #endif
  149.  
  150. #ifndef InstallLinkKitSubdirs
  151. #define InstallLinkKitSubdirs(dirs) \
  152. NamedTargetSubdirs(install.linkkit,dirs,"installing link kit",DESTDIR='$(DESTDIR)',install.linkkit)
  153. #endif
  154.  
  155. #ifndef InstallLinkKitMultipleDestFlags
  156. #define InstallLinkKitMultipleDestFlags(list,dest,flags) \
  157. InstallMultipleDestFlags(install.linkkit,list,dest,flags)
  158. #endif
  159.  
  160. #endif /* !XF86LinkKit */
  161.  
  162. /*
  163.  * DynamicModuleTarget - build a module to be dynamically loaded
  164.  */
  165. #if !UseElfFormat
  166. #ifndef DynamicModuleTarget
  167. #define DynamicModuleTarget(module,modlist)                @@\
  168. AllTarget(module)                            @@\
  169.                                     @@\
  170. module: modlist                                @@\
  171.     RemoveFile($@)                            @@\
  172.     $(LD) -o $@ $(SHLIBLDFLAGS) modlist                @@\
  173.                                     @@\
  174. clean::                                    @@\
  175.     RemoveFile(module)
  176. #endif /* DynamicModuleTarget */
  177. #else
  178. #ifndef DynamicModuleTarget
  179. #define DynamicModuleTarget(module,modlist)                @@\
  180. AllTarget(module)                            @@\
  181.                                     @@\
  182. module: modlist                                @@\
  183.     RemoveFile($@)                            @@\
  184.     $(CC) -o $@ $(SHLIBLDFLAGS) modlist                @@\
  185.                                     @@\
  186. clean::                                    @@\
  187.     RemoveFile(module)
  188. #endif /* DynamicModuleTarget */
  189. #endif
  190. /*
  191.  * InstallDynamicModule - install a dynamic module
  192.  */
  193. #ifndef InstallDynamicModule
  194. #define InstallDynamicModule(module,dest)                @@\
  195. install:: module                            @@\
  196.     MakeDir($(DESTDIR)dest)                        @@\
  197.     $(INSTALL) -c module $(DESTDIR)dest
  198. #endif
  199.  
  200.