-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (35 loc) · 942 Bytes
/
Makefile
File metadata and controls
48 lines (35 loc) · 942 Bytes
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
W := build
AW := $(shell realpath $W)
O := $(AW)/../output
SRCDIR := $(PWD)
S0DIR := $(shell realpath $W)/opt
S0BIN := $(S0DIR)/bin
UNAMEARCH :=$(shell uname -m)
CARCH_x86_64 := x86_64
CARCH_aarch64 := aarch64
CARCH_riscv64 := riscv64
CARCH_loongarch64 := loongarch64
CBUILDARCH := $(CARCH_$(UNAMEARCH))
CBUILDHOST := $(CBUILDARCH)-ewe-linux-musl
CARCH := $(CBUILDARCH)
CHOST := $(CBUILDHOST)
include sources.mk
S1CFLAGS := -Os -pipe
S1LDFLAGS :=
S1PREDEFINED := CFLAGS="$(S1CFLAGS)"
S1PREDEFINED := LDFLAGS="$(S1LDFLAGS)"
S1PREDEFINED += CC=clang CXX=clang++
done = touch $@
s1 = env PATH=$(S0BIN):$(PATH) $(S1PREDEFINED)
include stage0/*.mk
$W/stage0: $W/stage0.llvm
$(call done)
include stage1/*.mk
include stage2/*.mk
clean:
-rm -rf $O/*
-find $(AW) -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} ';'
-rm $(AW)/stage*
ifeq ($(shell if test -d $O -a -d $W; then echo okay; fi),)
$(error Please create $O and $W)
endif