# Makefile for Clean Log QGIS Plugin

PLUGINNAME = clean_log
PY_FILES = clean_log.py __init__.py core ui
EXTRAS = metadata.txt clean.svg assets

# OS-aware install dir
ifeq ($(OS),Windows_NT)
	INSTALL_DIR = $(USERPROFILE)/AppData/Roaming/QGIS/QGIS4/profiles/default/python/plugins/$(PLUGINNAME)
else
	INSTALL_DIR = $(HOME)/.local/share/QGIS/QGIS4/profiles/default/python/plugins/$(PLUGINNAME)
endif

default: zip

compile:
	@echo "No compilation needed for this plugin"

zip:
	zip -r $(PLUGINNAME).zip $(PY_FILES) $(EXTRAS) \
		-x "*/__pycache__/*" "*.pyc" "*/.windsurf/*" "*/dev/*"
	@echo "Plugin packaged as $(PLUGINNAME).zip"

clean:
	rm -f $(PLUGINNAME).zip
	@echo "Cleaned package files"

install: zip
	mkdir -p $(INSTALL_DIR)
	cp -r $(PY_FILES) $(EXTRAS) $(INSTALL_DIR)/
	@echo "Plugin installed"

.PHONY: compile zip clean install
