-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·85 lines (71 loc) · 1.94 KB
/
Makefile
File metadata and controls
executable file
·85 lines (71 loc) · 1.94 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
# the target output file
TARGET = Betacool
# where to do the compilation
BUILDDIR = Build/UNIX/
# where the source files are
SRCDIR = src/
# the compiler to use
CXX = g++
# compiler flags:
# -g -O0 adds debugging information to the executable file, without optimisation
# -Wall turns on most, but not all, compiler warnings
# -threads
# -pthread
# -fpermissive maybe not so nice.. but many things still to be improved in the code
# -Wwrite-strings : warning on using strings attached to char*
# -Wunused-value : warning if some defined values are not used...
CXXFLAGS = -Wall -fopenmp -Ofast -fpermissive -Wno-write-strings -Wno-unused-value
# linker options
# Ideally we would like to compile a static binary, but on MacOSX is not so easy
uname_s := $(shell uname -s)
ifeq ($(uname_s), Darwin)
LDFLAGS = -fopenmp
else
LDFLAGS = -static -fopenmp
endif
# if to include something more and/or add libraries for compilation
INC += -I.
LIBS =
# betacool is made of several small objects:
OBJS = Betacool.o \
bolideU.o \
bpData.o \
bpIBS.o \
bpTune.o \
dataU.o \
doubleU.o \
matrixU.o \
pellets.o \
stdafx.o \
vectorU.o \
warning.o \
xBeam.o \
xBucket.o \
xDistributor.o \
xDraw.o \
xDynamic.o \
xEbeam.o \
xEcool.o \
xEffect.o \
xForce.o \
xHiroshi.o \
xIBS.o \
xLibrary.o \
xOptics.o \
xPowell.o \
xRestgas.o \
xRing.o \
xRunge.o \
xStoch.o \
xTarget.o
all: $(TARGET)
$(TARGET) : $(addprefix $(BUILDDIR), $(OBJS))
@echo "Linking $(TARGET)"
$(CXX) $(BUILDDIR)*.o $(LDFLAGS) -o $@
clean:
@echo "Removing directory $(BUILDDIR) and $(TARGET)"
rm -rf $(BUILDDIR) $(TARGET)
$(BUILDDIR)%.o : $(SRCDIR)%.cpp
@echo "Compiling $< into $@"
@mkdir -p $(BUILDDIR)
$(CXX) $(CXXFLAGS) $(INC) -c $< -o $@;