# Makefile to run node-gyp configure and build

NODE_GYP := npx node-gyp
ELECTRON_TARGET := 37.10.3
DIST_URL := https://electronjs.org/headers

# Default target
all: configure build

# Run node-gyp configure
configure:
	$(NODE_GYP) configure --target=$(ELECTRON_TARGET) --dist-url=$(DIST_URL)

# Run node-gyp build
build:
	$(NODE_GYP) build

# Install the built module to the specified directory
install:
	@mkdir -p /home/michael/source/repos/sfm/src/gio/build/Release
	@cp -v "/home/michael/source/repos/gio/build/Release/gio.node" /home/michael/source/repos/sfm/src/gio/build/Release/gio.node

# Clean up build files
clean:
	$(NODE_GYP) clean

.PHONY: all configure build clean install