-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (31 loc) · 819 Bytes
/
Makefile
File metadata and controls
41 lines (31 loc) · 819 Bytes
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
# Set the compiler
CXX = g++
# Define the project directories and files
SRC1 = generate_taus_from_beamdump.cpp
OBJ1 = $(SRC1:.cpp=.o)
EXE1 = ntaus
SRC2 = generate_proton_events.cpp
OBJ2 = $(SRC2:.cpp=.o)
EXE2 = nprotons
# Pythia8 directories
PYTHIA8 = $(HOME)/Development/MG5_aMC_v3_5_6/HEPTools/pythia8
INCDIR = $(PYTHIA8)/include
LIBDIR = $(PYTHIA8)/lib
# Compilation flags
CXXFLAGS = -I$(INCDIR) -std=c++11
LDFLAGS = -L$(LIBDIR) -lpythia8 -Wl,-rpath,$(PYTHIA8)/lib
# Build target
all: $(EXE1) $(EXE2)
# Rule to build the executable
$(EXE1): $(OBJ1)
$(CXX) -o $@ $^ $(LDFLAGS)
# Rule to build the executable
$(EXE2): $(OBJ2)
$(CXX) -o $@ $^ $(LDFLAGS)
# Rule to build the object file
%.o: %.cpp
$(CXX) -c $< $(CXXFLAGS)
# Clean rule to remove build artifacts
clean:
rm -f $(OBJ) $(EXE)
.PHONY: all clean