Add a Makefile

It compiles setup.ml to a native executable.
This commit is contained in:
Jérémie Dimino 2012-10-17 11:33:37 +02:00
parent cd2f0bd205
commit 6e911b41dc
4 changed files with 66 additions and 2 deletions

59
Makefile Normal file
View File

@ -0,0 +1,59 @@
# Makefile
# --------
# Copyright : (c) 2012, Jeremie Dimino <jeremie@dimino.org>
# Licence : BSD3
#
# Generic Makefile for oasis project
# Set to setup.exe for the release
SETUP := setup-dev.exe
# Default rule
default: build
# Setup for the development version
setup-dev.exe: _oasis setup.ml
sed '/^#/D' setup.ml > setup_dev.ml
ocamlfind ocamlopt -o $@ -linkpkg -package ocamlbuild,oasis.dynrun setup_dev.ml || \
ocamlfind ocamlc -o $@ -linkpkg -package ocamlbuild,oasis.dynrun setup_dev.ml || true
rm -f setup_dev.*
# Setup for the release
setup.exe: setup.ml
ocamlopt.opt -o $@ $< || ocamlopt -o $@ $< || ocamlc -o $@ $<
rm -f setup.cmx setup.cmi setup.o setup.obj setup.cmo
build: $(SETUP) setup.data
./$(SETUP) -build $(BUILDFLAGS)
doc: $(SETUP) setup.data build
./$(SETUP) -doc $(DOCFLAGS)
test: $(SETUP) setup.data build
./$(SETUP) -test $(TESTFLAGS)
all: $(SETUP)
./$(SETUP) -all $(ALLFLAGS)
install: $(SETUP) setup.data
./$(SETUP) -install $(INSTALLFLAGS)
uninstall: $(SETUP) setup.data
./$(SETUP) -uninstall $(UNINSTALLFLAGS)
reinstall: $(SETUP) setup.data
./$(SETUP) -reinstall $(REINSTALLFLAGS)
clean: $(SETUP)
./$(SETUP) -clean $(CLEANFLAGS)
distclean: $(SETUP)
./$(SETUP) -distclean $(DISTCLEANFLAGS)
configure: $(SETUP)
./$(SETUP) -configure $(CONFIGUREFLAGS)
setup.data: $(SETUP)
./$(SETUP) -configure $(CONFIGUREFLAGS)
.PHONY: default build doc test all install uninstall reinstall clean distclean configure

1
_oasis
View File

@ -12,6 +12,7 @@ Authors: Jérémie Dimino
Homepage: http://utop.forge.ocamlcore.org/
BuildTools: ocamlbuild
Plugins: DevFiles (0.3), META (0.3)
XDevFilesEnableMakefile: false
FilesAB: src/lib/uTop_version.ml.ab
Synopsis: Universal toplevel for OCaml
Description:

5
configure vendored Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# OASIS_START
make configure CONFIGUREFLAGS="$*"
# OASIS_STOP

View File

@ -1,14 +1,13 @@
(*
* setup.ml
* --------
* Copyright : (c) 2011, Jeremie Dimino <jeremie@dimino.org>
* Copyright : (c) 2012, Jeremie Dimino <jeremie@dimino.org>
* Licence : BSD3
*
* This file is a part of utop.
*)
(* OASIS_START *)
(* DO NOT EDIT (digest: 7f47a529f70709161149c201ccd90f0b) *)
#use "topfind";;
#require "oasis.dynrun";;
open OASISDynRun;;