-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmkfile
More file actions
87 lines (71 loc) · 2.6 KB
/
mkfile
File metadata and controls
87 lines (71 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
TOP=.
<mkconfig
###############################################################################
# Prelude
###############################################################################
# Toplevel mkfile to compile xix using omk/orc (or mk/rc)
###############################################################################
# Vars
###############################################################################
#TODO: should be a builtin env var defined both in mk and omk to be argv0
MK=omk
# STDLIB is defined or not (usually not) in mkconfig
DIRS=\
$STDLIB lib_core/commons lib_core/regexps \
builder shell\
lib_parsing generators/lex generators/yacc\
macroprocessor\
assembler/objects assembler\
linker/executables linker/libraries linker\
compiler\
utilities/files
#TODO: linker/tools (dune only now), utilities/text/, utilities/hello
#TODO: does not work yet with ocaml-light:
# vcs, lib_core/compression lib_core/crypto/
# this does not work anymore with OCaml5 (we need ThreadUnix) and
# while it may compile for Unix, it can only work when run on Plan9
DIRS_PLAN9=\
lib_core/system/plan9 \
lib_graphics/geometry lib_graphics/draw lib_graphics/input lib_graphics/ui \
windows \
kernel/core kernel/concurrency_ kernel/base kernel/concurrency \
kernel/memory kernel/processes kernel/scheduler kernel/time \
applications/clock
#TODO: rename to TESTDIRS, reduce to just tests/ and in tests/ recurse
TESTDIRS1=tests/assembler tests/compiler tests/linker
# works only under plan9 for now
TESTDIRS2=windows/tests lib_system/plan9/tests
###############################################################################
# Main targets
###############################################################################
all:V: all.directories
opt:V: opt.directories
depend:V: depend.directories
# alternate style to the %.directories trick; even simpler
clean nuke:V:
for(i in $DIRS $DIRS_PLAN9 $TESTDIRS) @{
cd $i
$MK $MKFLAGS $target
}
###############################################################################
# Helpers
###############################################################################
%.directories:V:
for(i in $DIRS) @{
echo $i/
cd $i
$MK $MKFLAGS $stem
}
# those targets require to have run 'mk all' first
plan9.%:V:
for(i in $DIRS_PLAN9) @{
echo $i/
cd $i
$MK $MKFLAGS $stem
}
###############################################################################
# Pad's dev infra targets
###############################################################################
# too many dupes for now (e.g., Ast.ml in mutliple dirs)
graph:QV:
codegraph_build -symlinks -lang cmt -verbose .