Skip to content

Commit

Permalink
Expérimentation M++ (#227)
Browse files Browse the repository at this point in the history
Merge de la mort
  • Loading branch information
david-michel1 authored Mar 8, 2024
2 parents 08ce9cd + 2d10ecd commit 724393a
Show file tree
Hide file tree
Showing 2,784 changed files with 1,472,683 additions and 10,923 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/check_correctness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,3 @@ jobs:
eval $(opam env)
make test_dgfip_c_backend
- name: Test Java backend
run: |
eval $(opam env)
make test_java_backend
3 changes: 0 additions & 3 deletions .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
profile = default
margin = 80
exp-grouping = preserve
wrap-comments
disable
parse-docstrings
version=0.19.0
117 changes: 33 additions & 84 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,102 +1,51 @@
# Check Makefile.config.template if you want to override some of the flags
# in this Makefile.

include Makefile.include

ifeq ($(CODE_COVERAGE), 1)
CODE_COVERAGE_FLAG=--code_coverage
else
CODE_COVERAGE_FLAG=
endif

ifeq ($(TEST_FILTER), 1)
TEST_FILTER_FLAG=--dgfip_test_filter
else
TEST_FILTER_FLAG=
ifndef ROOT_DIR
ROOT_DIR:=$(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST)))))
endif

MLANG_INTERPRETER_OPTS=\
--mpp_file=$(MPP_FILE) \
--mpp_function=$(MPP_FUNCTION)

MLANG=$(MLANG_BIN) $(MLANG_DEFAULT_OPTS) $(MLANG_INTERPRETER_OPTS) $(CODE_COVERAGE_FLAG)

default: build

##################################################
# Initializing the project
##################################################

# Workaround for Opam 2.0 bug. Empty switch creation then installation could be a one line
# "opam switch create . --deps-only" otherwise
create-switch:
opam switch create . --empty

init-without-switch:
opam install . --deps-only
git submodule update --init

init: create-switch init-without-switch
CURR_DIR:=$(realpath $(shell pwd))

deps:
opam switch reinstall --deps-only
git submodule update
YEAR?=2020

##################################################
# Building the compiler
##################################################
include $(ROOT_DIR)/makefiles/functions.mk
include $(ROOT_DIR)/makefiles/variables.mk
include $(ROOT_DIR)/makefiles/mlang.mk
include $(ROOT_DIR)/makefiles/c_backend.mk

format:
dune build @fmt --auto-promote | true
-include $(ROOT_DIR)/mlang-deps/makefiles/svn.mk
-include $(ROOT_DIR)/mlang-deps/makefiles/dgfip_backend.mk

build: format dune
.PHONY: default \
create-switch init-without-switch init deps \
format dune build build-static \
doc \
test tests quick_test test_one \
calc_dir info_c calc_o dgfip_c_backend compile_dgfip_c_backend \
backend_tests test_dgfip_c_backend \
clean_backend clean_backend_c clean_backend_exe clean_backend_tmp clean_backend_res clean_backend_all \
test_java_backend

dune:
dune build $(DUNE_OPTIONS)

# Run only in an opam switch with musl and static options activated
build-static: DUNE_OPTIONS+=--profile=static
build-static: build

##################################################
# Testing the compiler
##################################################

# use: TEST_FILE=bla make test
test: build
$(MLANG) --run_test=$(TEST_FILE) $(SOURCE_FILES)

# use: TESTS_DIR=bla make test
tests: build
$(MLANG) $(MLANGOPTS) --run_all_tests=$(TESTS_DIR) $(TEST_FILTER_FLAG) $(SOURCE_FILES)

test_java_backend: build
ifeq ($(OPTIMIZE), 0)
@echo "\033[0;31mWarning, non-optimized Java files cannot be executed for now (too many constants for the JVM)\033[0m"
else
endif
$(MAKE) -C examples/java/ run_tests

test_dgfip_c_backend: build
$(MAKE) -C examples/dgfip_c/ml_primitif backend_tests
FORCE:

quick_test: build
$(MLANG) --backend interpreter --function_spec $(M_SPEC_FILE) $(SOURCE_FILES)
.DEFAULT_GOAL:=default

all: tests test_java_backend test_dgfip_c_backend quick_test
default: FORCE build

##################################################
# Doc
##################################################
test_java_backend: FORCE build
@echo "\033[0;31mWarning: Java backend not supported\033[0m"
#ifeq ($(OPTIMIZE), 0)
# @echo "\033[0;31mWarning, non-optimized Java files cannot be executed for now (too many constants for the JVM)\033[0m"
#else
#endif
# $(MAKE) -C examples/java/ run_tests

doc: FORCE build
dune build @doc
ln -fs $(shell pwd)/_build/default/_doc/_html/index.html doc/doc.html
all: FORCE quick_test tests test_dgfip_c_backend test_java_backend

clean:
$(MAKE) -C examples/dgfip_c/ml_primitif cleanall
$(MAKE) -C examples/java clean
clean: FORCE
$(call make_in,$(DGFIP_DIR),clean_backend_all)
# $(MAKE) -C examples/java clean
rm -f doc/doc.html
dune clean

FORCE:
68 changes: 0 additions & 68 deletions Makefile.config.template

This file was deleted.

112 changes: 0 additions & 112 deletions Makefile.include

This file was deleted.

Loading

0 comments on commit 724393a

Please sign in to comment.