Using makefiles to manage config

I last used makefiles a long time ago, so this took some refreshing…

Recently I’ve been looking at using qtile, a python based window manager. I’ve also been thinking about managing my config files using git and makefiles to “publish”. Here’s an example makefile for config.py:


SRCFILE = config.py
DSTDIR = ~/.config/qtile/

.PHONY: all
all: $(DSTDIR)/$(SRCFILE)

$(DSTDIR)/%.py: $(SRCFILE)
@cp -fp -- $(SRCFILE) $(DSTDIR)/$(SRCFILE)

Leave a Reply

Your email address will not be published. Required fields are marked *