Skip to content

Commit

Permalink
Merge pull request #48 from WebAssembly/split-files
Browse files Browse the repository at this point in the history
Split files into given, spec and host dirs
  • Loading branch information
lukewagner committed Sep 8, 2015
2 parents ce645d2 + 92af51d commit 97aacc3
Show file tree
Hide file tree
Showing 31 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion ml-proto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You'll get an executable named `src/wasm`.
Alternatively, you can also say (in `src`):

```
ocamlbuild -libs "bigarray, nums, str" main.native
ocamlbuild -Is "given, spec, host" -libs "bigarray, nums, str" main.native
```

and get an executable named `src/main.native`.
Expand Down
2 changes: 1 addition & 1 deletion ml-proto/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def find_interpreter(path):
def rebuild_interpreter(path):
print("// building %s" % path)
sys.stdout.flush()
exitCode = subprocess.call(["ocamlbuild", "-libs", "bigarray, nums, str", "main.native"], cwd=os.path.abspath("src"))
exitCode = subprocess.call(["ocamlbuild", "-libs", "bigarray, nums, str", "-Is", "given, spec, host", "host/main.native"], cwd=os.path.abspath("src"))
if (exitCode != 0):
raise Exception("ocamlbuild failed with exit code %i" % exitCode)
if not os.path.exists(path):
Expand Down
31 changes: 17 additions & 14 deletions ml-proto/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
#

NAME = wasm
INCLUDES = -I host -I given -I spec
MODULES = \
flags lib source error \
types values memory ast \
check arithmetic eval print script \
lexer parser \
main
NOMLI = flags types values ast sexpr main
PARSERS = parser
LEXERS = lexer
host/flags given/lib given/source spec/error \
spec/types spec/values spec/memory spec/ast \
spec/check spec/arithmetic spec/eval host/print host/script \
host/lexer host/parser \
host/main
NOMLI = host/flags spec/types spec/values spec/ast host/main
PARSERS = host/parser
LEXERS = host/lexer
LIBRARIES = bigarray nums str
SAMPLES =
TEXTS =
Expand All @@ -38,7 +39,7 @@ $(filter-out $(NOMLI:%=%.cmo), $(CMOS)): %.cmo: %.cmi
$(filter-out $(NOMLI:%=%.cmx), $(CMXS)): %.cmx: %.cmi

Makefile.depend: $(MLS) $(MLIS) Makefile
ocamldep $^ >$@
ocamldep $(INCLUDES) $^ >$@

-include Makefile.depend

Expand All @@ -50,22 +51,24 @@ zip: $(MLS) $(MLIS) $(MLYS) $(MLLS) Makefile $(IMLS) $(TXTS)
rm -r tmp

clean:
rm -f *.cmi *.cmo *.cmx *.o *.output *.depend
rm -f *.native *.byte $(NAME) $(NAME).opt $(NAME).zip
rm -f given/*.cmi given/*.cmo given/*.cmx given/*.o
rm -f spec/*.cmi spec/*.cmo spec/*.cmx spec/*.o
rm -f host/*.cmi host/*.cmo host/*.cmx host/*.o host/*.output
rm -f *.depend *.native *.byte $(NAME) $(NAME).opt $(NAME).zip
rm -rf _build
rm -f *~

distclean: clean
rm -f $(PARSERS:%=%.mli) $(PARSERS:%=%.ml) $(LEXERS:%=%.ml)

%.cmi: %.mli
ocamlc -c $(OCAMLCOPTS) $<
ocamlc -c $(INCLUDES) $(OCAMLCOPTS) $<

%.cmo: %.ml
ocamlc -c $(OCAMLCOPTS) -g $<
ocamlc -c $(INCLUDES) $(OCAMLCOPTS) -g $<

%.cmx: %.ml
ocamlopt -c $(OCAMLCOPTS) $<
ocamlopt -c $(INCLUDES) $(OCAMLCOPTS) $<

%.ml: %.mly
ocamlyacc -v $<
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion ml-proto/travis/build-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export PATH=$PWD/ocaml/install/bin:$PATH

cd src

ocamlbuild -libs "bigarray, nums, str" main.native
ocamlbuild -libs "bigarray, nums, str" -Is "given, spec, host" main.native

cd ..

Expand Down

0 comments on commit 97aacc3

Please sign in to comment.