Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (72 loc) · 2.12 KB
/
Copy pathMakefile
File metadata and controls
89 lines (72 loc) · 2.12 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
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
TOOL_NAME_1 = ticker-scraper
TOOL_NAME_2 = historical-data-scraper
TOOL_NAME_3 = chart-generator
CFLAGS = -std=c99 -s -pedantic -Wall -Wextra -Wfatal-errors -pedantic-errors -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L -O3
CC = cc $(CFLAGS)
all: $(TOOL_NAME_1) $(TOOL_NAME_2) $(TOOL_NAME_3)
.PHONY: all
bin:
@mkdir -p bin
$(TOOL_NAME_1): bin/$(TOOL_NAME_1)
.PHONY: $(TOOL_NAME_1)
$(TOOL_NAME_2): bin/$(TOOL_NAME_2)
.PHONY: $(TOOL_NAME_2)
$(TOOL_NAME_3): bin/$(TOOL_NAME_3)
.PHONY: $(TOOL_NAME_3)
bin/$(TOOL_NAME_1): bin config
$(CC) \
-DPROG="\"$(TOOL_NAME_1)\"" \
-I inc \
-I inc/$(TOOL_NAME_1) \
src/common.c \
src/curl.c \
src/$(TOOL_NAME_1)/$(TOOL_NAME_1).c \
src/$(TOOL_NAME_1)/data-sources/finviz.c \
src/$(TOOL_NAME_1)/data-sources/otcmarkets.c \
-lcsv \
-lcurl \
-ltidy \
-o bin/$(TOOL_NAME_1)
bin/$(TOOL_NAME_2): bin config
$(CC) \
-DPROG="\"$(TOOL_NAME_2)\"" \
-I inc \
-I inc/$(TOOL_NAME_2) \
src/common.c \
src/curl.c \
src/$(TOOL_NAME_2)/$(TOOL_NAME_2).c \
src/$(TOOL_NAME_2)/data-sources/tdameritrade.c \
-lcsv \
-lcurl \
-ljson-c \
-o bin/$(TOOL_NAME_2)
bin/$(TOOL_NAME_3): bin config
$(CC) \
-DPROG="\"$(TOOL_NAME_3)\"" \
-I inc \
-I inc/$(TOOL_NAME_3) \
src/common.c \
src/$(TOOL_NAME_3)/$(TOOL_NAME_3).c \
`pkg-config --cflags --libs cairo` \
-ljson-c \
-o bin/$(TOOL_NAME_3)
clean:
@rm -rf bin
.PHONY: clean
config: inc/config.h
.PHONY: config
data:
@mkdir -p data
inc/config.h:
@cp inc/config.h.def inc/config.h
run-$(TOOL_NAME_1): data
@bin/$(TOOL_NAME_1) NASDAQ OTC > data/tickers.csv
.PHONY: run-$(TOOL_NAME_1)
run-$(TOOL_NAME_2): data
@bin/$(TOOL_NAME_2) -P 5 --include-missing-price -M 0.5B --include-missing-market-cap -o data/historical/ data/tickers.csv
.PHONY: run-$(TOOL_NAME_2)
run-$(TOOL_NAME_3): data
@bin/$(TOOL_NAME_3) -o data/charts/ data/historical/*
.PHONY: run-$(TOOL_NAME_3)
run: run-$(TOOL_NAME_1) run-$(TOOL_NAME_2) run-$(TOOL_NAME_3)
.PHONY: run