Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
@@ -7,11 +7,37 @@ DIRS = \
7 7 piqicc piqic piqi-tools \
8 8
9 9
10   -.PHONY: deps install ocaml-install ocaml-uninstall erlang erlang-clean
  10 +.PHONY: deps install ocaml-install ocaml-uninstall erlang erlang-clean distclean
  11 +
  12 +
  13 +# export installation and search path for OCaml dependencies
  14 +ifeq ($(MAKECMDGOALS),deps)
  15 +OCAMLFIND_DESTDIR = $(PIQI_BUILD)/lib/ocaml
  16 +OCAMLPATH = $(OCAMLFIND_DESTDIR)
  17 +export OCAMLFIND_DESTDIR OCAMLPATH
  18 +endif
  19 +
  20 +
  21 +# export installation path for Piqi OCaml libraries
  22 +OCAML_INSTALL_GOAL = true
  23 +ifeq ($(MAKECMDGOALS),ocaml-install)
  24 +else ifeq ($(MAKECMDGOALS),ocaml-uninstall)
  25 +else
  26 +OCAML_INSTALL_GOAL = false
  27 +endif
  28 +
  29 +ifeq ($(OCAML_INSTALL_GOAL),true)
  30 +ifneq ($(PIQI_OCAML_PREFIX),)
  31 +OCAMLFIND_DESTDIR = $(PIQI_OCAML_PREFIX)
  32 +export OCAMLFIND_DESTDIR
  33 +endif
  34 +endif
11 35
12 36
13 37 deps:
14 38 $(MAKE) -C deps
  39 + mkdir -p $(OCAMLFIND_DESTDIR)
  40 + $(MAKE) -C deps install
15 41
16 42
17 43 install:
@@ -36,9 +62,15 @@ erlang:
36 62
37 63 erlang-clean:
38 64 $(MAKE) -C piqi-erlang clean
  65 + $(MAKE) -C piqi-rpc clean
39 66
40 67
41 68 clean:: erlang-clean
42 69 $(MAKE) -C deps clean
43 70 $(MAKE) -C tests clean
44 71
  72 +
  73 +distclean:
  74 + $(MAKE) clean
  75 + rm -rf $(PIQI_BUILD)
  76 +
4 deps/.gitignore
... ... @@ -0,0 +1,4 @@
  1 +easy-format-1.0.0/bytecode
  2 +easy-format-1.0.0/easy_format.annot
  3 +easy-format-1.0.0/nativecode
  4 +ulex-1.1/_build/
31 deps/Makefile
... ... @@ -1,33 +1,6 @@
  1 +include $(PIQI_ROOT)/make/Makefile.dirs
1 2
2 3 DIRS = ulex-1.1 easy-format-1.0.0 xmlm-1.0.2
3 4
4 5
5   -.PHONY: all build-install clean install uninstall install-dir
6   -
7   -
8   -build-install: $(DIRS) install-dir
9   - set -e; \
10   - for i in $(DIRS); do \
11   - $(MAKE) -C $$i; \
12   - $(MAKE) -C $$i install; \
13   - done
14   -
15   -
16   -install: install-dir all
17   -uninstall: install-dir all
18   -clean: all
19   -
20   -
21   -all: $(DIRS)
22   - set -e; \
23   - for i in $(DIRS); do \
24   - $(MAKE) -C $$i $(MAKECMDGOALS); \
25   - done
26   -
27   -
28   -install-dir: $(OCAMLFIND_DESTDIR)
29   -
30   -
31   -$(OCAMLFIND_DESTDIR):
32   - mkdir -p $@
33   -
  6 +install: dirs
2  make/Makefile.dirs
... ... @@ -1,4 +1,4 @@
1   -.PHONY: dirs clean post_target
  1 +.PHONY: all dirs clean pre_target post_target
2 2
3 3 all: dirs pre_target post_target
4 4
3  make/Makefile.ocaml
... ... @@ -1,3 +1,6 @@
1 1 OCAMLMAKEFILE := $(PIQI_ROOT)/make/OCamlMakefile
2 2
  3 +OCAMLPATH = $(PIQI_BUILD)/lib/ocaml
  4 +export OCAMLPATH
  5 +
3 6 # vim:ft=make
31 setenv.sh
... ... @@ -1,26 +1,25 @@
1   -#
2   -# don't change the ones below:
3   -#
4 1
5   -export PIQI_ROOT=`pwd`
  2 +# "prefix" path for installing "piqi" and "piqic" executables
  3 +export PIQI_PREFIX=/usr/local
6 4
7   -# path to piqi and piqic (required for tests)
8   -export PATH=$PIQI_ROOT/bin:$PATH
9 5
10   -# path to .piqi files (required for tests)
11   -export PIQI_DIR=$PIQI_ROOT
  6 +# "prefix" path for installing Piqi OCaml libraries; if not set, the OCaml
  7 +# installation's library path (i.e. `ocamlc -where`) will be used
  8 +export PIQI_OCAML_PREFIX=
12 9
13 10
14 11 #
15   -# these are configurable:
  12 +# don't change the settings below -- they are necessary for the build process
16 13 #
17 14
18   -# "prefix" path for installing "piqi" and "piqic" executables
19   -PIQI_PREFIX=$PIQI_ROOT/build
20   -export PIQI_PREFIX
  15 +export PIQI_ROOT="`pwd`"
  16 +
  17 +# directory for temporary files required for the build
  18 +export PIQI_BUILD="$PIQI_ROOT/build"
21 19
22   -# installation and search path for OCaml libraries
23   -OCAMLFIND_DESTDIR=$PIQI_PREFIX/lib/ocaml
24   -OCAMLPATH=$OCAMLFIND_DESTDIR
25   -export OCAMLFIND_DESTDIR OCAMLPATH
  20 +# path to piqi and piqic (required for tests)
  21 +export PATH="$PIQI_ROOT/bin:$PATH"
  22 +
  23 +# path to .piqi files (required for tests)
  24 +export PIQI_DIR="$PIQI_ROOT"
26 25

0 comments on commit ef20fc6

Please sign in to comment.
Something went wrong with that request. Please try again.