From 566ea338dac813f93e559b0c8dc344c8a9063928 Mon Sep 17 00:00:00 2001 From: Aleksa Vuckovic Date: Sun, 21 Jan 2024 04:02:10 +0100 Subject: Initial commit --- Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fb66c1a --- /dev/null +++ b/Makefile @@ -0,0 +1,44 @@ +WIN ?= X11 + +CC=gcc +CFLAGS=$(shell pkg-config --cflags cairo) +LFLAGS=$(shell pkg-config --libs cairo) + +BIN=dav +SRC_DIR=./src +SRC_FILES=$(wildcard $(SRC_DIR)/*.c) +OBJ_FILES=$(patsubst %.c, %.o, $(SRC_FILES)) + + +ifeq ($(WIN), X11) + WIN_SYS=$(WIN) + LFLAGS += -lX11 -lXcomposite -lXfixes +endif + +ifeq ($(WIN), Wayland) + WIN_SYS=$(WIN) +endif + +ifeq ($(WIN), WinAPI) + WIN_SYS=$(WIN) +endif + + +ifndef WIN_SYS +$(error WIN available: "X11", "Wayland", "WinAPI") +endif + + +all: $(BIN) + +%.o: %.c + $(CC) -D$(WIN) $(CFLAGS) -c $< -o $@ + +$(BIN): $(OBJ_FILES) + $(CC) -D$(WIN) $(CFLAGS) -o $@ $^ $(LFLAGS) + +run: $(BIN) + ./$(BIN) + +clean: + rm -f $(BIN) $(OBJ_FILES) -- cgit v1.2.3