-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (49 loc) · 1.21 KB
/
Copy pathMakefile
File metadata and controls
56 lines (49 loc) · 1.21 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
# Project configuration
PKG_NAME := web-scraper
MAIN := cmd/scraper/main.go
BIN := scraper
# Default run target
run:
@echo "Running scraper example on Wikipedia..."
go run $(MAIN) \
--tag p \
--depth 0 \
https://en.wikipedia.org/wiki/Web_development
# Run and export as JSON
json:
go run $(MAIN) \
--tag p \
--format json \
--out output \
--depth 0 \
https://en.wikipedia.org/wiki/Web_development
# Run and export as Markdown
md:
go run $(MAIN) \
--tag p \
--format md \
--out output \
--depth 0 \
https://en.wikipedia.org/wiki/Web_development
# Clear the cache directory
clear-cache:
@echo "Clearing cache..."
go run $(MAIN) --clear-cache
# Build binary
build:
go build -o $(BIN) $(MAIN)
@echo "Built binary: ./$(BIN)"
# Remove build files and cache
clean:
rm -f $(BIN)
rm -rf cache
@echo "Cleaned build files and cache."
# Show usage
help:
@echo "Available make commands:"
@echo " run - Run default scraper"
@echo " json - Run scraper and export as JSON"
@echo " md - Run scraper and export as Markdown"
@echo " clear-cache - Remove all cached files"
@echo " build - Compile the binary"
@echo " clean - Remove compiled binary and cache"