Skip to content
This repository
tree: c03acebf14
Fetching contributors…

Cannot retrieve contributors at this time

file 68 lines (47 sloc) 1.407 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
SHELL := /bin/bash
PKGDIR := ./packages
RCPDIR := ./recipes
HTMLDIR := ./html
WORKDIR := ./working
EMACS := emacs

EVAL := $(EMACS) --no-site-file --batch -l package-build.el --eval


all: build json index


## General rules
build:
@echo " • Building $$(ls -1 $(RCPDIR) | wc -l) recipes ..."
$(EVAL) "(package-build-all)"

html: index
index: archive.json
@echo " • Building html index ..."
$(MAKE) -C $(HTMLDIR)


## Cleanup rules
clean-working:
@echo " • Removing package sources ..."
rm -rf $(WORKDIR)/*

clean-packages:
@echo " • Removing packages ..."
rm -rfv $(PKGDIR)/*

clean-json:
@echo " • Removing json files ..."
-rm -vf archive.json recipes.json

clean: clean-working clean-packages clean-json


## Json rules
archive.json: packages/archive-contents
@echo " • Building $@ ..."
$(EVAL) '(package-build-archive-alist-as-json "archive.json")'

recipes.json: $(RCPDIR)/.dirstamp
@echo " • Building $@ ..."
$(EVAL) '(package-build-alist-as-json "recipes.json")'

json: archive.json recipes.json

$(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)-*) "
@echo


.PHONY: clean build index html json
.FORCE:
Something went wrong with that request. Please try again.