From 5782042b227d4f9b5e42deb8402b8087e6f49c25 Mon Sep 17 00:00:00 2001 From: Arthur Bit-Monnot Date: Mon, 2 Nov 2020 13:41:56 +0100 Subject: [PATCH] improve makefile and readme --- Makefile | 11 ++++++----- README.md | 11 ++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 8a2c0c2..876857b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ build: + @echo "\n==== COMPILING ====\n" ocamlbuild ftest.native format: @@ -9,11 +10,11 @@ edit: code . -n demo: build - echo "\n==== EXECUTING ====\n" + @echo "\n==== EXECUTING ====\n" ./ftest.native graphs/graph1 1 2 outfile - echo "\n==== RESULT ==== (content of outfile) \n" - cat outfile + @echo "\n==== RESULT ==== (content of outfile) \n" + @cat outfile clean: - rm -rf _build/ - rm ftest.native + -rm -rf _build/ + -rm ftest.native diff --git a/README.md b/README.md index 2ccecc4..2ee1f32 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Base project for Ocaml project on Ford-Fulkerson. This project contains some simple configuration files to facilitate editing Ocaml in VSCode. To use, you should install the *OCaml* extension in VSCode. Other extensions might work as well but make sure there is only one installed. -Then open VSCode in the root directory of this repository. +Then open VSCode in the root directory of this repository (command line: `code path/to/ocaml-maxflow-project`). Features : - full compilation as VSCode build task (Ctrl+Shift+b) @@ -10,7 +10,12 @@ Features : - automatic indentation on file save -A makefile also provides basic automation : - - `make` to compile. This creates an ftest.native executable +A makefile provides some useful commands: + - `make build` to compile. This creates an ftest.native executable + - `make demo` to run the `ftest` program with some arguments - `make format` to indent the entire project + - `make edit` to open the project in VSCode + - `make clean` to remove build artifacts + +In case of trouble with the VSCode extension (e.g. the project does not build, there are strange mistakes), a common workaround is to (1) close vscode, (2) `make clean`, (3) `make build` and (4) reopen vscode (`make edit`).