# Project & compiler information
NAME=kermit
CFLAGS=-flto -fuse-linker-plugin -mtune=generic -Os -pipe $(shell pkg-config --cflags vte-2.91)
LIBS=$(shell pkg-config --libs vte-2.91)
CC=gcc
all: clean build
# Build the project
build:
	mkdir build || true
	$(CC) $(CFLAGS) src/$(NAME).c -o build/$(NAME) $(LIBS)
	cp -prf .config/$(NAME).desktop build/$(NAME).desktop
# Make the installation
install:
	# Create directories if doesn't exist
	mkdir $(TARGET)/usr/local/bin || true
	mkdir $(TARGET)/usr/local/share/applications || true
	# Install
	install build/$(NAME) $(TARGET)/usr/local/bin/$(NAME)
	install build/$(NAME).desktop $(TARGET)/usr/local/share/applications/$(NAME).desktop
# Clean
clean:
	rm -rf build
