fix: Makefile

Co-authored-by: cichy1173 <cichy1173@protonmail.com>
This commit is contained in:
Wiktor 2025-05-28 22:08:48 +02:00
parent 4c5d889b97
commit 103034719d

View File

@ -2,13 +2,22 @@ CONVERTER = python3 src/converter.py
BLOCKLISTS = seo-nonsense reflink-spam satire mirror BLOCKLISTS = seo-nonsense reflink-spam satire mirror
TARGET_FORMATS = adguard ublacklist TARGET_FORMATS = adguard ublacklist
build: $(foreach blocklist, $(BLOCKLISTS), $(foreach targetformat, $(TARGET_FORMATS), dist/$(blocklist)/$(targetformat).txt)) TARGETS = $(foreach blocklist, $(BLOCKLISTS), $(foreach targetformat, $(TARGET_FORMATS), dist/$(blocklist)/$(targetformat).txt))
dist/%.txt: build: $(TARGETS)
@mkdir -p $(dir $@) && \
$(CONVERTER) --inputfile src/$(firstword $(subst /, ,$*))-source.json --targetformat $(notdir $*) --outputfile $@ dist/%/adguard.txt: src/%-source.json
mkdir -p dist/$*
$(CONVERTER) --inputfile src/$*-source.json --targetformat adguard --outputfile $@
dist/%/ublacklist.txt: src/%-source.json
mkdir -p dist/$*
$(CONVERTER) --inputfile src/$*-source.json --targetformat ublacklist --outputfile $@
clean: clean:
rm -rf dist/* rm -rf dist/*
all: build all: build
.PHONY: build clean all