Markus Mottl avatar Markus Mottl committed a4f57fa

Updated OCamlMakefile

Comments (0)

Files changed (3)

+2006-11-22: Updated OCamlMakefile.
+
 2003-04-08: Updated OCamlMakefile.
 
             Added BNF-modules to the CFG-library, since they often
 #                             For updates see:
 #                http://www.ocaml.info/home/ocaml_sources.html
 #
-#        $Id: OCamlMakefile,v 1.6 2006/01/16 23:57:56 mottl Exp $
+#        $Id: OCamlMakefile,v 1.72 2005/12/09 15:30:50 mottl Exp $
 #
 ###########################################################################
 
 ifndef OCAMLCPFLAGS
   OCAMLCPFLAGS := a
 endif
+export OCAMLCPFLAGS
 
-export OCAMLCPFLAGS
+ifndef DOC_DIR
+  DOC_DIR := doc
+endif
+export DOC_DIR
 
 export PPFLAGS
 
 export CPPFLAGS
 
 ifndef RPATH_FLAG
-  RPATH_FLAG := -R
+  ifdef ELF_RPATH_FLAG
+    RPATH_FLAG := $(ELF_RPATH_FLAG)
+  else
+    RPATH_FLAG := -R
+  endif
 endif
 export RPATH_FLAG
 
 CINCFLAGS += $(SOURCE_DIRS:%=-I%) $(INCDIRS:%=-I%) $(OCAML_DEFAULT_DIRS:%=-I%)
 
 ifndef MSVC
-CLIBFLAGS += $(SOURCE_DIRS:%=-L%) $(LIBDIRS:%=-L%) \
-             $(EXTLIBDIRS:%=-L%) $(EXTLIBDIRS:%=-Wl,$(RPATH_FLAG)%) \
-             $(OCAML_DEFAULT_DIRS:%=-L%)
+  CLIBFLAGS += $(SOURCE_DIRS:%=-L%) $(LIBDIRS:%=-L%) \
+               $(EXTLIBDIRS:%=-L%) $(OCAML_DEFAULT_DIRS:%=-L%)
+
+  ifeq ($(ELF_RPATH), yes)
+    CLIBFLAGS += $(EXTLIBDIRS:%=-Wl,$(RPATH_FLAG)%)
+  endif
 endif
 
 ifndef PROFILING
 endif
 
 ifndef MSVC
-COMMON_LDFLAGS := $(LDFLAGS:%=-ccopt %) $(SOURCE_DIRS:%=-ccopt -L%) \
-		  $(LIBDIRS:%=-ccopt -L%) $(EXTLIBDIRS:%=-ccopt -L%) \
-		  $(EXTLIBDIRS:%=-ccopt -Wl,$(RPATH_FLAG)%) \
-		  $(OCAML_DEFAULT_DIRS:%=-ccopt -L%)
+  COMMON_LDFLAGS := $(LDFLAGS:%=-ccopt %) $(SOURCE_DIRS:%=-ccopt -L%) \
+		    $(LIBDIRS:%=-ccopt -L%) $(EXTLIBDIRS:%=-ccopt -L%) \
+		    $(EXTLIBDIRS:%=-ccopt -Wl $(OCAML_DEFAULT_DIRS:%=-ccopt -L%))
+
+  ifeq ($(ELF_RPATH),yes)
+    COMMON_LDFLAGS += $(EXTLIBDIRS:%=-ccopt -Wl,$(RPATH_FLAG)%)
+  endif
 else
-COMMON_LDFLAGS := -ccopt "/link -NODEFAULTLIB:LIBC $(LDFLAGS:%=%) $(SOURCE_DIRS:%=-LIBPATH:%) \
-		  $(LIBDIRS:%=-LIBPATH:%) $(EXTLIBDIRS:%=-LIBPATH:%) \
-		  $(OCAML_DEFAULT_DIRS:%=-LIBPATH:%) "
+  COMMON_LDFLAGS := -ccopt "/link -NODEFAULTLIB:LIBC $(LDFLAGS:%=%) $(SOURCE_DIRS:%=-LIBPATH:%) \
+		    $(LIBDIRS:%=-LIBPATH:%) $(EXTLIBDIRS:%=-LIBPATH:%) \
+		    $(OCAML_DEFAULT_DIRS:%=-LIBPATH:%) "
 endif
 
 CLIBS_OPTS := $(CLIBS:%=-cclib -l%)
 panc:	pack-native-code
 
 # generates HTML-documentation
