PACKAGE	= OgreAlert
DIR		= ./$(PACKAGE)

all: $(PACKAGE).zip

$(PACKAGE).zip: clean dir copy zip

dir:
	mkdir $(DIR)

copy:
	cp -RT ./assets $(DIR)/assets
	cp -RT ./inc $(DIR)/inc
	cp -RT ./lib $(DIR)/lib
	cp -RT ./templates $(DIR)/templates
	cp -f ./* $(DIR) || true

	rm $(DIR)/Makefile
	rm $(DIR)/$(PACKAGE).zip || true

	rm -r $(DIR)/assets/sass/lib
	rm $(DIR)/assets/sass/*.scss
	rm $(DIR)/assets/sass/*.map

zip:
	zip -r ./$(PACKAGE).zip $(DIR)
	rm -r $(DIR) || true

clean:
	rm -r $(DIR) || true
	rm ./$(PACKAGE).zip || true
