From 1c6ad8f0fc372fe2234455e24745ef054d572e19 Mon Sep 17 00:00:00 2001 From: Krow Savcik Date: Mon, 25 Dec 2023 14:35:33 +0200 Subject: Change build to special directory --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 2efa90a..ba33b3c 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,22 @@ include config.mk -OBJ = ui.o canvas.o user.o palette.o tools.o debug.o +TOBJ = ui.o canvas.o user.o palette.o tools.o debug.o +OBJ = $(addprefix build/, ${TOBJ}) all: build run build: ${OBJ} src/cdraw.c - mkdir build ${CC} ${CFLAGS} ${LIBS} ${OBJ} src/cdraw.c -o build/cdraw +prep: + mkdir -p build + run: ./build/cdraw -%.o: src/%.c - ${CC} ${CFLAGS} $< -c +build/%.o: src/%.c + ${CC} ${CFLAGS} $< -c -o $@ clean: - rm *.o + rm $(OBJ) rm build/cdraw -- cgit v1.2.3