-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjamfile
81 lines (65 loc) · 1.87 KB
/
jamfile
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
LINK = g++ ;
LLVMDIR = /Users/indy/dev/llvm ;
DEBUGGING_SYMBOLS = YES ;
LLVMLIBS = $(LLVMDIR)/lib/ ;
LINKFLAGS = -g -L$(LLVMLIBS) ;
LINKLIBS = -lLLVMCore -lLLVMCodeGen -lLLVMSystem -lLLVMSupport ;
C++FLAGS = -g ;
HDRS = $(LLVMDIR)/tools/clang/include/ $(LLVMDIR)/tools/clang/lib/CodeGen/ ;
PLOYFLAGS = -entry-func=ploy_main ;
C++ = clang++ ;
LINK = clang++ ;
PLOY = ./bootstrap ;
LLVMLLC = llc ;
SUFLL = .ll ;
AS = as ;
SUFAS = .s ;
LLCFLAGS = -march=x86-64 ;
ASFLAGS = -arch x86_64 ;
rule ploy.compile TARGET : SOURCE
{
Depends $(TARGET) : $(SOURCE) ;
Clean clean : $(TARGET) ;
}
actions ploy.compile
{
$(PLOY) -o=$(1) $(PLOYFLAGS) $(2) ;
}
rule ploy.build TARGET : SOURCE
{
local LLFILE = $(SOURCE:S=$(SUFLL)) ;
local ASFILE = $(SOURCE:S=$(SUFAS)) ;
ploy.compile $(LLFILE) : $(SOURCE) ;
llvm.llc $(ASFILE) : $(LLFILE) ;
as.build $(TARGET) : $(ASFILE) ;
}
rule llvm.llc TARGET : SOURCE
{
Depends $(TARGET) : $(SOURCE) ;
Clean clean : $(TARGET) ;
}
actions llvm.llc
{
$(LLVMLLC) -o=$(1) $(LLCFLAGS) $(2) ;
}
rule as.build TARGET : SOURCE
{
Depends $(TARGET) : $(SOURCE) ;
Clean clean :$(TARGET) ;
}
actions as.build
{
$(AS) $(ASFLAGS) -o $(1) $(2) ;
}
rule UserObject
{
switch $(>)
{
case *.ply : ploy.build $(<) : $(>) ;
case * : ECHO "unknown suffix on" $(>) ;
}
}
# bootstrap is just the sections of the compiler that are written in C/C++ this is used to bootstrap the rest of the compiler that may rely on ploy source.
Main bootstrap : parser.cpp types.cpp driver.cpp symbol.cpp symbols.cpp function.cpp lib.cpp environment.cpp compiler.cpp typeinfo.cpp compile_forms.cpp include.cpp bootstrap_shims.cpp ;
# Now we build the actual compiler.
Main ploy : parser.cpp types.cpp driver.cpp symbol.cpp symbols.cpp function.cpp lib.cpp environment.cpp compiler.cpp typeinfo.cpp compile_forms.cpp include.cpp compile.ply ;