blob: 8ab83104a3cded679d4b52679b9c33d12f83b8d0 (
plain)
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
|
SOURCES = \
main.esh \
common.esh \
tokens.esh \
backend/main.esh \
backend/codegen.esh \
frontend/main.esh \
frontend/parser.esh \
frontend/lexer.esh
OBJECTS1 = $(SOURCES:.esh=.sh1)
OBJECTS2 = $(SOURCES:.esh=.sh2)
OBJECTS3 = $(SOURCES:.esh=.sh3)
bootstrap: stage3
stage1:
@printf 'Stage 1:\n'
@time -p $(MAKE) eshtrans.stage1 2>&1 | sed 's/^/\t/'
stage2: stage1
@printf 'Stage 2:\n'
@time -p $(MAKE) eshtrans.stage2 2>&1 | sed 's/^/\t/'
stage3: stage2
@printf 'Stage 3:\n'
@time -p $(MAKE) eshtrans.stage3 2>&1 | sed 's/^/\t/'
clean: clean-stage1 clean-stage2 clean-stage3
clean-stage1:
rm -f eshtrans.stage1 $(OBJECTS1)
clean-stage2:
rm -f eshtrans.stage2 $(OBJECTS2)
clean-stage3:
rm -f eshtrans.stage3 $(OBJECTS3)
.SUFFIXES:
.SUFFIXES: .esh .sh .sh1 .sh2 .sh3
eshtrans.stage1: $(OBJECTS1) Makefile
cat $(OBJECTS1) >$@
printf 'main "$${@}"\n' >>$@
chmod a+x $@
eshtrans.stage2: eshtrans.stage1 $(OBJECTS2) ../libeshprof/hooks.esh Makefile
../eshld/eshld -o $@ $(OBJECTS2) ../libeshprof/hooks.esh
eshtrans.stage3: eshtrans.stage2 $(OBJECTS3) ../libeshprof/hooks.esh Makefile
../eshld/eshld -o $@ $(OBJECTS3) ../libeshprof/hooks.esh
$(OBJECTS1) $(OBJECTS2) $(OBJECTS3): Makefile
.esh.sh1:
cp $< $@
.esh.sh2:
./eshtrans.stage1 -o $@ $<
.esh.sh3:
./eshtrans.stage2 -o $@ $<
|