necLib.rules 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. XCOMM $XConsortium: necLib.rules /main/4 1996/09/28 16:11:42 rws $
  2. /*
  3. * NECOS shared library rules
  4. */
  5. #ifndef HasSharedLibraries
  6. #define HasSharedLibraries YES
  7. #endif
  8. #ifndef SharedDataSeparation
  9. #define SharedDataSeparation YES
  10. #endif
  11. #ifndef SharedCodeDef
  12. #define SharedCodeDef
  13. #endif
  14. #ifndef SharedLibraryDef
  15. #define SharedLibraryDef
  16. #endif
  17. #ifndef ShLibIncludeFile
  18. #define ShLibIncludeFile <necLib.tmpl>
  19. #endif
  20. #ifndef SharedLibraryLoadFlags
  21. #define SharedLibraryLoadFlags
  22. #endif
  23. #ifndef PositionIndependentCFlags
  24. #define PositionIndependentCFlags
  25. #endif
  26. #ifndef SeparateSharedCompile
  27. #define SeparateSharedCompile NO
  28. #endif
  29. #define SharedLibObjCompile(options) $(_NULLCMD_)
  30. /*
  31. * InstallSharedLibrary - generate rules to install the shared library.
  32. */
  33. #ifndef InstallSharedLibrary
  34. #define InstallSharedLibrary(libname,rev,dest) @@\
  35. install:: Concat(lib,libname.so.rev) @@\
  36. MakeDir($(DESTDIR)dest) @@\
  37. $(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest @@\
  38. cd $(DESTDIR)/dest; $(LN) Concat(lib,libname.so.rev) Concat(lib,libname.so) @@\
  39. #endif /* InstallSharedLibrary */
  40. /*
  41. * InstallSharedLibraryData - generate rules to install the shared library data
  42. */
  43. #ifndef InstallSharedLibraryData
  44. #define InstallSharedLibraryData(libname,rev,dest) @@\
  45. install:: Concat(lib,libname.sa.rev) @@\
  46. MakeDir($(DESTDIR)dest) @@\
  47. $(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.sa.rev) $(DESTDIR)dest @@\
  48. RanLibrary($(RANLIBINSTFLAGS) Concat($(DESTDIR)dest/lib,libname.sa.rev))
  49. #endif /* InstallSharedLibraryData */
  50. /*
  51. * SharedLibraryTarget - generate rules to create a shared library;
  52. * build it into a different name so that we do not hose people by having
  53. * the library gone for long periods.
  54. */
  55. #ifndef SharedLibraryTarget
  56. #define SharedLibraryTarget(libname,rev,solist,down,up) @@\
  57. AllTarget(Concat(lib,libname.so.rev)) @@\
  58. @@\
  59. Concat(lib,libname.so.rev): solist $(EXTRALIBRARYDEPS) @@\
  60. $(RM) $@~ @@\
  61. $(CC) -G -o $@~ $(SHLIBLDFLAGS) solist @@\
  62. $(RM) $@ @@\
  63. $(MV) $@~ $@ @@\
  64. @@\
  65. AllTarget(Concat(lib,libname.so)) @@\
  66. @@\
  67. Concat(lib,libname.so): Concat(lib,libname.so.rev) @@\
  68. $(RM) $@ @@\
  69. $(LN) $? $@ @@\
  70. LinkBuildLibrary($@) @@\
  71. LinkBuildLibrary(Concat(lib,libname.so)) @@\
  72. @@\
  73. clean:: @@\
  74. $(RM) Concat(lib,libname.so.rev)
  75. #endif /* SharedLibraryTarget */
  76. /*
  77. * SharedLibraryDataTarget - generate rules to create shlib data file;
  78. */
  79. #ifndef SharedLibraryDataTarget
  80. #define SharedLibraryDataTarget(libname,rev,salist) @@\
  81. AllTarget(Concat(lib,libname.sa.rev)) @@\
  82. @@\
  83. Concat(lib,libname.sa.rev): salist $(EXTRALIBRARYDEPS) @@\
  84. $(RM) $@ @@\
  85. $(AR) $@ salist @@\
  86. RanLibrary($@) @@\
  87. @@\
  88. clean:: @@\
  89. $(RM) Concat(lib,libname.sa.rev)
  90. #endif /* SharedLibraryDataTarget */