Giter Club home page Giter Club logo

js-build-tools's Introduction

Jane Street Build Tools (deprecated)

This repository contains a few helpers that are used to build Jane Street packages.

This package is deprecated and no longer maintained. It is recommended to use jbuilder instead

opam2oasis_install

This is a small library that we use to generate opam .install files from the setup.log file generated by oasis.

We don't use oasis for installing files as it is hard to change the destination directory dynamically; you need to fiddle with ocamlfind variables and a few other things. On the contrary opam-installer is very convenient for that.

To use it you need to create a small OCaml script and invoke it after a successful compilation. You can look at any Jane Street package to see an example of use. We always name this script install.ml and use these rules in our makefiles:

SETUP := setup.exe
NAME := core_kernel
PREFIX = $(shell grep ^prefix= setup.data | cut -d\" -f 2)

build: $(SETUP) setup.data
	./$(SETUP) -build $(BUILDFLAGS)
	$(MAKE) $(NAME).install

$(NAME).install: install.ml setup.log setup.data
	ocaml -I "$(OCAML_TOPLEVEL_PATH)" install.ml

install: $(NAME).install
	opam-installer -i --prefix $(PREFIX) $(NAME).install

uninstall: $(NAME).install
	opam-installer -u --prefix $(PREFIX) $(NAME).install

For instance here is the install.ml file for core_kernel:

#use "topfind";;
#require "js-build-tools.oasis2opam_install";;

open Oasis2opam_install;;

generate ~package:"core_kernel"
  [ oasis_lib "core_kernel"
  ; file "META" ~section:"lib"
  ; file "include/core_params.h" ~section:"lib"
  ; file "include/jane_common.h" ~section:"lib"
  ; file "include/ocaml_utils.h" ~section:"lib"
  ; file "include/unix_utils.h" ~section:"lib"
  ; file "src/time_ns_stubs.h" ~section:"lib"
  ; file "_build/namespace_wrappers/result_lib.cmi" ~section:"lib"
  ]

To see what you can use, you can look at the API.

js-build-tools.ocamlbuild_goodies

This is an ocamlbuild plugin containing several hacks and utilities that we often need.

The most interesting bit is track_external_deps, it setup things so that ocamlbuild tracks ocamlfind packages. For instance you are working on two packages a and b simultaneously and b depends on a, whenever you reinstall a you would normally need to do make clean in b. With this plugin you don't need to, ocamlbuild will properly rebuild things in b if needed.

js-build-tools's People

Contributors

jeremiedimino avatar jaapb avatar seliopou avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.