-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
45 lines (35 loc) · 1.33 KB
/
makefile
File metadata and controls
45 lines (35 loc) · 1.33 KB
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
CC := g++ # This is the main compiler
# CC := clang --analyze # and comment out the linker last line for sanity
# directory of objective files
BUILDDIR := build
# directory of binary files
BINDIR := bin
# directory of source code
SRCDIR := src
# extension of source file
SRCEXT := cc
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
DEPENDENCY := $(shell find $(BUILDDIR) -type f -name *.d 2>/dev/null)
PROB := $(BINDIR)/test
CFLAGS := -g -std=c++0x -MMD -w
LIB := -lgfortran -lpthread -lm -ansi
INC := -I include
all: $(PROB)
$(PROB): build/test.o
@echo " $(CC) $^ -o $(PROB) $(LIB)"; $(CC) $^ -o $(PROB) $(LIB)
@echo " $(PROB) is successfully built."
@printf '%*s' "150" | tr ' ' "-"
@printf '\n'
# Compile code to objective files
###################################
$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
@mkdir -p $(BUILDDIR) $(BINDIR)
@echo " $(CC) $(CFLAGS) $(INC) -c -o $@ $<"; $(CC) $(CFLAGS) $(INC) -c -o $@ $<
run:
./$(PROB) -algo 0 -nthreads 1 -check_step 100000 -style 1 -len_state 80000 -len_action 8 -max_outer_iter 10000000 -max_inner_iter 1 -sample_num_1 1 -sample_num_2 1
##############################################
clean:
@echo " Cleaning...";
@echo " $(RM) -r $(BUILDDIR) $(BINDIR)"; $(RM) -r $(BUILDDIR) $(BINDIR)
-include $(DEPENDENCY)