logo/Makefile

60 lines
1.4 KiB
Makefile
Raw Normal View History

SRC := $(shell find logo/ -type f)
CONDA := source $$(conda info --base)/etc/profile.d/conda.sh; conda activate;
SVGS := $(shell find -type f -wholename "./docs/*.svg")
PNGS := $(patsubst ./docs/svg/%.svg,./docs/png/%.png, $(SVGS))
2022-08-12 17:03:00 -05:00
REV := $(shell date +'%Y.%m.%d-' )$(shell git describe --always --dirty | sed s'/dirty/dev/')
.PHONY: all
all:
@echo "==> Generating SVGs <=="
@mkdir -p docs/svg
2022-08-12 17:03:00 -05:00
@$(MAKE) svgs
@echo "==> Generating PNGs <=="
@mkdir -p docs/png
@$(MAKE) docs/png/index.html
2022-08-12 17:03:00 -05:00
@$(MAKE) pngs
.PHONY: pngs
2023-02-06 11:42:12 -06:00
pngs: $(PNGS) ## generate all of the logo pngs
2022-08-12 17:03:00 -05:00
docs/png/index.html: docs/index.html
@cat docs/index.html |\
sed 's/svg/png/g' |\
sed 's/\.\/png/\./g' |\
sed s'/My Logos/My Logos but PNG/g' \
> docs/png/index.html
docs/png/%.png: docs/svg/%.svg
@inkscape --export-filename=$@ $<
2022-08-12 17:03:00 -05:00
.PHONY: logos
2023-02-06 11:42:12 -06:00
svgs: $(SRC) ## generate all of the logo svgs
2022-08-12 17:03:00 -05:00
./generate-all.py $(REV)
.PHONY: lint
2023-02-06 11:42:12 -06:00
lint: ## apply isort/black/flake8
2022-08-12 17:03:00 -05:00
@isort logo
@black logo
@flake8 logo
.PHONY: bootstrap pdm-env conda-env
2023-02-06 11:42:12 -06:00
bootstrap: pdm-env ## bootstrap the conda environment
2022-08-12 17:03:00 -05:00
conda-env:
$(CONDA) CONDA_ALWAYS_YES="true" mamba create -p ./env python --force
pdm-env: conda-env
$(CONDA) conda activate ./env; \
pip install pdm; \
pdm install
.PHONY: clean
2023-02-06 11:42:12 -06:00
clean: ## remove old files
2022-08-12 17:03:00 -05:00
rm -f *.svg *.png
2022-08-12 18:06:53 -05:00
rm -f docs/*.svg
2022-08-12 17:03:00 -05:00
rm -f docs/svg/*
rm -f docs/png/*
2023-02-06 11:42:12 -06:00
-include .task.cfg.mk