abf2ff924a57eacbc774e636671bebe913833f6b
[mono.git] / tools / offsets-tool / Makefile
1 CPPSHARP_DIR = CppSharp
2
3 CPPSHARP_REFS = -r:$(CPPSHARP_DIR)/CppSharp.dll \
4         -r:$(CPPSHARP_DIR)/CppSharp.AST.dll \
5         -r:$(CPPSHARP_DIR)/CppSharp.Parser.CSharp.dll \
6         -r:$(CPPSHARP_DIR)/CppSharp.Generator.dll
7
8 SRC_ROOT = ../..
9
10 MONO_OPTIONS_SRC = $(SRC_ROOT)/mono/mcs/class/Mono.Options/Mono.Options/Options.cs
11
12 .stamp-clone:
13         @if [ ! -d $(CPPSHARP_DIR) ]; then \
14                 git clone git@github.com:xamarin/CppSharpBinaries.git $(CPPSHARP_DIR); \
15                 touch $@; \
16         fi
17
18 MonoAotOffsetsDumper.exe: .stamp-clone MonoAotOffsetsDumper.cs $(MONO_OPTIONS_SRC)
19         mcs MonoAotOffsetsDumper.cs /debug /nowarn:0436 $(MONO_OPTIONS_SRC) $(CPPSHARP_REFS)
20
21 .PHONY: clean
22 clean:
23         rm MonoAotOffsetsDumper.exe
24
25 dump: MonoAotOffsetsDumper.exe 
26         MONO_PATH=$(CPPSHARP_DIR) mono MonoAotOffsetsDumper.exe
27
28 update:
29         @if [ -f object-offsets.h ]; then rm object-offsets.h; fi;
30         @for f in *.h; do \
31                 echo "Processing $$f.."; \
32                 echo "#include \"$$f\"" >> object-offsets1.h; \
33         done
34         @cp *.h ../mono/metadata
35
36 gen-proj:
37         $(CPPSHARP_DIR)/premake5 vs2012
38
39 all: MonoAotOffsetsDumper.exe