aboutsummaryrefslogtreecommitdiff
path: root/common.mk
blob: a210ed96f795290da91b6ac7acdcb432200e3ffe (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
# On AArch64 bare-metal, we need to add --specs=rdimon.specs so that
# link succeeds.

ifneq (,$(findstring aarch64,$(TARGET)))
  ifneq (,$(findstring elf,$(TARGET)))
    EXTRA_CFLAGS=--specs=rdimon.specs
  endif
endif

ifneq (,$(findstring mingw,$(TOOLCHAIN)))
  WINE=wine
endif

export CC=$(WINE) $(TOOLCHAIN)/bin/$(TARGET)-gcc $(EXTRA_CFLAGS)
export CXX=$(WINE) $(TOOLCHAIN)/bin/$(TARGET)-g++ $(EXTRA_CFLAGS)

export HOSTCC=gcc
export HOSTCXX=g++

check::
	-$(MAKE) all
	@cat result.txt

all::
	./build.sh

clean::
	-rm -f result.txt