-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (63 loc) · 2.68 KB
/
Makefile
File metadata and controls
86 lines (63 loc) · 2.68 KB
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
82
83
84
85
86
## .../treecode2.1/export/Makefile: compile tree-code.
## Copyright (c) 2026, Joshua E. Barnes, Honolulu, Hawaii.
## _______________________________________________________
BINFILES = treecode$X treecode_mod$X
## Compilation options are selected by changing OPTIONS (and X).
## To compile BINFILES in double precision, with "_dp" suffixes:
## make make_all OPTIONS="-DDOUBLEPREC" X=_dp
## To compile treecode without softening correction:
## make treecode_nc OPTIONS="-DNOSOFTCORR" X=_nc
## _____________________________________________________________
OPTIONS =
## Define compilation and loading options.
## _______________________________________
ZCC = gcc
ZCCFLAGS = -std=gnu17 -DLINUX
ZLDFLAGS =
## Optimization flags.
## ___________________
OPT = -O3
make_all: $(BINFILES)
tidy:
rm -f *.o *.csv
## Build standard treecode; by default, includes softening correction.
## ___________________________________________________________________
treecode$X: treecode$X.o treeio$X.o treebuild$X.o treegrav$X.o
$(ZCC) $(ZLDFLAGS) -o treecode$X treecode$X.o \
treeio$X.o treebuild$X.o treegrav$X.o \
clib/libClib.a -lm
treecode$X.o: treecode.c treedefs.h treecode.h
$(ZCC) $(ZCCFLAGS) $(OPTIONS) -o treecode$X.o -c treecode.c
treeio$X.o: treeio.c treedefs.h
$(ZCC) $(ZCCFLAGS) $(OPTIONS) -o treeio$X.o -c treeio.c
treebuild$X.o: treebuild.c treedefs.h
$(ZCC) $(ZCCFLAGS) $(OPTIONS) $(OPT) -o treebuild$X.o -c treebuild.c
treegrav$X.o: treegrav.c treedefs.h treewalk.c
$(ZCC) $(ZCCFLAGS) $(OPTIONS) $(OPT) -o treegrav$X.o -c treegrav.c
## Build modified treecode.
## ________________________
treecode_mod$X: treecode_mod$X.o treeio_mod$X.o treebuild_mod$X.o \
treegrav_mod$X.o
$(ZCC) $(ZLDFLAGS) -o treecode_mod$X treecode_mod$X.o \
treeio_mod$X.o treebuild_mod$X.o treegrav_mod$X.o \
clib/libClib.a -lm
treecode_mod$X.o: treecode.c treedefs.h treecode.h
$(ZCC) $(ZCCFLAGS) $(OPTIONS) -DMODTREECODE \
-o treecode_mod$X.o -c treecode.c
treeio_mod$X.o: treeio.c treedefs.h
$(ZCC) $(ZCCFLAGS) $(OPTIONS) -DMODTREECODE \
-o treeio_mod$X.o -c treeio.c
treebuild_mod$X.o: treebuild.c treedefs.h
$(ZCC) $(ZCCFLAGS) $(OPTIONS) $(OPT) -DMODTREECODE \
-o treebuild_mod$X.o -c treebuild.c
treegrav_mod$X.o: treegrav_mod.c treedefs.h treewalk.c
$(ZCC) $(ZCCFLAGS) $(OPTIONS) $(OPT) -DMODTREECODE \
-o treegrav_mod$X.o -c treegrav_mod.c
## Generate listing.
## _________________
treecode.pdf: treecode.c treecode.h treeio.c treedefs.h treebuild.c \
treegrav.c treegrav_mod.c treewalk.c Makefile
enscript -r2 -M Letterdj treecode.c treecode.h treeio.c treedefs.h \
treebuild.c treegrav.c treegrav_mod.c treewalk.c Makefile \
-o - | \
ps2pdf - treecode.pdf