-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
86 lines (65 loc) · 1.77 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
cabal_files=rbm.cabal
hs_files=Data/RBM.hs\
Data/MLP.hs\
Data/Matrix.hs\
Data/DNN/Trainer.hs\
Examples/Mnist.hs
tix_files=perf-RBM.tix\
trainbatches.tix\
testbatches.tix\
generatetrainlabels.tix\
mnist.tix\
test-RBM.tix\
#all:mnist
all:build test
build:dist/cabal.build.ok
test:dist/cabal.test.ok
dist/cabal.test.ok:$(hs_files) dist/setup-config tix
cabal test 2>&1
@touch $@
dist/cabal.build.ok:$(hs_files) dist/setup-config tix
cabal build 2>&1
@touch $@
clean:tix
cabal clean
test:tix
cabal test 2>&1
mnist:tix
cabal build mnist
./dist/build/mnist/mnist +RTS -N
mnist_clean:tix
rm -f dist/rbm*
rm -f dist/bp*
mnist_data:data build tix
./dist/build/trainbatches/trainbatches
./dist/build/testbatches/testbatches
./dist/build/generatetrainlabels/generatetrainlabels
rm -f $(tix_files)
mnist_data_clean:
rm dist/test* || echo ok
rm dist/train* || echo ok
rm dist/label* || echo ok
tix:
rm -f $(tix_files)
dist/setup-config:$(cabal_files) Makefile
cabal install --only-dependencies
cabal configure --enable-coverage --enable-tests
@touch $@
DATA=dist/train-images-idx3-ubyte.gz \
dist/train-labels-idx1-ubyte.gz \
dist/t10k-images-idx3-ubyte.gz \
dist/t10k-labels-idx1-ubyte.gz
data:$(DATA)
dist/train-images-idx3-ubyte.gz:
mkdir -p $(@D)
cd dist && wget http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz
dist/train-labels-idx1-ubyte.gz:
mkdir -p $(@D)
cd dist && wget http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
dist/t10k-images-idx3-ubyte.gz:
mkdir -p $(@D)
cd dist && wget http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
dist/t10k-labels-idx1-ubyte.gz:
mkdir -p $(@D)
cd dist && wget http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz
$$%:;@$(call true)$(info $(call or,$$$*))