Makefile 660 Bytes
Newer Older
Radovan Bast's avatar
Radovan Bast committed
1
2
3
SRCDIR := data
TMPDIR := processed_data
RESDIR := results
4

Radovan Bast's avatar
Radovan Bast committed
5
6
7
8
9
SRCS = $(wildcard $(SRCDIR)/*.txt)
OBJS = $(patsubst $(SRCDIR)/%.txt,$(TMPDIR)/%.dat,$(SRCS))
OBJS += $(patsubst $(SRCDIR)/%.txt,$(RESDIR)/%.png,$(SRCS))
OBJS += $(RESDIR)/results.txt
DATA = $(patsubst $(SRCDIR)/%.txt,$(TMPDIR)/%.dat,$(SRCS))
10

Radovan Bast's avatar
Radovan Bast committed
11
all: $(OBJS)
12

Radovan Bast's avatar
Radovan Bast committed
13
14
$(TMPDIR)/%.dat: $(SRCDIR)/%.txt source/wordcount.py
	python source/wordcount.py $< $@
15

Radovan Bast's avatar
Radovan Bast committed
16
17
18
19
20
21
22
23
24
25
26
$(RESDIR)/%.png: $(TMPDIR)/%.dat source/plotcount.py
	python source/plotcount.py $< $@

$(RESDIR)/results.txt: $(DATA) source/zipf_test.py
	python source/zipf_test.py $(DATA) > $@

clean:
	@$(RM) $(TMPDIR)/*
	@$(RM) $(RESDIR)/*

.PHONY: clean directories