SHELL=/bin/sh

EPRINTS:=/usr/local/eprints

SRC_FILES:=$(shell find . -name "*_local")
DST_FILES:=$(subst ./,$(EPRINTS)/,$(SRC_FILES))

.PHONY: deploy


deploy: $(DST_FILES)

$(EPRINTS)/%: ./%
	@announce "Copying $<..."
	sudo cp $< $@
	@announce "Correcting ownership and permissions..."
	sudo chown www:www $@
	sudo chmod 755 $@


debug:
	@echo "EPRINTS = [$(EPRINTS)]"
	@echo "SRC_FILES = [$(SRC_FILES)]"
	@echo "DST_FILES = [$(DST_FILES)]"
