1
0
forked from IPKM/nmreval
nmreval/Makefile
2023-04-10 19:33:23 +02:00

43 lines
882 B
Makefile
Executable File

.PHONY: clean
#binaries
PYUIC = pyuic5
# PYRCC = pyrcc5
CC = gcc
CFLAGS = -O2 -fPIC
LDFLAGs = -shared
#Directory with ui files
RESOURCE_DIR = src/resources/_ui
#Directory for compiled resources
PYQT_DIR = src/gui_qt/_py
#UI files to compile, uses every *.ui found in RESOURCE_DIR
UI_FILES = $(foreach dir, $(RESOURCE_DIR), $(notdir $(wildcard $(dir)/*.ui)))
PYQT_UI = $(UI_FILES:%.ui=$(PYQT_DIR)/%.py)
SVG_FILES = $(foreach dir, $(RCC_DIR), $(notdir $(wildcard $(dir)/*.svg)))
PNG_FILES = $(SVG_FILES:%.svg=$(RCC_DIR)/%.png)
all : ui
ui : $(PYQT_UI)
rcc: $(PNG_FILES)
$(COMPILED_DIR)/%.py : $(RESOURCE_DIR)/%.ui
$(PYUIC) $< -o $@
$(RCC_DIR)/%.png : $(RCC_DIR)/%.svg
convert -background none $< $@
clean:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +