forked from heitorc7/oDMRG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (29 loc) · 1012 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
35
36
37
38
39
40
41
42
43
44
LIBRARY_DIR=$(HOME)/itensor
APP=oDMRG
HEADERS=
CCFILES=$(APP).cc
#################################################################
#################################################################
#################################################################
#################################################################
include $(LIBRARY_DIR)/this_dir.mk
include $(LIBRARY_DIR)/options.mk
#Mappings --------------
OBJECTS=$(patsubst %.cc,%.o, $(CCFILES))
GOBJECTS=$(patsubst %,.debug_objs/%, $(OBJECTS))
#Rules ------------------
%.o: %.cc $(HEADERS)
$(CCCOM) -c $(CCFLAGS) -o $@ $<
.debug_objs/%.o: %.cc $(HEADERS)
$(CCCOM) -c $(CCGFLAGS) -o $@ $<
#Targets -----------------
build: $(APP)
debug: $(APP)-g
$(APP): $(OBJECTS) $(ITENSOR_LIBS)
$(CCCOM) $(CCFLAGS) $(OBJECTS) -o $(APP) $(LIBFLAGS)
$(APP)-g: mkdebugdir $(GOBJECTS) $(ITENSOR_GLIBS)
$(CCCOM) $(CCGFLAGS) $(GOBJECTS) -o $(APP)-g $(LIBGFLAGS)
clean:
rm -fr .debug_objs *.o $(APP) $(APP)-g
mkdebugdir:
mkdir -p .debug_objs