1 | ############################################################################## |
---|
2 | # MAKEFILE: compile and link treecode executable files # |
---|
3 | # Copyright (c) 2001 by Joshua E. Barnes, Honolulu, Hawai`i. # |
---|
4 | ############################################################################## |
---|
5 | |
---|
6 | ######################################################################## |
---|
7 | # DIRECTIONS: to tune this Makefile to your system, edit the definitions |
---|
8 | # of CCFLAGS, LDFLAGS, OPTFLAG, and PREC below. Suggested values |
---|
9 | # are provided for LINUX, Sun, and SGI systems. |
---|
10 | |
---|
11 | ######################################################################## |
---|
12 | # Compiler options. |
---|
13 | |
---|
14 | # LINUX: |
---|
15 | CCFLAGS = -DLINUX |
---|
16 | LDFLAGS = |
---|
17 | OPTFLAG = -O3 |
---|
18 | |
---|
19 | # Sun: |
---|
20 | # CCFLAGS = |
---|
21 | # LDFLAGS = |
---|
22 | # OPTFLAG = -xO3 |
---|
23 | |
---|
24 | # SGI: |
---|
25 | # CCFLAGS = -n32 |
---|
26 | # LDFLAGS = -n32 |
---|
27 | # OPTFLAG = -O3 |
---|
28 | |
---|
29 | ######################################################################## |
---|
30 | # Precision. Possible values are SINGLEPREC, MIXEDPREC, and DOUBLEPREC. |
---|
31 | |
---|
32 | # LINUX, SGI: |
---|
33 | PREC = SINGLEPREC |
---|
34 | |
---|
35 | # Sun: |
---|
36 | # PREC = MIXEDPREC |
---|
37 | |
---|
38 | ######################################################################## |
---|
39 | # Variations: |
---|
40 | |
---|
41 | # Uncomment the next line to use freq instead of dtime: |
---|
42 | # USEFREQ = -DUSEFREQ |
---|
43 | |
---|
44 | # Uncomment the next line to use binary I/O: |
---|
45 | # BINARYIO = -DBINARYIO |
---|
46 | |
---|
47 | ######################################################################## |
---|
48 | # Vanila treecode: |
---|
49 | |
---|
50 | treecode: treecode.o treeio.o treeload.o treegrav.o libZeno.a |
---|
51 | $(CC) $(LDFLAGS) -o treecode \ |
---|
52 | treecode.o treeio.o treeload.o treegrav.o libZeno.a -lm |
---|
53 | |
---|
54 | treecode.o: treecode.c treecode.h treedefs.h |
---|
55 | $(CC) $(CCFLAGS) -D$(PREC) $(USEFREQ) -c treecode.c |
---|
56 | |
---|
57 | treeio.o: treeio.c treecode.h treedefs.h |
---|
58 | $(CC) $(CCFLAGS) -D$(PREC) $(USEFREQ) $(BINARYIO) -c treeio.c |
---|
59 | |
---|
60 | treeload.o: treeload.c treedefs.h |
---|
61 | $(CC) $(CCFLAGS) -D$(PREC) -c treeload.c |
---|
62 | |
---|
63 | treegrav.o: treegrav.c treedefs.h |
---|
64 | $(CC) $(CCFLAGS) -D$(PREC) $(OPTFLAG) -c treegrav.c |
---|
65 | |
---|
66 | ######################################################################## |
---|
67 | # Quick-scan treecode: |
---|
68 | |
---|
69 | treecode_q: treecode_q.o treeio_q.o treeload_q.o treegrav_q.o libZeno.a |
---|
70 | $(CC) $(LDFLAGS) -o treecode_q \ |
---|
71 | treecode_q.o treeio_q.o treeload_q.o treegrav_q.o libZeno.a -lm |
---|
72 | |
---|
73 | treecode_q.o: treecode.c treecode.h treedefs.h |
---|
74 | $(CC) $(CCFLAGS) -D$(PREC) -DQUICKSCAN $(USEFREQ) -c \ |
---|
75 | -o treecode_q.o treecode.c |
---|
76 | |
---|
77 | treeio_q.o: treeio.c treecode.h treedefs.h |
---|
78 | $(CC) $(CCFLAGS) -D$(PREC) -DQUICKSCAN $(USEFREQ) $(BINARYIO) -c \ |
---|
79 | -o treeio_q.o treeio.c |
---|
80 | |
---|
81 | treeload_q.o: treeload.c treedefs.h |
---|
82 | $(CC) $(CCFLAGS) -D$(PREC) -DQUICKSCAN -c \ |
---|
83 | -o treeload_q.o treeload.c |
---|
84 | |
---|
85 | treegrav_q.o: treegrav.c treedefs.h |
---|
86 | $(CC) $(CCFLAGS) -D$(PREC) -DQUICKSCAN $(OPTFLAG) -c \ |
---|
87 | -o treegrav_q.o treegrav.c |
---|
88 | |
---|
89 | ######################################################################## |
---|
90 | # Zeno library: |
---|
91 | |
---|
92 | libZeno.a: clib.o getparam.o mathfns.o |
---|
93 | ar ruv libZeno.a clib.o getparam.o mathfns.o |
---|
94 | |
---|
95 | clib.o: clib.c stdinc.h |
---|
96 | $(CC) $(CCFLAGS) -D$(PREC) -c clib.c |
---|
97 | |
---|
98 | getparam.o: getparam.c stdinc.h getparam.h |
---|
99 | $(CC) $(CCFLAGS) -D$(PREC) -c getparam.c |
---|
100 | |
---|
101 | mathfns.o: mathfns.c stdinc.h mathfns.h |
---|
102 | $(CC) $(CCFLAGS) -D$(PREC) -c mathfns.c |
---|