This Makefile replaces the functionality of run.sh with organized, dependency-aware targets.
# Run everything (equivalent to ./run.sh)
make
# Initialize submodules first (recommended for new setup)
make submodule-init
# Check and update submodules if changes are available
make submodule-update
# Run only geoip workflow
make geoip
# Run only geosite workflow
make geosite
# Show all available targets
make help
# Clean up generated files
make cleanmake all(default) - Runs both geoip and geosite workflowsmake geoip- Complete geoip workflow: submodule-init → download → extract → buildmake geosite- Complete geosite workflow: submodule-init → download → build → parse
make submodule-init- Initialize and update git submodules (geoip and geosite)make submodule-update- Check current commit hashes and update submodules if changes are available
make geoip-download- Download DB-IP country database for current monthmake geoip-extract- Extract and organize the database filemake geoip-build- Build geoip data using configuration
make geosite-download- Download antifilter community domains listmake geosite-build- Build geosite data with specified filtersmake geosite-parse- Process geosite data with antifilter configuration
make clean- Remove all downloaded and generated filesmake help- Display detailed help information
The Makefile automatically uses the current year and month for DB-IP database downloads:
Current: https://download.db-ip.com/free/dbip-country-lite-2025-08.mmdb.gz
Targets have proper dependencies to ensure correct execution order:
submodule-initruns first to ensure repositories are availablegeoip-extractdepends ongeoip-downloadgeoip-builddepends ongeoip-extract- Both
geoipandgeositedepend onsubmodule-init geosite-parsedepends ongeosite-buildand runs automatically
The geosite workflow now includes an additional parsing step that processes the generated geosite.dat file using the geosite-antifilter.json configuration. This creates filtered output files containing only specified domain lists (google, youtube, meta, antifilter-community, private).
- Commands use proper error propagation
- Clean target uses
-prefix to ignore missing files - Each step provides clear status messages
Test what commands will be executed without running them:
make --dry-run geoip
make -n geositeRun geoip and geosite workflows in parallel:
make -j2 geoip geositeSee all commands being executed:
make --debug=v geoip- Missing directories: Ensure
geoip/andgeosite/directories exist - Network issues: Check internet connection for download targets
- Go build errors: Verify Go is installed and projects compile correctly
# Check Makefile syntax
make --dry-run help
# Verify current date variables
make help | grep "Year/Month"
# Test individual targets
make --dry-run geosite-parseThe project includes a custom geosite parser utility located in the geosite-parser/ directory. This utility:
- Processes the generated
geosite.datfile - Uses
geosite-antifilter.jsonconfiguration - Creates filtered output with specific domain lists
- Runs automatically after
make geosite
For detailed information about the parser, see geosite-parser/README.md.