Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Build improvements:

- fixes #1 (Piqi Ocaml library installation procedure conflicts with deps
  install)
- a better setenv.sh file
- moved away from a custom deps/Makefile to a generic one
- created deps/.gitignore
  • Loading branch information...
commit ef20fc6e2f59da8326e939ca588449cdfd57ff3e 1 parent 4d84d0a
Anton Lavrik authored
34 Makefile
View
@@ -7,11 +7,37 @@ DIRS = \
piqicc piqic piqi-tools \
-.PHONY: deps install ocaml-install ocaml-uninstall erlang erlang-clean
+.PHONY: deps install ocaml-install ocaml-uninstall erlang erlang-clean distclean
+
+
+# export installation and search path for OCaml dependencies
+ifeq ($(MAKECMDGOALS),deps)
+OCAMLFIND_DESTDIR = $(PIQI_BUILD)/lib/ocaml
+OCAMLPATH = $(OCAMLFIND_DESTDIR)
+export OCAMLFIND_DESTDIR OCAMLPATH
+endif
+
+
+# export installation path for Piqi OCaml libraries
+OCAML_INSTALL_GOAL = true
+ifeq ($(MAKECMDGOALS),ocaml-install)
+else ifeq ($(MAKECMDGOALS),ocaml-uninstall)
+else
+OCAML_INSTALL_GOAL = false
+endif
+
+ifeq ($(OCAML_INSTALL_GOAL),true)
+ifneq ($(PIQI_OCAML_PREFIX),)
+OCAMLFIND_DESTDIR = $(PIQI_OCAML_PREFIX)
+export OCAMLFIND_DESTDIR
+endif
+endif
deps:
$(MAKE) -C deps
+ mkdir -p $(OCAMLFIND_DESTDIR)
+ $(MAKE) -C deps install
install:
@@ -36,9 +62,15 @@ erlang:
erlang-clean:
$(MAKE) -C piqi-erlang clean
+ $(MAKE) -C piqi-rpc clean
clean:: erlang-clean
$(MAKE) -C deps clean
$(MAKE) -C tests clean
+
+distclean:
+ $(MAKE) clean
+ rm -rf $(PIQI_BUILD)
+
4 deps/.gitignore
View
@@ -0,0 +1,4 @@
+easy-format-1.0.0/bytecode
+easy-format-1.0.0/easy_format.annot
+easy-format-1.0.0/nativecode
+ulex-1.1/_build/
31 deps/Makefile
View
@@ -1,33 +1,6 @@
+include $(PIQI_ROOT)/make/Makefile.dirs
DIRS = ulex-1.1 easy-format-1.0.0 xmlm-1.0.2
-.PHONY: all build-install clean install uninstall install-dir
-
-
-build-install: $(DIRS) install-dir
- set -e; \
- for i in $(DIRS); do \
- $(MAKE) -C $$i; \
- $(MAKE) -C $$i install; \
- done
-
-
-install: install-dir all
-uninstall: install-dir all
-clean: all
-
-
-all: $(DIRS)
- set -e; \
- for i in $(DIRS); do \
- $(MAKE) -C $$i $(MAKECMDGOALS); \
- done
-
-
-install-dir: $(OCAMLFIND_DESTDIR)
-
-
-$(OCAMLFIND_DESTDIR):
- mkdir -p $@
-
+install: dirs
2  make/Makefile.dirs
View
@@ -1,4 +1,4 @@
-.PHONY: dirs clean post_target
+.PHONY: all dirs clean pre_target post_target
all: dirs pre_target post_target
3  make/Makefile.ocaml
View
@@ -1,3 +1,6 @@
OCAMLMAKEFILE := $(PIQI_ROOT)/make/OCamlMakefile
+OCAMLPATH = $(PIQI_BUILD)/lib/ocaml
+export OCAMLPATH
+
# vim:ft=make
31 setenv.sh
View
@@ -1,26 +1,25 @@
-#
-# don't change the ones below:
-#
-export PIQI_ROOT=`pwd`
+# "prefix" path for installing "piqi" and "piqic" executables
+export PIQI_PREFIX=/usr/local
-# path to piqi and piqic (required for tests)
-export PATH=$PIQI_ROOT/bin:$PATH
-# path to .piqi files (required for tests)
-export PIQI_DIR=$PIQI_ROOT
+# "prefix" path for installing Piqi OCaml libraries; if not set, the OCaml
+# installation's library path (i.e. `ocamlc -where`) will be used
+export PIQI_OCAML_PREFIX=
#
-# these are configurable:
+# don't change the settings below -- they are necessary for the build process
#
-# "prefix" path for installing "piqi" and "piqic" executables
-PIQI_PREFIX=$PIQI_ROOT/build
-export PIQI_PREFIX
+export PIQI_ROOT="`pwd`"
+
+# directory for temporary files required for the build
+export PIQI_BUILD="$PIQI_ROOT/build"
-# installation and search path for OCaml libraries
-OCAMLFIND_DESTDIR=$PIQI_PREFIX/lib/ocaml
-OCAMLPATH=$OCAMLFIND_DESTDIR
-export OCAMLFIND_DESTDIR OCAMLPATH
+# path to piqi and piqic (required for tests)
+export PATH="$PIQI_ROOT/bin:$PATH"
+
+# path to .piqi files (required for tests)
+export PIQI_DIR="$PIQI_ROOT"
Please sign in to comment.
Something went wrong with that request. Please try again.