forked from adobe-flash/crossbridge
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile.nbody
46 lines (31 loc) · 1.06 KB
/
Makefile.nbody
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
mSUFFIXES: .c .o
.c.o:
$(CC) $(CFLAGS) -c $<
all: nbody nbody.phi2mem nbody.reg2mem
CC = gcc
CFLAGS = -m32 -O3 -flto
LDFLAGS =
CPU = i686
OBJS =
nbody.linked.o : nbody.o $(OBJS)
$(LLVMPATH)/llvm-link -o=nbody.linked.o nbody.o $(OBJS)
nbody.lto.o : nbody.linked.o
$(LLVMPATH)/opt -O3 nbody.linked.o -o nbody.lto.o
nbody.s : nbody.lto.o
$(LLVMPATH)/llc -mcpu=$(CPU) -o nbody.s nbody.lto.o
nbody : nbody.s
$(CC) $(CFLAGS) $(LDFLAGS) nbody.s -o nbody
nbody.phi2mem.o : nbody.lto.o
$(LLVMPATH)/opt -phi2mem nbody.lto.o -o nbody.phi2mem.o
nbody.phi2mem.s : nbody.phi2mem.o
$(LLVMPATH)/llc -mcpu=$(CPU) -o nbody.phi2mem.s nbody.phi2mem.o
nbody.phi2mem : nbody.phi2mem.s
$(CC) $(CFLAGS) $(LDFLAGS) nbody.phi2mem.s -o nbody.phi2mem
nbody.reg2mem.o : nbody.lto.o
$(LLVMPATH)/opt -reg2mem nbody.lto.o -o nbody.reg2mem.o
nbody.reg2mem.s : nbody.reg2mem.o
$(LLVMPATH)/llc -mcpu=$(CPU) -o nbody.reg2mem.s nbody.reg2mem.o
nbody.reg2mem : nbody.reg2mem.s
$(CC) $(CFLAGS) $(LDFLAGS) nbody.reg2mem.s -o nbody.reg2mem
clean:
rm *.o *.s nbody nbody.phi2mem nbody.reg2mem