2012-07-19 13:37:06 +00:00
|
|
|
SHELL := /bin/bash
|
|
|
|
PKGDIR := ./packages
|
2012-07-21 21:58:46 +00:00
|
|
|
RCPDIR := ./recipes
|
2012-07-19 13:37:06 +00:00
|
|
|
HTMLDIR := ./html
|
|
|
|
WORKDIR := ./working
|
2012-07-24 20:28:41 +00:00
|
|
|
EMACS := emacs
|
2012-07-19 13:37:06 +00:00
|
|
|
|
2012-07-24 20:28:41 +00:00
|
|
|
EVAL := $(EMACS) --no-site-file --batch -l package-build.el --eval
|
2012-07-21 21:58:46 +00:00
|
|
|
|
2012-07-19 13:37:06 +00:00
|
|
|
|
2012-07-20 20:40:33 +00:00
|
|
|
all: build json index
|
2012-07-19 13:37:06 +00:00
|
|
|
|
2012-07-21 21:58:46 +00:00
|
|
|
|
|
|
|
## General rules
|
2012-07-19 13:37:06 +00:00
|
|
|
build:
|
2012-07-21 21:58:46 +00:00
|
|
|
@echo " • Building $$(ls -1 $(RCPDIR) | wc -l) recipes ..."
|
|
|
|
$(EVAL) "(package-build-all)"
|
2012-07-19 13:37:06 +00:00
|
|
|
|
2012-07-21 21:58:46 +00:00
|
|
|
html: index
|
2012-07-25 13:01:04 +00:00
|
|
|
index: archive.json
|
2012-07-21 21:58:46 +00:00
|
|
|
@echo " • Building html index ..."
|
2012-07-19 13:37:06 +00:00
|
|
|
$(MAKE) -C $(HTMLDIR)
|
|
|
|
|
|
|
|
|
2012-07-21 21:58:46 +00:00
|
|
|
## Cleanup rules
|
2012-07-19 13:37:06 +00:00
|
|
|
clean-working:
|
2012-07-21 21:58:46 +00:00
|
|
|
@echo " • Removing package sources ..."
|
2012-07-19 13:37:06 +00:00
|
|
|
rm -rf $(WORKDIR)/*
|
|
|
|
|
|
|
|
clean-packages:
|
2012-07-21 21:58:46 +00:00
|
|
|
@echo " • Removing packages ..."
|
2012-07-19 13:37:06 +00:00
|
|
|
rm -rfv $(PKGDIR)/*
|
|
|
|
|
2012-07-20 20:40:33 +00:00
|
|
|
clean-json:
|
2012-07-21 21:58:46 +00:00
|
|
|
@echo " • Removing json files ..."
|
2012-07-20 20:40:33 +00:00
|
|
|
-rm -vf archive.json recipes.json
|
|
|
|
|
|
|
|
clean: clean-working clean-packages clean-json
|
|
|
|
|
|
|
|
|
2012-07-21 21:58:46 +00:00
|
|
|
## Json rules
|
|
|
|
archive.json: packages/archive-contents
|
|
|
|
@echo " • Building $@ ..."
|
|
|
|
$(EVAL) '(package-build-archive-alist-as-json "archive.json")'
|
2012-07-20 20:40:33 +00:00
|
|
|
|
2012-07-21 21:58:46 +00:00
|
|
|
recipes.json: $(RCPDIR)/.dirstamp
|
|
|
|
@echo " • Building $@ ..."
|
|
|
|
$(EVAL) '(package-build-alist-as-json "recipes.json")'
|
2012-07-20 20:40:33 +00:00
|
|
|
|
|
|
|
json: archive.json recipes.json
|
2012-07-19 13:37:06 +00:00
|
|
|
|
2012-07-21 21:58:46 +00:00
|
|
|
$(RCPDIR)/.dirstamp: .FORCE
|
|
|
|
@[[ ! -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)-*) "
|
2012-07-19 13:37:06 +00:00
|
|
|
@echo
|
2012-07-21 21:58:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: clean build index html json
|
|
|
|
.FORCE:
|