-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
121 lines (108 loc) · 3.64 KB
/
Makefile
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
include etc/Makefile.conf
all: internals $(ARCHS) simulators
internals: config
$(call compile, src/bc2c)
$(call compile, src/h15ppx)
$(call compile, src/circuitppx)
$(call compile, src/byterun)
$(call compile, src/omicrob)
$(call compile, src/stdlib)
simulators: internals $(ARCHS)
$(call compile, src/simulators)
$(call compile, src/simulators/dip)
$(call compile, src/simulators/circuit)
avr: internals
$(call compile, targets/avr)
microbit: internals
$(call compile, targets/microbit)
pic32: internals
$(call compile, targets/pic32)
config:
@if [ $(ETC)/Makefile.conf -ot VERSION -o \
$(ETC)/Makefile.conf -ot configure ]; then \
echo 'Configuration files are not up to date.' 1>&2; \
echo 'Please run `./configure` (with right options).' 1>&2; \
exit 1; \
fi
install: all
mkdir -p "$(LIBDIR)"
mkdir -p "$(LIBEXECDIR)"
mkdir -p "$(INCLUDEDIR)"
mkdir -p "$(BINDIR)"
mkdir -p "$(MAN1DIR)"
mkdir -p "$(MAN3DIR)"
cp bin/bc2c "$(BINDIR)/bc2c"
cp bin/h15ppx "$(BINDIR)/h15ppx"
cp bin/circuitppx "$(BINDIR)/circuitppx"
cp bin/omicrob "$(BINDIR)/omicrob"
cp bin/*_simulator "$(LIBEXECDIR)/"
cp doc/bc2c.1 "$(MAN1DIR)/bc2c.1"
cp doc/omicrob.1 "$(MAN1DIR)/omicrob.1"
cp lib/stdlib.cma "$(LIBDIR)/stdlib.cma"
cp lib/libcamlrun.a "$(LIBDIR)/libcamlrun.a"
cp lib/*.ml "$(LIBDIR)/"
cp lib/*.mli "$(LIBDIR)/"
cp lib/*.cmo "$(LIBDIR)/"
cp lib/*.cmi "$(LIBDIR)/"
cp lib/lcd_cgrom.txt "$(LIBDIR)/"
cp -a lib/targets "$(LIBDIR)/"
cp -a src/byterun/vm "$(INCLUDEDIR)/"
cp -a src/byterun/prims "$(INCLUDEDIR)/"
cp -a src/byterun/simul "$(INCLUDEDIR)/"
cp -a src/byterun/avr "$(INCLUDEDIR)" 2> /dev/null || :
cp -a src/byterun/pic32 "$(INCLUDEDIR)/" 2> /dev/null || :
cp -a src/byterun/microbit "$(INCLUDEDIR)/" 2> /dev/null || :
cp -a src/byterun/stdlib "$(INCLUDEDIR)/"
uninstall:
-rm -f "$(BINDIR)/bc2c"
-rm -f "$(BINDIR)/h15ppx"
-rm -f "$(BINDIR)/omicrob"
-rm -f "$(MAN1DIR)/omicrob.1"
-rm -f "$(MAN1DIR)/bc2c.1"
-rm -f "$(LIBDIR)/stdlib.cma"
-rm -f "$(LIBDIR)/libcamlrun.a"
-rm -f "$(LIBDIR)/"*.ml
-rm -f "$(LIBDIR)/"*.mli
-rm -f "$(LIBDIR)/"*.cmi
-rm -f "$(LIBDIR)/"*.cmo
-rm -f "$(LIBDIR)/lcd_cgrom.txt"
-rm -f "$(LIBEXECDIR)/"*_simulator
-rm -f "$(INCLUDEDIR)/vm/"*
-rm -f "$(INCLUDEDIR)/prims/"*
-rm -f "$(INCLUDEDIR)/simul/"*
-rm -rf "$(INCLUDEDIR)/$(TARGET)/"*
-rm -f "$(INCLUDEDIR)/stdlib/"*
@for mod in $(MAN_3P_BASES); do \
rm -f "$(MAN3DIR)/"$$mod.3p; \
done
@for mod in $(MAN_3O_BASES); do \
rm -f "$(MAN3DIR)/"$$mod.3o; \
done
@if [ -d "$(LIBDIR)" ]; then rmdir "$(LIBDIR)"; fi
@if [ -d "$(LIBEXECDIR)" ]; then rmdir "$(LIBEXECDIR)"; fi
@if [ -d "$(INCLUDEDIR)/vm" ]; then rmdir "$(INCLUDEDIR)/vm"; fi
@if [ -d "$(INCLUDEDIR)/prims" ]; then rmdir "$(INCLUDEDIR)/prims"; fi
@if [ -d "$(INCLUDEDIR)/simul" ]; then rmdir "$(INCLUDEDIR)/simul"; fi
@if [ -d "$(INCLUDEDIR)/$(TARGET)" ]; then rmdir "$(INCLUDEDIR)/$(TARGET)"; fi
@if [ -d "$(INCLUDEDIR)/stdlib" ]; then rmdir "$(INCLUDEDIR)/stdlib"; fi
@if [ -d "$(INCLUDEDIR)" ]; then rmdir "$(INCLUDEDIR)"; fi
etc/Makefile.conf:
@echo "You must run ./configure before" 1>&2
@exit 1
tests: all
@make --no-print-directory -C tests
clean:
@rm -f *~ */*~ */*/*~ */*/*/*~
@rm -f bin/*
$(call clean, src/bc2c)
$(call clean, src/h15ppx)
$(call clean, src/byterun)
$(call clean, src/simulators)
$(call clean, src/simulators/dip)
$(call clean, src/simulators/circuit)
$(call clean, src/omicrob)
$(call clean, src/stdlib)
$(call clean, targets/avr)
$(call clean, targets/pic32)
$(call clean, targets/microbit)
.PHONY: all config install uninstall tests clean