-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.default
51 lines (33 loc) · 951 Bytes
/
Makefile.default
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
LIBRARY_DIR=$(HOME)/software/itensor
HEADERS=bitstring.h
ifdef app
APP=$(app)
else
APP=learn
endif
CCFILES=$(APP).cc
########
include $(LIBRARY_DIR)/this_dir.mk
include $(LIBRARY_DIR)/options.mk
TENSOR_HEADERS=$(LIBRARY_DIR)/itensor/core.h
CCFLAGS += -Wno-sign-compare
CCGFLAGS += -Wno-sign-compare
#Mappings --------------
OBJECTS=$(patsubst %.cc,%.o, $(CCFILES))
GOBJECTS=$(patsubst %,.debug_objs/%, $(OBJECTS))
#Rules ------------------
%.o: %.cc $(HEADERS) $(TENSOR_HEADERS)
$(CCCOM) -c $(CCFLAGS) -o $@ $<
.debug_objs/%.o: %.cc $(HEADERS) $(TENSOR_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