update Makefile, move wmc.c to seperate folder

This commit is contained in:
Akos Horvath 2023-05-26 15:56:35 +02:00
parent 98ff93e7c0
commit 9bb7c645aa
2 changed files with 25 additions and 4 deletions

View File

@ -1,4 +1,25 @@
all:
gcc wm.c client.c handler.c main.c -lXinerama -lX11 -o wm
debug:
gcc wm.c client.c handler.c main.c -lXinerama -lX11 -o wm -g
CC=gcc
EXT=.c
FLAGS=-O0 -g
DEPFLAGS=-MD -MP
LIBS=$(shell pkg-config --libs xcb x11 xinerama)
EXEC_NAME=wm
OBJDIR=obj
SRC=$(wildcard *$(EXT))
OBJS=$(patsubst %,$(OBJDIR)/%.o, $(basename $(SRC)))
$(shell mkdir -p $(dir $(OBJS)) > /dev/null)
$(EXEC_NAME): $(OBJS)
$(CC) $(FLAGS) $(LIBS) $^ -o $(EXEC_NAME)
$(OBJDIR)/%.o: %$(EXT)
$(CC) $(FLAGS) $(DEPFLAGS) -c -o $@ $<
.PHONY: clean
clean:
rm -rf $(OBJDIR)
-include $(SRC:$(EXT)=.d)

View File