Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Makefile « offsets-tool « tools - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 37909156cee069bd22496d34967a1aac901f55d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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=32
	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

SRC_ROOT = ../..

MONO_OPTIONS_SRC = $(SRC_ROOT)/mcs/class/Mono.Options/Mono.Options/Options.cs

.stamp-clone:
	@if [ ! -d $(CPPSHARP_BASE_DIR) ]; then \
		git clone -b 60f763a9 --depth 1 git://github.com/xamarin/CppSharpBinaries.git $(CPPSHARP_BASE_DIR) && touch $@; \
	fi

MonoAotOffsetsDumper.exe: .stamp-clone MonoAotOffsetsDumper.cs $(MONO_OPTIONS_SRC)
	mcs MonoAotOffsetsDumper.cs /debug /nowarn:0436 $(MONO_OPTIONS_SRC) $(CPPSHARP_REFS)

.PHONY: clean
clean:
	rm MonoAotOffsetsDumper.exe

dump: MonoAotOffsetsDumper.exe 
	MONO_PATH=$(CPPSHARP_DIR) mono MonoAotOffsetsDumper.exe

update:
	@if [ -f object-offsets.h ]; then rm object-offsets.h; fi;
	@for f in *.h; do \
		echo "Processing $$f.."; \
		echo "#include \"$$f\"" >> object-offsets1.h; \
	done
	@cp *.h ../mono/metadata

gen-proj:
	$(CPPSHARP_DIR)/premake5 vs2012

all: MonoAotOffsetsDumper.exe