Advanced Computing Platform for Theoretical Physics
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yu-Chen Ding
crmc
Commits
802a08ab
Commit
802a08ab
authored
Jul 11, 2021
by
ralfulrich
Browse files
more robust Makefile
parent
6127b71c
Changes
1
Hide whitespace changes
Inline
Side-by-side
ExampleAnalyser/Makefile
View file @
802a08ab
SYSTEM
=
$(
shell
uname
)
SYSTEM2
=
$(
shell
uname
-m
)
m32
=
$(
shell
if
[
"
$(SYSTEM2)
"
=
"i686"
]
;
then
echo
"-m32"
;
fi
)
SYSTEM
:=
$(
shell
uname
)
SYSTEM2
:=
$(
shell
uname
-m
)
m32
:=
$(
shell
if
[
"
$(SYSTEM2)
"
=
"i686"
]
;
then
echo
"-m32"
;
fi
)
SOURCE_DIR
=
src/
...
...
@@ -19,28 +19,32 @@ ifndef CC
CC
=
gcc
endif
ROOTCFLAGS
=
$(
shell
root-config
--cflags
)
ROOTLIBS
=
$(
shell
root-config
--libs
)
-lEG
ROOTCFLAGS
:
=
$(
shell
root-config
--cflags
)
ROOTLIBS
:
=
$(
shell
root-config
--libs
)
-lEG
HEPCFLAGS
=
$(
shell
HepMC3-config
--cflags
)
HEPLIBS
=
$
(
HepMC3-config
--ldflags
)
BOOSTLIBS
=
-lboost_iostreams
-lboost_system
HEPCFLAGS
:
=
$(
shell
HepMC3-config
--cflags
)
HEPLIBS
:
=
$(
shell
HepMC3-config
--ldflags
)
BOOSTLIBS
:
=
-lboost_iostreams
-lboost_system
CFLAGS
=
$(ROOTCFLAGS)
$(HEPCFLAGS)
LIBS
=
$(ROOTLIBS)
$(HEPLIBS)
$(BOOSTLIBS)
CFLAGS
:
=
$(ROOTCFLAGS)
$(HEPCFLAGS)
LIBS
:
=
$(ROOTLIBS)
$(HEPLIBS)
$(BOOSTLIBS)
CXXFILES
=
analysis.cc
CXXFILES
:=
analysis.cc
OBJS
=
$
(
FILES:%.f
=
$(LIBDIR)
%.o
)
CXXOBJS
=
$
(
CXXFILES:%.cc
=
$(LIBDIR)
%.o
)
OBJS
:=
$
(
FILES:%.f
=
$(LIBDIR)
%.o
)
CXXOBJS
:=
$
(
CXXFILES:%.cc
=
$(LIBDIR)
%.o
)
checkROOT
:=
$(
if
$(
shell
which root-config
)
,
"ROOT available (try 'make analysisROOT'
)
"
,
"root-config not found. Cannot compile with ROOT."
)
checkHepMC3
:=
$(
if
$(
shell
which HepMC3-config
)
,
"HepMC3 available"
,
"HepMC3-config not found. Cannot compile with HepMC3."
)
all
:
dirs bin_dir bin/analysis
.PHONY
:
check
all
:
check dirs bin_dir bin/analysis
.PHONY
:
check analysisROOT
check
:
@
if
[
-z
"
$(HepMC3_ROOT)
"
]
;
then
echo
"Please set HepMC3_ROOT to the root directory of HepMC3"
;
exit
1
;
fi
@
if
[
-z
"
$(ROOTSYS)
"
]
;
then
echo
"Please set ROOTSYS to the root directory of root"
;
exit
1
;
fi
@
(
echo
$(checkROOT)
)
@
(
echo
$(checkHepMC3)
)
bin/analysis
:
$(OBJS) $(CXXOBJS)
$(CXX)
$(CXXFLAGS)
$(OBJS)
$(CXXOBJS)
-o
$@
$(LIBS)
...
...
@@ -49,6 +53,7 @@ bin/analysis: $(OBJS) $(CXXOBJS)
@
(
echo
"==> type bin/analysis"
)
@
(
echo
""
)
analysisROOT
:
bin/analysisROOT
bin/analysisROOT
:
$(LIBDIR)/analysisROOT.o
$(CXX)
$(CXXFLAGS)
-o
$@
$^
$(LIBS)
@
(
echo
""
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment