Chrene

Mosml Makefile.inc

Aug 31st, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.72 KB | None | 0 0
  1. # Unix configuration Makefile for Moscow ML -*- mode: makefile -*-
  2.  
  3. # Where to install stuff
  4. PREFIX=/usr/local
  5.  
  6. # BINDIR contains true executable files, such as scripts
  7. # LIBDIR contains bytecode files (such as mosmlcmp and library units), and .dll/.so for dynlibs.
  8. # RPATH is set to include LIBDIR
  9. # INCDIR contains the runtime system header files (for compiling dynlibs)
  10. # DOCDIR contains documentation
  11.  
  12. BINDIR=${PREFIX}/bin
  13. LIBDIR=${PREFIX}/lib/mosml
  14. INCDIR=${PREFIX}/include/mosml
  15. DOCDIR=${PREFIX}/share/doc/mosml
  16. TOOLDIR=${PREFIX}/share/mosml/tools
  17.  
  18. ### Where to install the man pages
  19. # Man pages for commands go in $(MANDIR)/man$(MANEXT)
  20. MANDIR=${PREFIX}/man
  21. MANEXT=1
  22.  
  23.  
  24. # The version
  25. VERSION=2.10
  26.  
  27. # Various utility programs
  28. INSTALL_PROGRAM=cp
  29. INSTALL_SCRIPT=cp
  30. INSTALL_DATA=cp
  31. PERL=perl
  32.  
  33. BASELIBS=-lm
  34.  
  35. # This works with most systems, including MacOS X with XCode installed:
  36.  
  37. CC=gcc
  38. # CC=/usr/sepp/bin/gcc # Solaris at KVL
  39.  
  40. # To compile the runtime system camlrunm with support for
  41. # dynamically loadable libraries (DDLs), set DYNLIBSUPPORT to true
  42. DYNLIBSUPPORT=true
  43.  
  44. ifeq ($(DYNLIBSUPPORT),true)
  45. ADDPRIMS=dynlib.c
  46. ADDOBJS=dynlib.o
  47. endif
  48.  
  49. ADDRUNLIBS=-ldl
  50. ADDRUNCFLAGS=-fPIC
  51. ADDDYNLIBCFLAGS=-fPIC
  52.  
  53.  
  54. # For Linux, use:
  55. # ------------------------------
  56. CPP=cpp -P -traditional -Dunix -Umsdos
  57. STRIP=strip -S
  58. LD=gcc -rdynamic -Wl,-rpath,$(LIBDIR)
  59. #DYNLD=gcc -shared
  60.  
  61. # For MacOS X, use the same as Linux except:
  62. # -----------------
  63. DYNLD=$(LD) -bundle -undefined dynamic_lookup
  64.  
  65. # For FreeBSD, use:
  66. # -----------------
  67. # CPP=/usr/bin/cpp -P -traditional -Dunix -Umsdos
  68. # STRIP=strip
  69. # LD=gcc -export-dynamic -Wl,-rpath,$(LIBDIR)
  70. # DYNLD=ld -shared
  71. # ADDRUNLIBS=
  72.  
  73.  
  74. # For Cygwin 20.1, use:
  75. # ---------------------
  76. # MOSMLHOME=/mosml
  77. # CPP=/lib/cpp -P -traditional -Dunix -Umsdos
  78. # STRIP=strip
  79. # LD=gcc -Wl,--export-dynamic -Wl,-rpath,$(LIBDIR)
  80. # DYNLD=ld -shared
  81. # EXE=.exe
  82. # # For dynamically loadable libraries (DDLs) under Cygwin:
  83. # ADDPRIMS=dynlib.c
  84. # ADDOBJS=dynlib.o
  85. # ADDRUNCFLAGS=
  86. # ADDDYNLIBCFLAGS=
  87.  
  88. # For NetBSD, use:
  89. # ------------------------
  90. # CPP=/usr/bin/cpp -P -traditional -Dunix -Umsdos
  91. # STRIP=/usr/bin/strip
  92. # ADDRUNCFLAGS=-fPIC
  93. # ADDDYNLIBCFLAGS=-fPIC
  94. # INSTALL_PROGRAM=${BSD_INSTALL_PROGRAM}
  95. # INSTALL_SCRIPT=${BSD_INSTALL_SCRIPT}
  96. # INSTALL_DATA=${BSD_INSTALL_DATA}
  97.  
  98. # For Solaris 2 (not SunOS 4), use:
  99. # ---------------------------------
  100. # CPP=/usr/ccs/lib/cpp -P -Dunix -Umsdos
  101. # STRIP=/usr/ccs/bin/strip
  102. # LD=gcc
  103. # DYNLD=ld -G -B symbolic -z nodefs
  104. # ADDRUNCFLAGS=
  105. # ADDDYNLIBCFLAGS=
  106.  
  107. # If the above fails with dynlibs, try this:
  108. # LD=gcc -Wl,--export-dynamic -Wl,-rpath,$(LIBDIR)
  109.  
  110.  
  111. # For HP-UX 9, use:
  112. # -----------------
  113. # CPP=/lib/cpp -P -Dunix -Umsdos
  114. # STRIP=strip
  115. # LD=gcc -Xlinker -E
  116. # DYNLD=ld -b -B symbolic -E
  117. # ADDRUNLIBS=-ldld
  118. # ADDRUNCFLAGS=-fPIC
  119. # ADDDYNLIBCFLAGS=-fPIC
  120.  
  121. # For HP-UX 10, use:
  122. # ------------------
  123. # CPP=/opt/langtools/lbin/cpp -P -Dunix -Umsdos
  124. # STRIP=strip
  125. # LD=gcc -Xlinker -E
  126. # DYNLD=ld -b -B symbolic -E
  127. # ADDRUNLIBS=-ldld
  128. # ADDRUNCFLAGS=-fPIC
  129. # ADDDYNLIBCFLAGS=-fPIC
  130.  
  131. # For OSF/1 (Digital Unix), use:
  132. # ------------------------------
  133. # CPP=/lib/cpp -P -traditional -Dunix -Umsdos
  134. # STRIP=strip
  135. # LD=gcc
  136. # DYNLD=ld -shared
  137. # ADDRUNLIBS=
  138. # ADDCFLAGS=
  139. # ADDRUNCFLAGS=
  140. # ADDDYNLIBCFLAGS=
  141.  
  142. # For Irix, use:
  143. # --------------
  144. # CPP=/lib/cpp -P -Dunix -Umsdos
  145. # STRIP=/usr/bin/strip
  146. # LD=gcc -rdynamic
  147. # DYNLD=ld -shared
  148.  
  149. SHELL=/bin/sh
  150.  
  151. # ---------- You shouldn't need to edit below this line ------------
  152. ROOTDIR:=$(CURDIR)/..
  153.  
  154. CAMLRT=$(ROOTDIR)/runtime
  155.  
  156. MOSMLTOOLS=$(ROOTDIR)/tools
  157.  
  158. MOSMLC=$(ROOTDIR)/camlrunm $(ROOTDIR)/mosmlcmp -stdlib $(ROOTDIR)/mosmllib -P none
  159. MOSMLL=$(ROOTDIR)/camlrunm $(ROOTDIR)/mosmllnk -stdlib $(ROOTDIR)/mosmllib -P none
  160. MOSMLLDOS=$(ROOTDIR)/camlrunm $(ROOTDIR)/mosmllnk.dos -stdlib $(ROOTDIR)/mosmllib -P none
  161. MOSMLLW32=$(ROOTDIR)/camlrunm $(ROOTDIR)/mosmllnk.w32 -stdlib $(ROOTDIR)/mosmllib -P none
  162. MOSMLLNEW=$(ROOTDIR)/camlrunm $(ROOTDIR)/mosmllnk.new -stdlib $(ROOTDIR)/mosmllib -P none
  163.  
  164. MOSMLLEX=$(ROOTDIR)/camlrunm $(ROOTDIR)/mosmllex
  165. MOSMLYACC=$(ROOTDIR)/mosmlyac/mosmlyac
  166. MOSMLCUT=$(ROOTDIR)/camlrunm $(ROOTDIR)/cutdeps
  167. MOSMLDEP=$(ROOTDIR)/camlrunm $(ROOTDIR)/mosmldep
  168.  
  169. # For cross-compiling to MS DOS (from Linux) (development only)
  170. # CPP=/lib/cpp -P -traditional -Uunix -Dmsdos -Uwin32
  171.  
  172. # For cross-compiling to Win 32 (from Linux) (development only)
  173. # CPP=/lib/cpp -P -traditional -Umsdos -Uunix -Dwin32
  174.  
  175. .SUFFIXES :
  176. .SUFFIXES : .sml .sig .ui .uo .mlp .lex .c .o
  177.  
  178. .sig.ui:
  179. $(MOSMLC) $(COMPFLAGS) $<
  180.  
  181. .sml.uo:
  182. $(MOSMLC) $(COMPFLAGS) $<
  183.  
  184. .mlp.sml:
  185. $(CPP) $< > $*.sml
  186.  
  187. .lex.sml:
  188. $(MOSMLLEX) $<
  189.  
  190. .c.o:
  191. $(CC) -c $(CFLAGS) -o $@ $<
Advertisement
Add Comment
Please, Sign In to add comment