forked from rmcgibbo/resp2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (53 loc) · 1.87 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#
# Plugin Makefile generated by Psi4.
#
# You shouldn't need to modify anything in this file.
#
# Location of your PSI4 source
top_srcdir = /Users/rmcgibbo/projects/psi4release
# Location of your PSI4 install, by default as listed
top_objdir = /Users/rmcgibbo/projects/psi4release/object
# Start by figuring out whether we're on Linux or Mac (sorry, Mr. Gates)
UNAME := $(shell uname)
include $(top_objdir)/src/bin/MakeVars
# Reset these values, MakeVars changes them to valud only valid in Psi4's objdir
# Location of your PSI4 source
top_srcdir = /Users/rmcgibbo/projects/psi4release
# Location of your PSI4 install, by default as listed
top_objdir = /Users/rmcgibbo/projects/psi4release/object
PSITARGET = $(shell basename `pwd`).so
PSILIBS = -L$(top_objdir)/lib -lPSI_plugin
NLOPTROOT = $(HOME)/opt/nlopt-2.3
NLOPTLIBS = -L$(NLOPTROOT)/lib -lnlopt -lm
NLOPTINCLUDE = -I$(NLOPTROOT)/include
CXXSRC = $(notdir $(wildcard src/*.cc))
CXXSRC = $(wildcard src/*.cc)
DEPENDINCLUDE = $(notdir $(wildcard include/*.h))
DEPENDINCLUDE = $(wildcard include/*.h)
CXXINCLUDE += $(NLOPTINCLUDE)
BINOBJ = $(CXXSRC:%.cc=%.o)
.PHONY: print_vars
default:: $(PSITARGET)
# Add the flags needed for shared library creation
ifeq ($(UNAME), Linux)
LDFLAGS = -shared
endif
ifeq ($(UNAME), Darwin)
LDFLAGS = -shared -undefined dynamic_lookup
CXXOTH += -fno-common
endif
# The object files
src/%.o: src/%.cc
$(CXX) $(CXXFLAGS) $(CXXINCLUDE) $(NLOPTINCLUDE) -c $< $(OUTPUT_OPTION)
$(PSITARGET): $(BINOBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(CXXDBG) $(PSILIBS) $(NLOPTLIBS)
# Erase all compiled intermediate files
clean:
rm -f $(BINOBJ) $(PSITARGET) src/*.d *.pyc *.test output.dat psi.timer.dat
# Dependency handling
%.d: %.cc
$(CXXDEPEND) $(CXXDEPENDFLAGS) $(CXXFLAGS) $(CXXINCLUDE) $(NLOPTINCLUDE) $< > src/$(@F)
ifneq ($(DODEPEND),no)
$(BINOBJ:%.o=%.d): $(DEPENDINCLUDE)
include $(BINOBJ:%.o=%.d)
endif