forked from ulorentz/proGamma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
34 lines (27 loc) · 831 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
OS := $(shell uname)
ifeq ($(OS), Linux)
export MAKEFLAGS="-j $(grep -c ^processor /proc/cpuinfo)" \
else($(OS), Darwin)
export MAKEFLAGS="-j $(sysctl-n hw.ncpu)" \
else
#Windows?
endif
CXXFLAGS := $(CXXFLAGS) -std=c++11 -pthread -O3
obj=progamma.o dataget.o application.o rooting.o manage_flags.o
VPATH=./source/
OBJPATH=./obj/
INCS=`root-config --cflags`
LIBS=`root-config --libs`
all: $(obj)
$(CXX) $(OBJPATH)*.o -o proGamma $(CXXFLAGS) ${INCS} ${LIBS}
ifeq ($(wildcard configure_files*),) #search for "configure_files" folder and create it if it doesn't exist
@mkdir configure_files
endif
%.o: %.cpp
ifeq ($(wildcard $(OBJPATH)*),) #search for obj path, create it if it doesn't exist
@mkdir -p $(OBJPATH)
endif
$(CXX) -c $< -o $(OBJPATH)$@ $(CXXFLAGS) ${INCS}
.PHONY: clean
clean:
rm $(OBJPATH)*.o proGamma