1
0
forked from IPKM/nmreval
nmreval/Makefile

49 lines
1.1 KiB
Makefile
Raw Normal View History

2022-03-08 09:27:40 +00:00
.PHONY: clean
#binaries
PYUIC = pyuic5
PYRCC = pyrcc5
#Directory with ui files
2023-04-13 17:38:58 +00:00
RESOURCE_DIR = src/resources/_ui
2022-03-08 09:27:40 +00:00
#Directory for compiled resources
2023-04-10 17:33:23 +00:00
PYQT_DIR = src/gui_qt/_py
2022-03-08 09:27:40 +00:00
#UI files to compile, uses every *.ui found in RESOURCE_DIR
UI_FILES = $(foreach dir, $(RESOURCE_DIR), $(notdir $(wildcard $(dir)/*.ui)))
2023-04-10 17:33:23 +00:00
PYQT_UI = $(UI_FILES:%.ui=$(PYQT_DIR)/%.py)
2022-03-08 09:27:40 +00:00
SVG_FILES = $(foreach dir, $(RCC_DIR), $(notdir $(wildcard $(dir)/*.svg)))
PNG_FILES = $(SVG_FILES:%.svg=$(RCC_DIR)/%.png)
2023-04-11 17:06:35 +00:00
CC = gcc
CFLAGS = -O2 -fPIC
LDFLAGS = -shared
2022-03-08 09:27:40 +00:00
2023-04-11 17:06:35 +00:00
C_DIR = src/nmreval/clib
all : ui compile
2023-04-10 17:33:23 +00:00
ui : $(PYQT_UI)
2022-03-08 09:27:40 +00:00
2023-04-11 17:06:35 +00:00
rcc : $(PNG_FILES)
# only one C file at the moment
compile : $(C_DIR)/integrate.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $(C_DIR)/integrate.so $<
2022-03-08 09:27:40 +00:00
$(COMPILED_DIR)/%.py : $(RESOURCE_DIR)/%.ui
$(PYUIC) $< -o $@
2023-04-10 17:33:23 +00:00
2022-03-08 09:27:40 +00:00
$(RCC_DIR)/%.png : $(RCC_DIR)/%.svg
convert -background none $< $@
$(PYRCC) $(RCC_DIR)/images.qrc -o $(COMPILED_DIR)/images_rc.py
clean:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +