# Makefile for example plugin

CC = gcc
CFLAGS = -Wall -Wextra -O2 -fPIC -I../../..
LDFLAGS = -shared

TARGET = example.so
SRCS = plugin.c
OBJS = $(SRCS:.c=.o)

.PHONY: all clean

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm -f $(OBJS) $(TARGET)

install: $(TARGET)
	@echo "Plugin built: $(TARGET)"
	@echo "Copy $(TARGET) to the plugins directory to use it"