Commit 69f772f7 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Tentative new set of Makefiles. Unfinished.

parent 050b32ce
# A new master Makefile for the components of CFML.
.PHONY: all install
# ------------------------------------------------------------------------------
all:
# Compile the generator.
make -C generator
# Compile the Coq theory.
# make -C src
# ------------------------------------------------------------------------------
ifndef PREFIX
# TEMPORARY
PREFIX := local
endif
PWD := $(shell pwd)
MLI := $(filter-out generator/stdlib/camlinternal% \
%genlex.mli %moreLabels.mli %oo.mli, \
$(wildcard generator/stdlib/*.mli)) \
$(wildcard camllib/*.mli)
MAKECMJ := $(PWD)/generator/makecmj.native
MYOCAMLDEP := $(PWD)/generator/myocamldep.native
install: all
rm -rf $(PREFIX)
mkdir -p $(PREFIX)/bin $(PREFIX)/lib $(PREFIX)/camllib
# Copy the executable.
cp generator/main.native $(PREFIX)/bin/cfml
# Copy the Coq theory.
cp -r src $(PREFIX)/lib
# Copy the OCaml standard library (plus additions) and compile it.
cp -r $(MLI) $(PREFIX)/camllib
cp Makefile.camllib $(PREFIX)/camllib/Makefile
make MAKECMJ=$(MAKECMJ) MYOCAMLDEP=$(MYOCAMLDEP) -C $(PREFIX)/camllib
cd $(PREFIX)/camllib && rm .depend Makefile
# A Makefile which produces .cmj files out of .mli files.
# We assume MAKECMJ is defined externally.
ifndef MAKECMJ
$(error Please define MAKECMJ)
endif
# We assume MYOCAMLDEP is defined externally.
ifndef MYOCAMLDEP
$(error Please define MAKECMJ)
endif
MLI := $(wildcard *.mli)
CMJ := $(patsubst %.mli,%.cmj,$(MLI))
.PHONY: all
all: $(CMJ)
pervasives.cmj: pervasives.mli
$(MAKECMJ) -nostdlib -nopervasives $<
%.cmj: %.mli pervasives.cmj
$(MAKECMJ) -nostdlib $<
-include .depend
.depend: $(MLI)
@$(MYOCAMLDEP) $^ > $@
TLC := ~/tmp/tlc/src
# A tiny generic Makefile for Coq projects.
# The variable INCLUDE should be defined externally.
# We automatically add the current directory to it.
.PHONY: all clean
COQC := coqc
COQDEP := coqdep
V := $(wildcard *.v)
VO := $(patsubst %.v,%.vo,$(V))
VD := $(patsubst %.v,%.v.d,$(V))
all: $(VO)
clean:
rm -f *.vo *.v.d *.glob
ifeq ($(findstring $(MAKECMDGOALS),clean),)
-include $(VD)
endif
%.v.d: %.v
@$(COQDEP) $(INCLUDE) -I . $< > $@
%.vo: %.v
$(COQC) $(INCLUDE) -I . $<
renommer les répertoires de façon plus claire
se débarrasser de makecmj et myocamldep serait agréable
NullPointers et StrongPointers sont spéciaux puisque l'utilisateur
va devoir lier son code OCaml avec eux; ils ne devraient pas être
installés avec la lib standard?
......@@ -5,7 +5,7 @@ OCAMLBUILD := ocamlbuild -j 4 -classic-display \
$(addprefix -I ,$(ML_DIRS)) \
all:
$(OCAMLBUILD) main.native
$(OCAMLBUILD) main.native makecmj.native myocamldep.native
clean:
rm -rf _build
......
include ../Makefile.config
INCLUDE := -I $(TLC)
include ../Makefile.coq
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment