
PROJECT := rotohsm

BUILDDIR ?= build

ZIP ?= zip

BOARDS := \
	bearing_mount_middle \
	bearing_mount_top \
	rotor_base_outer_pcb \
	rotor_base_pcb \
	rotor_top_pcb \
	rotor_vstrut_pcb \
	stator_base_pcb \
	stator_raspi_vstrut_pcb \
	stator_top_pcb

VERSION := $(shell git describe --tags --long --dirty)
COMBINED_ZIP := gerber_${PROJECT}_all_${VERSION}.zip

all: $(BUILDDIR)/$(COMBINED_ZIP)

$(BUILDDIR)/gerber_%_${VERSION}.zip: %/gerber
	$(ZIP) -r $@ $^

$(BUILDDIR)/$(COMBINED_ZIP): $(addprefix $(BUILDDIR)/,${BOARDS:%=gerber_%_${VERSION}.zip})
	$(ZIP) -r $@ $^

clean:
	rm -f build/*.zip
