Makefile raw

   1  MOXIEROOT ?= ..
   2  MOXIE ?= $(MOXIEROOT)/moxie
   3  
   4  .PHONY: all clean test test-hello test-parsemxh test-goenv test-compileopts test-syntax test-typecheck test-mxssa test-loader test-llvm test-glue test-compile
   5  
   6  all: hello.so parsemxh.so goenv_version.so compileopts.so syntax.so typecheck.so mxssa.so loader.so compile.so llvm-glue/libmoxie-llvm-glue.so
   7  
   8  hello.so: hello/hello.mx hello/moxie.mod
   9  	cd $(MOXIEROOT) && MOXIEROOT=. ./moxie build -buildmode=c-shared -o bootstrap/hello.so ./bootstrap/hello/
  10  
  11  parsemxh.so: parsemxh/parsemxh.mx parsemxh/moxie.mod
  12  	cd $(MOXIEROOT) && MOXIEROOT=. ./moxie build -buildmode=c-shared -o bootstrap/parsemxh.so ./bootstrap/parsemxh/
  13  
  14  llvm-glue/libmoxie-llvm-glue.so:
  15  	./llvm-glue/build.sh
  16  
  17  goenv_version.so: goenv_version/version.mx goenv_version/moxie.mod
  18  	cd $(MOXIEROOT) && MOXIEROOT=. ./moxie build -buildmode=c-shared -o bootstrap/goenv_version.so ./bootstrap/goenv_version/
  19  
  20  compileopts.so: compileopts/compileopts.mx compileopts/moxie.mod
  21  	cd $(MOXIEROOT) && MOXIEROOT=. ./moxie build -buildmode=c-shared -o bootstrap/compileopts.so ./bootstrap/compileopts/
  22  
  23  syntax.so: syntax/tokens.mx syntax/pos.mx syntax/source.mx syntax/nodes.mx syntax/scanner.mx syntax/parser.mx syntax/syntax.mx syntax/exports.mx syntax/moxie.mod
  24  	cd $(MOXIEROOT) && MOXIEROOT=. ./moxie build -buildmode=c-shared -o bootstrap/syntax.so ./bootstrap/syntax/
  25  
  26  typecheck.so: typecheck/*.mx typecheck/moxie.mod
  27  	cd $(MOXIEROOT) && MOXIEROOT=. ./moxie build -gc=leaking -buildmode=c-shared -o bootstrap/typecheck.so ./bootstrap/typecheck/
  28  
  29  mxssa.so: mxssa/*.mx mxssa/moxie.mod
  30  	cd $(MOXIEROOT) && MOXIEROOT=. ./moxie build -gc=leaking -buildmode=c-shared -o bootstrap/mxssa.so ./bootstrap/mxssa/
  31  
  32  loader.so: loader/*.mx loader/moxie.mod
  33  	cd $(MOXIEROOT) && MOXIEROOT=. ./moxie build -gc=leaking -buildmode=c-shared -o bootstrap/loader.so ./bootstrap/loader/
  34  
  35  compile.so: compile/*.mx compile/moxie.mod
  36  	cd $(MOXIEROOT) && MOXIEROOT=. ./moxie build -gc=leaking -buildmode=c-shared -o bootstrap/compile.so ./bootstrap/compile/
  37  
  38  test: test-hello test-parsemxh test-goenv test-compileopts test-syntax test-typecheck test-mxssa test-loader test-llvm test-compile
  39  
  40  test-hello: hello.so
  41  	cd probe && go run . $(CURDIR)/hello.so
  42  
  43  test-parsemxh: parsemxh.so
  44  	cd probe_parsemxh && go run . $(CURDIR)/parsemxh.so
  45  
  46  test-goenv: goenv_version.so
  47  	cd probe_goenv && go run . $(CURDIR)/goenv_version.so
  48  
  49  test-compileopts: compileopts.so
  50  	cd probe_compileopts && go run . $(CURDIR)/compileopts.so
  51  
  52  test-syntax: syntax.so
  53  	cd probe_syntax && go run . $(CURDIR)/syntax.so
  54  
  55  test-typecheck: typecheck.so
  56  	cd probe_typecheck && go run . $(CURDIR)/typecheck.so
  57  
  58  test-mxssa: mxssa.so
  59  	cd probe_mxssa && go run . $(CURDIR)/mxssa.so
  60  
  61  test-loader: loader.so
  62  	cd probe_loader && go run . $(CURDIR)/loader.so
  63  
  64  test-llvm: llvm-glue/libmoxie-llvm-glue.so
  65  	cd probe_llvm && go run . $(CURDIR)/llvm-glue/libmoxie-llvm-glue.so
  66  
  67  test-compile: compile.so
  68  	cd probe_compile && go run . $(CURDIR)/compile.so
  69  
  70  clean:
  71  	rm -f hello.so parsemxh.so goenv_version.so compileopts.so syntax.so typecheck.so mxssa.so loader.so compile.so llvm-glue/libmoxie-llvm-glue.so
  72