Skip to content

Commit

Permalink
Rename utility.c to runtime.c
Browse files Browse the repository at this point in the history
  • Loading branch information
ushitora-anqou committed Jul 3, 2019
1 parent 8c776f9 commit d52af75
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,37 @@ SRC=hashmap.ml hashtbl.ml helper.ml lexer.ml type.ml parser.ml analyzer.ml gener
aqaml: $(SRC)
ocamlopt $^ -o $@

test: aqaml test.sh utility.o
test: aqaml test.sh runtime.o
./test.sh

utility.o: utility.c
runtime.o: runtime.c
gcc -Wall -std=c11 -O0 -g3 -c -o $@ $^

_self_aqaml: stdlib.ml $(SRC) utility.o aqaml
_self_aqaml: stdlib.ml $(SRC) runtime.o aqaml
./aqaml stdlib.ml $(SRC) > _self_aqaml.s
gcc _self_aqaml.s utility.o -o $@
gcc _self_aqaml.s runtime.o -o $@

_self_test.sh: test.sh
cat test.sh | sed "s#./aqaml#./_self_aqaml#g" > _self_test.sh
chmod +x _self_test.sh

self_test: _self_aqaml _self_test.sh utility.o
self_test: _self_aqaml _self_test.sh runtime.o
./_self_test.sh

_selfself_aqaml: stdlib.ml $(SRC) utility.o _self_aqaml
_selfself_aqaml: stdlib.ml $(SRC) runtime.o _self_aqaml
./_self_aqaml stdlib.ml $(SRC) > _selfself_aqaml.s
gcc _selfself_aqaml.s utility.o -o $@
gcc _selfself_aqaml.s runtime.o -o $@

_selfself_test.sh: test.sh
cat test.sh | sed "s#./aqaml#./_selfself_aqaml#g" > _selfself_test.sh
chmod +x _selfself_test.sh

selfself_test: _selfself_aqaml _selfself_test.sh utility.o
selfself_test: _selfself_aqaml _selfself_test.sh runtime.o
./_selfself_test.sh
cmp _self_aqaml.s _selfself_aqaml.s

clean:
rm -f _self_test.sh _self_aqaml _self_aqaml.s _test.o _test.s aqaml utility.o _selfself_aqaml _selfself_aqaml.s _selfself_test.sh
rm -f _self_test.sh _self_aqaml _self_aqaml.s _test.o _test.s aqaml runtime.o _selfself_aqaml _selfself_aqaml.s _selfself_test.sh
rm -f $(SRC:.ml=.cmi) $(SRC:.ml=.cmx) $(SRC:.ml=.o) $(SRC:.ml=.cmo)

.PHONY: test self_test clean selfself_test
File renamed without changes.
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

./aqaml stdlib.ml test.ml > _test.s
gcc utility.o _test.s -o _test.o
gcc runtime.o _test.s -o _test.o
./_test.o test_command_line_argument1 test_command_line_argument2

0 comments on commit d52af75

Please sign in to comment.