-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
56 lines (45 loc) · 910 Bytes
/
Makefile
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
# change this to 1 or 0 depending if you want a pretty plot,
# not sure what you want otherwise
DOPLOT = 1
FPS = 1
POINTS = 0
OPENMP = 0
IMAGE = 0
# standard compile options for the c++ executable
GCC = gcc
EXE = entbody
OBJS = main.c
FLAGS = -O3 -Wall
LIBFLAGS = -lm
ifeq ($(DOPLOT), 1)
OBJS += plot.c
FLAGS += -DPLOT
LIBFLAGS += -lGL -lGLU -lglut
endif
ifeq ($(IMAGE), 1)
FLAGS += -DOPENIL
LIBFLAGS += -lIL -lILU -lILUT
endif
ifeq ($(OPENMP), 1)
FLAGS += -fopenmp
FLAGS += -DOPENMP
endif
ifeq ($(FPS),1)
LIBFLAGS += -lrt
FLAGS += -DFPS
endif
ifeq ($(POINTS), 1)
FLAGS += -DPOINTS
endif
# default super-target
all: $(EXE)
# the standard executable
$(EXE): $(OBJS)
$(GCC) $(FLAGS) $^ -o $@ $(LIBFLAGS)
.PHONY: clean tidy
tidy:
@find | egrep "#" | xargs rm -f
@find | egrep "\~" | xargs rm -f
@find | egrep ".txt" | xargs rm -f
clean: $(EXE)
rm -f $(EXE)