forked from rapid7/mettle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.tools
42 lines (36 loc) · 1.28 KB
/
Makefile.tools
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
ELLCC_HOST=linux
ifneq "$(TARGET)" "native"
CC=$(ROOT)/build/tools/$(ELLCC_HOST)/ellcc/bin/ecc
AR=$(ROOT)/build/tools/$(ELLCC_HOST)/ellcc/bin/ecc-ar
RANLIB=$(ROOT)/build/tools/$(ELLCC_HOST)/ellcc/bin/ecc-ranlib
else
CC=cc
AR=ar
RANLIB=ranlib
endif
TAR=tar
INSTALL=install
export PATH:=$(ROOT)/build/tools/$(ELLCC_HOST)/ellcc/bin:$(PATH)
ifeq "$(shell uname -s)" "Darwin"
ELLCC_HOST=osx
ifeq ("$(wildcard /usr/local/opt/coreutils/libexec/gnubin/install)", "")
$(info "Gnu install is not found, try 'brew install coreutils")
else
export PATH:=/usr/local/opt/coreutils/libexec/gnubin:$(PATH)
endif
endif
$(TOOLCHAIN)/libecc.xz:
git submodule init
git submodule update
build/tools/$(ELLCC_HOST)/ellcc: $(TOOLCHAIN)/libecc.xz
@echo "Unpacking ellcc"
@rm -fr build/tools/$(ELLCC_HOST)
@mkdir -p build/tools/$(ELLCC_HOST)
@cd build/tools/$(ELLCC_HOST) && tar xf $(TOOLCHAIN)/ellcc-$(ELLCC_HOST).xz
@cd build/tools/$(ELLCC_HOST)/ellcc && tar xf $(TOOLCHAIN)/libecc.xz
@cd build/tools/$(ELLCC_HOST)/ellcc/libecc && tar xf $(TOOLCHAIN)/libecc-mingw.xz && mv libecc-mingw mingw
@touch build/tools/$(ELLCC_HOST)/ellcc
ifneq "$(TARGET)" "native"
TOOLS_DEPS=$(BUILD)/include/linux
endif
build/tools: $(TOOLS_DEPS) build/tools/$(ELLCC_HOST)/ellcc/bin/ecc