X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=sugar.git;a=blobdiff_plain;f=GNUmakefile;h=86d0c9f97c2e12c36f5607da3287b4d0f02cc14d;hp=325e68ea29bbab8d47f1217ab5a03d32fc6749c8;hb=HEAD;hpb=79c402cacf38d6e59d1872c42c569672e3796396 diff --git a/GNUmakefile b/GNUmakefile index 325e68e..86d0c9f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,5 +1,82 @@ +help: + @echo + @echo " .:. Sugar - The Dot-Files Manager .:." + @echo + @echo "Usage:" + @echo " make lint - lint The Sugar System." + @echo " make update - update repository with the current dot files." + @echo " make commit - commit changes to the repository." + @echo " make install - update current dot files with the repository." + @echo " make import FILES=" + @echo " - import dot files into the repository." + @echo " make import-all" + @echo " - import every uncontrolled dot files, which aren't" + @echo " ignored, into the repository." + @echo " make export FILES=" + @echo " - export dot files from the repository." + @echo " make diff FILE=" + @echo " - show diff of the dot file." + @echo + lint: - @perl ./tools/list-files.pl | perl ./tools/find-missing.pl - @perl ./tools/list-files.pl | perl ./tools/find-outdated.pl + perl ./tools/list-files.pl | perl ./tools/find-missing.pl + perl ./tools/list-files.pl | perl ./tools/find-outdated.pl + perl ./tools/list-files.pl | perl ./tools/find-changed.pl + -git status + +update: + git pull + perl ./tools/list-files.pl | perl ./tools/update.pl + perl ./tools/list-files.pl | perl ./tools/find-outdated.pl + -git status + +commit: + git add -A + git commit -m 'Auto commit by The Sugar System.' + git push + git log --stat --unified -1 --color + +install: lint + perl ./tools/list-files.pl | perl ./tools/install.pl + +ifeq ($(FILES),) +import: + @echo "Specify at least one file." + @echo "Usage: make import FILES=" + @exit 1 +else +import: + (for i in $(FILES); do echo $$i; done) | perl ./tools/import.pl + -git status +endif + +import-all: + perl ./tools/list-files.pl | \ + perl ./tools/find-missing.pl | \ + cut -b 3- | \ + perl ./tools/import.pl + -git status + +ifeq ($(FILES),) +export: + @echo "Specify at least one file." + @echo "Usage: $(MAKE) export FILES=" + @exit 1 +else +export: + @echo $(FILES) | \ + tr -s " " "\n" | \ + perl ./tools/export.pl +endif + +ifeq ($(FILE),) +diff: + @echo "Specify one file." + @echo "Usage: make diff FILE=" + @exit 1 +else +diff: + perl ./tools/diff.pl $(FILE) | $(PAGER) +endif -.PHONY: lint \ No newline at end of file +.PHONY: help lint update commit install import export diff