# Makefile for Calista Compositor

CC = cc
CFLAGS = -Wall -Wextra -O2 -g
CFLAGS += -I/usr/local/include
CFLAGS += -I/calista/engine/include

LDFLAGS = -L/usr/local/lib -lX11 -lXcomposite -lXdamage -lXrender -lGL -lEGL
LDFLAGS += -L/calista/engine -lsciter

TARGET = cwmX11
SRCS = main.c
OBJS = $(SRCS:.c=.o)

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(OBJS) -o $(TARGET) $(LDFLAGS)
	mv $(TARGET) ./../

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

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

run: $(TARGET)
	./$(TARGET)

install: $(TARGET)
	cp $(TARGET) /usr/local/bin/

uninstall:
	rm -f /usr/local/bin/$(TARGET)

.PHONY: all clean run install uninstall