UIFILES = $(shell ls *.ui)
RCFILES = $(shell ls *.rc)
PyUIFILES = $(patsubst %.ui, ui_%.py, $(UIFILES))
PyRCFILES = $(patsubst %.rc, %_rc.py, $(RCFILES))

all: $(PyUIFILES) $(PyRCFILES)
	@echo $(PyUIFILES) $(PyRCFILES) are up to date.

ui_%.py : %.ui
	pyuic5 $< -o $@
	sed -i 's/import plugin_rc/from .plugin_rc import */' $@

%_rc.py : %.rc
	pyrcc5 $< -o $@

clean:
	rm -f *~
	rm -f $(PyUIFILES) $(PyRCFILES)

.PHONY: all clean
