-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (41 loc) · 1.44 KB
/
Makefile
File metadata and controls
54 lines (41 loc) · 1.44 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
# If you are using this Makefile standalone and fastjet-config is not
# in your path, edit this line to specify the full path
CXX = g++
CXXFLAGS += -O3 -Wall -std=c++14 -fPIC -DPIC -DNDEBUG -DSWIG
#------------------------------------------------------------------------
# things that are specific to this contrib
NAME = PyFJCore
SRCDIR = pyfjcore
SRCS = fjcore.cc
#------------------------------------------------------------------------
SRCFILES := $(addprefix $(SRCDIR)/, $(SRCS))
OBJS := $(SRCFILES:.cc=.o)
ifeq "$(shell uname)" "Darwin"
dynlibopt = -dynamiclib
dynlibext = dylib
#LDFLAGS += -install_name @rpath/lib$(NAME).dylib
else
dynlibopt = -shared
dynlibext = so
endif
.PHONY: all shared clean
# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#combine
DEPDIR = $(SRCDIR)/.deps
DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.d
COMPILE.cxx = $(CXX) $(DEPFLAGS) $(CXXFLAGS) -c
%.o : %.cc
$(SRCDIR)/%.o : $(SRCDIR)/%.cc $(DEPDIR)/%.d | $(DEPDIR)
$(COMPILE.cxx) $(OUTPUT_OPTION) $<
# compilation of the code (default target)
all: shared
shared: lib$(NAME).$(dynlibext)
lib$(NAME).$(dynlibext): $(OBJS)
$(CXX) $(OBJS) $(dynlibopt) $(CXXFLAGS) $(LDFLAGS) -g0 -o lib$(NAME).$(dynlibext)
# cleaning the directory
clean:
rm -fv $(SRCDIR)/*.o *~ *.o *.a *.so *.dylib
rm -rfv $(SRCDIR)/.deps *.dylib*
$(DEPDIR): ; @mkdir -p $@
DEPFILES := $(SRCS:%.cc=$(DEPDIR)/%.d)
$(DEPFILES):
include $(wildcard $(DEPFILES))