Gnome input devices manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
ginput/Makefile

40 lines
1.1 KiB

NAME=ginput
CC=gcc
CFLAGS=$(shell pkg-config --cflags gtk4 libadwaita-1 libusb-1.0) -O3 -I src
LDFLAGS=$(shell pkg-config --libs gtk4 libadwaita-1 libusb-1.0)
BUILD_DIR=build
UI := $(shell find ui/ -name '*.ui')
C_FILES := $(shell find src/ -name '*.c')
all: resources $(BUILD_DIR)/$(NAME)
# Top-level targets
resources: $(BUILD_DIR)/glib-2.0/schemas/gschemas.compiled
$(BUILD_DIR)/$(NAME): $(BUILD_DIR)/resource.c $(C_FILES) | $(BUILD_DIR)
gcc $(CFLAGS) -o $@ $^ $(LDFLAGS)
# Build directory
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
# Resources
$(BUILD_DIR)/resource.c: ui/ginput.gresource.xml ui/style.css ui
cp ui/style.css $(BUILD_DIR)/
cd ui && glib-compile-resources --generate-source --target=resource.c ginput.gresource.xml
mv ui/resource.c $(BUILD_DIR)/
$(BUILD_DIR)/glib-2.0/schemas/gschemas.compiled: v.ginput.gschema.xml | $(BUILD_DIR)
mkdir -p $(BUILD_DIR)/glib-2.0/schemas
glib-compile-schemas . --targetdir=$(BUILD_DIR)/glib-2.0/schemas
# Phony targets
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
.PHONY: run
.SILENT: run
run: all
XDG_DATA_DIRS=./$(BUILD_DIR) ./$(BUILD_DIR)/ginput