-htdoc:	doc/$(RESULT)/html
+htdoc:	$(DOC_DIR)/$(RESULT)/html
 
 # generates Latex-documentation
-ladoc:	doc/$(RESULT)/latex
+ladoc:	$(DOC_DIR)/$(RESULT)/latex
 
 # generates PostScript-documentation
-psdoc:	doc/$(RESULT)/latex/doc.ps
+psdoc:	$(DOC_DIR)/$(RESULT)/latex/doc.ps
 
 # generates PDF-documentation
-pdfdoc:	doc/$(RESULT)/latex/doc.pdf
+pdfdoc:	$(DOC_DIR)/$(RESULT)/latex/doc.pdf
 
 # generates all supported forms of documentation
 doc: htdoc ladoc psdoc pdfdoc
 else
 ifdef BYTE_OCAML
 $(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo: $(REAL_IMPL_INTF)
-			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmo $(REAL_IMPL)
+			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmo $(OCAMLLDFLAGS) $(REAL_IMPL)
 else
 $(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmx: $(REAL_IMPL_INTF)
-			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmx $(REAL_IMPL)
+			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmx  $(OCAMLLDFLAGS) $(REAL_IMPL)
 endif
 
 $(RESULT).cma:		$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS)
 .c.$(EXT_OBJ):
 			$(OCAMLC) -c -cc "$(CC)" -ccopt "$(CFLAGS) \
 				$(CPPFLAGS) $(CPPFLAGS_WIN32) \
-				$(CFLAGS_WIN32) $(CINCFLAGS) $(CFLAG_O)$@ " $< 
+				$(CFLAGS_WIN32) $(CINCFLAGS) $(CFLAG_O)$@ " $<
 
 .$(EXT_CXX).$(EXT_OBJ):
 			$(CXX) -c $(CXXFLAGS) $(CINCFLAGS) $(CPPFLAGS) \
 			    -pp "$$pp $(PPFLAGS)" $(DINCFLAGS) $< > $@; \
 			fi
 
-doc/$(RESULT)/html: $(DOC_FILES)
+$(DOC_DIR)/$(RESULT)/html: $(DOC_FILES)
 	rm -rf $@
 	mkdir -p $@
 	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
 	  	$(INCFLAGS) $(DOC_FILES); \
 	fi
 
-doc/$(RESULT)/latex: $(DOC_FILES)
+$(DOC_DIR)/$(RESULT)/latex: $(DOC_FILES)
 	rm -rf $@
 	mkdir -p $@
 	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
 	  	$(INCFLAGS) $(DOC_FILES) -o $@/doc.tex; \
 	fi
 
-doc/$(RESULT)/latex/doc.ps: doc/$(RESULT)/latex
-	cd doc/$(RESULT)/latex && \
+$(DOC_DIR)/$(RESULT)/latex/doc.ps: $(DOC_DIR)/$(RESULT)/latex
+	cd $(DOC_DIR)/$(RESULT)/latex && \
 	  $(LATEX) doc.tex && \
 	  $(LATEX) doc.tex && \
 	  $(DVIPS) $(DVIPSFLAGS) doc.dvi -o $(@F)
 
-doc/$(RESULT)/latex/doc.pdf: doc/$(RESULT)/latex/doc.ps
-	cd doc/$(RESULT)/latex && $(PS2PDF) $(<F)
+$(DOC_DIR)/$(RESULT)/latex/doc.pdf: $(DOC_DIR)/$(RESULT)/latex/doc.ps
+	cd $(DOC_DIR)/$(RESULT)/latex && $(PS2PDF) $(<F)
 
 define make_subproj
 .PHONY:
 
 .PHONY: clean-doc
 clean-doc::
-	rm -rf doc
+	rm -rf $(DOC_DIR)/html $(DOC_DIR)/latex $(DOC_DIR)/dot
 
 .PHONY: nobackup
 nobackup:
-release-1-7-3
+release-1-7-4
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.