This repository was archived by the owner on Jun 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
108 lines (87 loc) · 1.86 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
SRCDIR = source
BINDIR = bin
OBJDIR = bin
MINUS_D =
ifdef CORR
MINUS_D += -DABS_CORR
endif
ifdef TIME_EFFECTS
MINUS_D += -DTIME_EFFECTS
endif
ifndef NONRATABLE
MINUS_D += -DNON_RATABLE
endif
ifdef MOVIELENS
MINUS_D += -DML
endif
ifdef ENT
MINUS_D += -DENT
endif
ifdef ASC
MINUS_D += -DASC
endif
CFLAGS = -Wall -Wextra -pedantic -ansi -Wno-long-long $(MINUS_D)
ifdef DEBUG
CFLAGS += -g -O2
else
CFLAGS += -fopenmp -O3 -g
endif
ifdef P_RESTART
MINUS_D += -DP_RESTART="(dataset->number_users / $(P_RESTART))"
endif
ifdef F_RESTART
MINUS_D += -DF_RESTART="$(F_RESTART)"
endif
ifdef HISTORY
MINUS_D += -DHISTORY="${HISTORY}"
endif
ifdef PARITY
MINUS_D += -DPARITY="$(PARITY)"
endif
LDFLAGS = -lm -fopenmp
CC = g++
PARTS = \
dataset_netflix.o \
dataset_netflix_orig.o \
dataset_movielens.o \
generator_distance.o \
generator_entropy.o \
generator_greedy_cheat.o \
generator_item_avg.o \
generator_naive_bayes.o \
generator_other_greedy.o \
generator_other_greedy_pers.o \
generator_popularity.o \
generator_predictor.o \
generator_random.o \
generator_tree.o \
metric_mae.o \
metric_nmae.o \
metric_nrmse.o \
metric_rmse.o \
param_block.o \
predictor_constant.o \
predictor_global_avg.o \
predictor_item_avg.o \
predictor_item_knn.o \
predictor_korbell.o \
predictor_random.o \
predictor_user_avg.o \
predictor_user_knn.o \
stats.o
PARTS_W_DIR = $(PARTS:%=$(OBJDIR)/%)
all : $(BINDIR)/csp
$(OBJDIR)/%.o : $(SRCDIR)/%.c
@echo $(basename $(notdir $<))
@$(CC) $(CFLAGS) -c $< -o $@
$(BINDIR)/csp : $(PARTS_W_DIR) $(OBJDIR)/csp.o
@echo Building $(notdir $@)
@$(CC) $(LDFLAGS) -o $@ $^
$(PARTS_W_DIR) : makefile makefile.dependencies
.PHONY : clean
clean :
\rm -f $(OBJDIR)/*.o $(BINDIR)/csp
.PHONY : depend
depend :
makedepend -Y -f- -pbin/ -w1024 -- $(CFLAGS) -- $(SRCDIR)/*.c | sed "s/bin\/source/bin/" >| makefile.dependencies
include makefile.dependencies