mirror of
https://github.com/correl/melpa.git
synced 2025-01-03 11:07:31 +00:00
Makefile cleanup
This commit is contained in:
parent
5c216821f5
commit
44a63a93b5
1 changed files with 38 additions and 18 deletions
56
Makefile
56
Makefile
|
@ -1,47 +1,67 @@
|
||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
PKGDIR := ./packages
|
PKGDIR := ./packages
|
||||||
|
RCPDIR := ./recipes
|
||||||
HTMLDIR := ./html
|
HTMLDIR := ./html
|
||||||
WORKDIR := ./working
|
WORKDIR := ./working
|
||||||
|
|
||||||
.PHONY: clean build index html json
|
EVAL := emacs --no-site-file --batch -l package-build.el --eval
|
||||||
.FORCE:
|
|
||||||
|
|
||||||
all: build json index
|
all: build json index
|
||||||
|
|
||||||
build:
|
|
||||||
emacs --batch -l package-build.el --eval "(package-build-all)"
|
|
||||||
|
|
||||||
html:
|
## General rules
|
||||||
|
build:
|
||||||
|
@echo " • Building $$(ls -1 $(RCPDIR) | wc -l) recipes ..."
|
||||||
|
$(EVAL) "(package-build-all)"
|
||||||
|
|
||||||
|
html: index
|
||||||
|
index:
|
||||||
|
@echo " • Building html index ..."
|
||||||
$(MAKE) -C $(HTMLDIR)
|
$(MAKE) -C $(HTMLDIR)
|
||||||
|
|
||||||
index: html
|
|
||||||
|
|
||||||
|
## Cleanup rules
|
||||||
clean-working:
|
clean-working:
|
||||||
|
@echo " • Removing package sources ..."
|
||||||
rm -rf $(WORKDIR)/*
|
rm -rf $(WORKDIR)/*
|
||||||
|
|
||||||
clean-packages:
|
clean-packages:
|
||||||
|
@echo " • Removing packages ..."
|
||||||
rm -rfv $(PKGDIR)/*
|
rm -rfv $(PKGDIR)/*
|
||||||
|
|
||||||
clean-json:
|
clean-json:
|
||||||
|
@echo " • Removing json files ..."
|
||||||
-rm -vf archive.json recipes.json
|
-rm -vf archive.json recipes.json
|
||||||
|
|
||||||
clean: clean-working clean-packages clean-json
|
clean: clean-working clean-packages clean-json
|
||||||
|
|
||||||
|
|
||||||
|
## Json rules
|
||||||
archive.json: packages/archive-contents
|
archive.json: packages/archive-contents
|
||||||
emacs --batch --no-site-file -l package-build.el --eval \
|
@echo " • Building $@ ..."
|
||||||
'(package-build-archive-alist-as-json "archive.json")'
|
$(EVAL) '(package-build-archive-alist-as-json "archive.json")'
|
||||||
|
|
||||||
recipes.json: recipes/.dirstamp
|
recipes.json: $(RCPDIR)/.dirstamp
|
||||||
emacs --batch --no-site-file -l package-build.el --eval \
|
@echo " • Building $@ ..."
|
||||||
'(package-build-alist-as-json "recipes.json")'
|
$(EVAL) '(package-build-alist-as-json "recipes.json")'
|
||||||
|
|
||||||
recipes/.dirstamp: .FORCE
|
|
||||||
@[[ ! -e $@ || "$$(find $(@D) -newer $@ -print -quit)" != "" ]] && touch $@ || exit 0
|
|
||||||
|
|
||||||
json: archive.json recipes.json
|
json: archive.json recipes.json
|
||||||
|
|
||||||
recipes/%: .FORCE
|
$(RCPDIR)/.dirstamp: .FORCE
|
||||||
-rm -vf $(PKGDIR)/$(notdir $@)-*
|
@[[ ! -e $@ || "$$(find $(@D) -newer $@ -print -quit)" != "" ]] \
|
||||||
|
&& touch $@ || exit 0
|
||||||
|
|
||||||
|
|
||||||
|
## Recipe rules
|
||||||
|
$(RCPDIR)/%: .FORCE
|
||||||
|
@echo " • Building recipe $(@F) ..."
|
||||||
|
-rm -vf $(PKGDIR)/$(@F)-*
|
||||||
|
$(EVAL) "(package-build-archive '$(@F))"
|
||||||
|
|
||||||
|
@echo " ✓ Wrote $$(ls -lsh $(PKGDIR)/$(@F)-*) "
|
||||||
@echo
|
@echo
|
||||||
emacs --batch --no-site-file -l package-build.el --eval \
|
|
||||||
"(package-build-archive '$(notdir $@))"
|
|
||||||
|
.PHONY: clean build index html json
|
||||||
|
.FORCE:
|
||||||
|
|
Loading…
Reference in a new issue