1 | # If you are using this Makefile standalone and fastjet-config is not
|
---|
2 | # in your path, edit this line to specify the full path
|
---|
3 | FASTJETCONFIG=fastjet-config
|
---|
4 | PREFIX=`$(FASTJETCONFIG) --prefix`
|
---|
5 | CXX=g++
|
---|
6 | CXXFLAGS= -O3 -Wall -g
|
---|
7 | install_script = $(SHELL) ../utils/install-sh
|
---|
8 | check_script = ../utils/check.sh
|
---|
9 |
|
---|
10 | # global contrib-wide Makefile include may override some of the above
|
---|
11 | # variables (leading "-" means don't give an error if you can't find
|
---|
12 | # the file)
|
---|
13 | -include ../.Makefile.inc
|
---|
14 |
|
---|
15 | #------------------------------------------------------------------------
|
---|
16 | # things that are specific to this contrib
|
---|
17 | NAME=ValenciaPlugin
|
---|
18 | SRCS=ValenciaPlugin.cc
|
---|
19 | EXAMPLES=example
|
---|
20 | INSTALLED_HEADERS=ValenciaPlugin.hh
|
---|
21 | #------------------------------------------------------------------------
|
---|
22 |
|
---|
23 | CXXFLAGS+= $(shell $(FASTJETCONFIG) --cxxflags)
|
---|
24 | LDFLAGS += -lm $(shell $(FASTJETCONFIG) --libs)
|
---|
25 |
|
---|
26 | OBJS = $(SRCS:.cc=.o)
|
---|
27 | EXAMPLES_SRCS = $(EXAMPLES:=.cc)
|
---|
28 |
|
---|
29 | install_HEADER = $(install_script) -c -m 644
|
---|
30 | install_LIB = $(install_script) -c -m 644
|
---|
31 | install_DIR = $(install_script) -d
|
---|
32 | install_DATA = $(install_script) -c -m 644
|
---|
33 | install_PROGRAM = $(install_script) -c -s
|
---|
34 | install_SCRIPT = $(install_script) -c
|
---|
35 |
|
---|
36 | .PHONY: clean distclean examples check install
|
---|
37 |
|
---|
38 | # compilation of the code (default target)
|
---|
39 | all: lib$(NAME).a
|
---|
40 |
|
---|
41 | lib$(NAME).a: $(OBJS)
|
---|
42 | ar cru lib$(NAME).a $(OBJS)
|
---|
43 | ranlib lib$(NAME).a
|
---|
44 |
|
---|
45 | # building the examples
|
---|
46 | examples: $(EXAMPLES)
|
---|
47 |
|
---|
48 | # the following construct makes it possible to automatically build
|
---|
49 | # each of the examples listed in $EXAMPLES
|
---|
50 | $(EXAMPLES): % : %.o all
|
---|
51 | $(CXX) -o $@ $< -L. -l$(NAME) $(LDFLAGS)
|
---|
52 |
|
---|
53 | # check that everything went fine
|
---|
54 | check: examples
|
---|
55 | @for prog in $(EXAMPLES); do\
|
---|
56 | $(check_script) $${prog} ../data/single-event.dat || exit 1; \
|
---|
57 | done
|
---|
58 | @echo "All tests successful"
|
---|
59 |
|
---|
60 | # cleaning the directory
|
---|
61 | clean:
|
---|
62 | rm -f *~ *.o
|
---|
63 |
|
---|
64 | distclean: clean
|
---|
65 | rm -f lib$(NAME).a $(EXAMPLES)
|
---|
66 |
|
---|
67 | # install things in PREFIX/...
|
---|
68 | install: all
|
---|
69 | $(install_DIR) $(PREFIX)/include/fastjet/contrib
|
---|
70 | for header in $(INSTALLED_HEADERS); do\
|
---|
71 | $(install_HEADER) $$header $(PREFIX)/include/fastjet/contrib/;\
|
---|
72 | done
|
---|
73 | $(install_DIR) $(PREFIX)/lib
|
---|
74 | $(install_LIB) lib$(NAME).a $(PREFIX)/lib
|
---|
75 |
|
---|
76 | depend:
|
---|
77 | makedepend -Y -- -- $(SRCS) $(EXAMPLES_SRCS)
|
---|