BUILDDIR := ./void-packages TEMPLATES := $(shell find srcpkgs/* -maxdepth 0 -type d) PACKAGES := $(addprefix $(BUILDDIR)/,$(notdir $(TEMPLATES))) all: sync $(PACKAGES) $(info TEMPLATES: $(TEMPLATES)) $(info PACKAGES: $(PACKAGES)) $(BUILDDIR)/%: srcpkgs/% @echo "Building package: $<" @rm -rf $(BUILDDIR)/srcpkgs/$< @cp -ru $< $(BUILDDIR)/srcpkgs/ @-cd $(BUILDDIR) && ./xbps-src clean $< @-cd $(BUILDDIR) && ./xbps-src pkg $< || echo "Warning: Failed to build $<" @mkdir -p ./dest @-cp -u $(BUILDDIR)/hostdir/binpkgs/*.xbps ./dest/ @-cp $(BUILDDIR)/hostdir/binpkgs/x86_64-repodata ./dest/ sync: sync-build sync-fetch: test -d $(BUILDDIR) || git clone --depth=1 https://github.com/void-linux/void-packages.git $^ sync-update: sync-fetch @cd $(BUILDDIR) && git pull sync-build: sync-update @cd $(BUILDDIR) && ./xbps-src binary-bootstrap sync-clean: rm -rf $(BUILDDIR) build-clean: rm -rf ./dest clean: sync-clean build-clean