Skip to content

Commit

Permalink
Merge pull request #63 from mransan/fix_build_system_for_opam
Browse files Browse the repository at this point in the history
Fix build system based on first opam attempt
  • Loading branch information
mransan committed Mar 19, 2016
2 parents e0515b8 + c678640 commit 316c05b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ OCB_INC = -I src/compilerlib -I src/compilerlib/ocaml -I src/runtime -I src/oc
OCB_FLAGS = -use-ocamlfind -pkgs compiler-libs.common,ppx_deriving_protobuf.runtime
OCB = ocamlbuild $(OCB_FLAGS) $(OCB_INC)

ifeq "$(shell ocamlc -config | grep os_type)" "os_type: Win32"
@EXE=.exe
else
@EXE=
endif

# Common Directories
#
Expand Down Expand Up @@ -47,12 +52,12 @@ lib.byte:
# ocaml-protoc native executable
bin.native:
$(OCB) ocaml_protoc.native
mv ocaml_protoc.native ocaml-protoc
mv ocaml_protoc.native ocaml-protoc$(EXE)

# ocaml-protoc byte executable
bin.byte:
$(OCB) ocaml_protoc.byte
mv ocaml_protoc.byte ocaml-protoc
mv ocaml_protoc.byte ocaml-protoc$(EXE)

####################
# ---- INSTALL---- #
Expand Down Expand Up @@ -102,14 +107,8 @@ lib.install.native:
lib.uninstall:
ocamlfind remove ocaml-protoc

ifeq "$(shell ocamlc -config | grep os_type)" "os_type: Win32"
@EXE=.exe
else
@EXE=
endif

bin.install: check_install
@mv ocaml-protoc ocaml-protoc$(EXE)
install -m 0755 ocaml-protoc$(EXE) $(BINDIR)

bin.uninstall: check_install
Expand Down
2 changes: 0 additions & 2 deletions opam
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ install: [
[make "bin.install" "PREFIX=%{prefix}%" "BINDIR=%{bin}%"]
]
remove: [make "uninstall" "PREFIX=%{prefix}%" "BINDIR=%{bin}%"]
depends: "ocamlfind"
depends: [
"ocamlfind" {build}
"ocamlbuild" {build}
"ppx_deriving_protobuf"
]

0 comments on commit 316c05b

Please sign in to comment.