Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / tools / offsets-tool / Makefile
index b4c6b68c22369b55c3ffcb20899241328b3287f5..c974d0364aee48fc1e20e8d8a67c82b445c4403e 100644 (file)
@@ -1,7 +1,34 @@
-CPPSHARP_DIR = CppSharp
+CPPSHARP_BASE_DIR = CppSharp
+
+ifeq ($(OS),Windows_NT)
+       CPPSHARP_OS=windows
+       ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
+               CPPSHARP_ARCH=64
+       else
+               ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
+                       CPPSHARP_ARCH=64
+               endif
+               ifeq ($(PROCESSOR_ARCHITECTURE),x86)
+                       CPPSHARP_ARCH=32
+               endif
+       endif
+else
+       UNAME_S := $(shell uname -s)
+       ifeq ($(UNAME_S),Linux)
+               CPPSHARP_OS=linux
+               CPPSHARP_ARCH=64
+       endif
+       ifeq ($(UNAME_S),Darwin)
+               CPPSHARP_OS=osx
+               CPPSHARP_ARCH=64
+       endif
+endif
+
+CPPSHARP_DIR = $(CPPSHARP_BASE_DIR)/$(CPPSHARP_OS)_$(CPPSHARP_ARCH)
 
 CPPSHARP_REFS = -r:$(CPPSHARP_DIR)/CppSharp.dll \
        -r:$(CPPSHARP_DIR)/CppSharp.AST.dll \
+       -r:$(CPPSHARP_DIR)/CppSharp.Parser.dll \
        -r:$(CPPSHARP_DIR)/CppSharp.Parser.CSharp.dll \
        -r:$(CPPSHARP_DIR)/CppSharp.Generator.dll
 
@@ -9,12 +36,12 @@ SRC_ROOT = ../..
 
 MONO_OPTIONS_SRC = $(SRC_ROOT)/mcs/class/Mono.Options/Mono.Options/Options.cs
 
-.stamp-clone:
-       @if [ ! -d $(CPPSHARP_DIR) ]; then \
-               git clone git://github.com/xamarin/CppSharpBinaries.git $(CPPSHARP_DIR) && touch $@; \
-       fi
+HASH=9dc880dd
+.stamp-clone-$(HASH):
+       rm -Rf $(CPPSHARP_BASE_DIR)
+       git clone -b $(HASH) --depth 1 git://github.com/xamarin/CppSharpBinaries.git $(CPPSHARP_BASE_DIR) && touch $@
 
-MonoAotOffsetsDumper.exe: .stamp-clone MonoAotOffsetsDumper.cs $(MONO_OPTIONS_SRC)
+MonoAotOffsetsDumper.exe: .stamp-clone-$(HASH) MonoAotOffsetsDumper.cs $(MONO_OPTIONS_SRC)
        mcs MonoAotOffsetsDumper.cs /debug /nowarn:0436 $(MONO_OPTIONS_SRC) $(CPPSHARP_REFS)
 
 .PHONY: clean
@@ -35,4 +62,4 @@ update:
 gen-proj:
        $(CPPSHARP_DIR)/premake5 vs2012
 
-all: MonoAotOffsetsDumper.exe
\ No newline at end of file
+all: MonoAotOffsetsDumper.exe