makefile&co
This commit is contained in:
parent
7b770156bc
commit
131d5c6fe3
5 changed files with 162 additions and 0 deletions
20
Makefile
Normal file
20
Makefile
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
build:
|
||||
@echo "\n==== COMPILING ====\n"
|
||||
ocamlbuild MSftest.native
|
||||
|
||||
format:
|
||||
ocp-indent --inplace src/*
|
||||
|
||||
edit:
|
||||
code . -n
|
||||
|
||||
demo: build
|
||||
@echo "\n==== EXECUTING ====\n"
|
||||
./ftest.native graphs/graph1 1 2 outfile
|
||||
@echo "\n==== RESULT ==== (content of outfile) \n"
|
||||
@cat outfile
|
||||
|
||||
clean:
|
||||
-rm -rf _build/
|
||||
-rm MSftest.native
|
21
README.md
Normal file
21
README.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
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 (command line: `code path/to/ocaml-maxflow-project`).
|
||||
|
||||
Features :
|
||||
- full compilation as VSCode build task (Ctrl+Shift+b)
|
||||
- highlights of compilation errors as you type
|
||||
- code completion
|
||||
- automatic indentation on file save
|
||||
|
||||
|
||||
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`).
|
||||
|
3
_tags
Normal file
3
_tags
Normal file
|
@ -0,0 +1,3 @@
|
|||
<src/**>: include
|
||||
|
||||
|
12
graphs/graph1
Normal file
12
graphs/graph1
Normal file
|
@ -0,0 +1,12 @@
|
|||
%% Test graph #1
|
||||
|
||||
%% Nodes
|
||||
|
||||
u Gaby
|
||||
u Flo
|
||||
u Macha
|
||||
|
||||
|
||||
p Flo -> Gaby,Flo,Macha : 30.0€
|
||||
p Gaby -> Gaby,Flo : 20.0€
|
||||
p Macha -> Gaby,Macha : 20.0€
|
106
graphs/graph1.svg
Normal file
106
graphs/graph1.svg
Normal file
|
@ -0,0 +1,106 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
|
||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
|
||||
<!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink">
|
||||
]>
|
||||
<!-- Generated by dot version 2.7.20060111.0540 (Fri Sep 3 08:16:42 UTC 2010)
|
||||
For user: (lebotlan) D. Le Botlan,,, -->
|
||||
<!-- Title: finite_state_machine Pages: 1 -->
|
||||
<svg width="689px" height="302px"
|
||||
viewBox = "0 0 517 227"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" style="font-family:Times-Roman;font-size:14.00;">
|
||||
<title>finite_state_machine</title>
|
||||
<polygon style="fill:white;stroke:white;" points="0,227 0,-11 528,-11 528,227 0,227"/>
|
||||
<!-- 0 -->
|
||||
<g id="node1" class="node"><title>0</title>
|
||||
<ellipse style="fill:none;stroke:black;" cx="29" cy="112" rx="18" ry="18"/>
|
||||
<text text-anchor="middle" x="29" y="119">0</text>
|
||||
</g>
|
||||
<!-- 2 -->
|
||||
<g id="node3" class="node"><title>2</title>
|
||||
<ellipse style="fill:none;stroke:black;" cx="259" cy="43" rx="18" ry="18"/>
|
||||
<text text-anchor="middle" x="259" y="50">2</text>
|
||||
</g>
|
||||
<!-- 0->2 -->
|
||||
<g id="edge2" class="edge"><title>0->2</title>
|
||||
<path style="fill:none;stroke:black;" d="M51,100C59,95 68,90 77,86 127,64 140,59 192,48 201,47 212,46 221,44"/>
|
||||
<polygon style="fill:black;stroke:black;" points="221,39 235,44 221,48 221,39"/>
|
||||
<text text-anchor="middle" x="144" y="52">8</text>
|
||||
</g>
|
||||
<!-- 3 -->
|
||||
<g id="node5" class="node"><title>3</title>
|
||||
<ellipse style="fill:none;stroke:black;" cx="144" cy="112" rx="18" ry="18"/>
|
||||
<text text-anchor="middle" x="144" y="119">3</text>
|
||||
</g>
|
||||
<!-- 0->3 -->
|
||||
<g id="edge4" class="edge"><title>0->3</title>
|
||||
<path style="fill:none;stroke:black;" d="M53,112C69,112 89,112 107,112"/>
|
||||
<polygon style="fill:black;stroke:black;" points="107,107 120,112 107,116 107,107"/>
|
||||
<text text-anchor="middle" x="87" y="108">10</text>
|
||||
</g>
|
||||
<!-- 1 -->
|
||||
<g id="node7" class="node"><title>1</title>
|
||||
<ellipse style="fill:none;stroke:black;" cx="259" cy="191" rx="18" ry="18"/>
|
||||
<text text-anchor="middle" x="259" y="198">1</text>
|
||||
</g>
|
||||
<!-- 0->1 -->
|
||||
<g id="edge6" class="edge"><title>0->1</title>
|
||||
<path style="fill:none;stroke:black;" d="M48,127C65,142 93,160 120,170 153,182 192,187 221,188"/>
|
||||
<polygon style="fill:black;stroke:black;" points="221,184 235,190 221,192 221,184"/>
|
||||
<text text-anchor="middle" x="144" y="162">7</text>
|
||||
</g>
|
||||
<!-- 4 -->
|
||||
<g id="node9" class="node"><title>4</title>
|
||||
<ellipse style="fill:none;stroke:black;" cx="373" cy="120" rx="18" ry="18"/>
|
||||
<text text-anchor="middle" x="373" y="127">4</text>
|
||||
</g>
|
||||
<!-- 2->4 -->
|
||||
<g id="edge8" class="edge"><title>2->4</title>
|
||||
<path style="fill:none;stroke:black;" d="M279,56C296,68 321,86 343,99"/>
|
||||
<polygon style="fill:black;stroke:black;" points="345,95 353,107 340,103 345,95"/>
|
||||
<text text-anchor="middle" x="316" y="72">12</text>
|
||||
</g>
|
||||
<!-- 3->2 -->
|
||||
<g id="edge12" class="edge"><title>3->2</title>
|
||||
<path style="fill:none;stroke:black;" d="M165,99C183,90 207,75 225,63"/>
|
||||
<polygon style="fill:black;stroke:black;" points="224,59 237,55 229,66 224,59"/>
|
||||
<text text-anchor="middle" x="201" y="71">2</text>
|
||||
</g>
|
||||
<!-- 3->1 -->
|
||||
<g id="edge14" class="edge"><title>3->1</title>
|
||||
<path style="fill:none;stroke:black;" d="M161,128C171,136 181,146 192,152 203,159 215,167 225,172"/>
|
||||
<polygon style="fill:black;stroke:black;" points="228,168 237,179 224,176 228,168"/>
|
||||
<text text-anchor="middle" x="201" y="148">11</text>
|
||||
</g>
|
||||
<!-- 3->4 -->
|
||||
<g id="edge10" class="edge"><title>3->4</title>
|
||||
<path style="fill:none;stroke:black;" d="M168,114C208,115 288,118 336,119"/>
|
||||
<polygon style="fill:black;stroke:black;" points="336,114 349,119 336,123 336,114"/>
|
||||
<text text-anchor="middle" x="259" y="114">5</text>
|
||||
</g>
|
||||
<!-- 1->4 -->
|
||||
<g id="edge16" class="edge"><title>1->4</title>
|
||||
<path style="fill:none;stroke:black;" d="M280,179C293,171 311,162 325,152 331,150 336,146 343,142"/>
|
||||
<polygon style="fill:black;stroke:black;" points="340,138 353,135 344,146 340,138"/>
|
||||
<text text-anchor="middle" x="316" y="148">1</text>
|
||||
</g>
|
||||
<!-- 5 -->
|
||||
<g id="node15" class="node"><title>5</title>
|
||||
<ellipse style="fill:none;stroke:black;" cx="488" cy="168" rx="18" ry="18"/>
|
||||
<text text-anchor="middle" x="488" y="175">5</text>
|
||||
</g>
|
||||
<!-- 1->5 -->
|
||||
<g id="edge18" class="edge"><title>1->5</title>
|
||||
<path style="fill:none;stroke:black;" d="M283,188C311,186 357,182 397,178 415,175 433,174 451,172"/>
|
||||
<polygon style="fill:black;stroke:black;" points="451,168 464,171 451,176 451,168"/>
|
||||
<text text-anchor="middle" x="373" y="174">21</text>
|
||||
</g>
|
||||
<!-- 4->5 -->
|
||||
<g id="edge20" class="edge"><title>4->5</title>
|
||||
<path style="fill:none;stroke:black;" d="M396,130C412,138 435,147 453,154"/>
|
||||
<polygon style="fill:black;stroke:black;" points="455,150 465,159 451,158 455,150"/>
|
||||
<text text-anchor="middle" x="431" y="138">14</text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.8 KiB |
Loading…
Reference in a new issue