aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKrow Savcik <krow@savcik.xyz>2023-12-25 14:35:33 +0200
committerKrow Savcik <krow@savcik.xyz>2023-12-25 14:35:33 +0200
commit1c6ad8f0fc372fe2234455e24745ef054d572e19 (patch)
treeb7c0b889f1cde6ee5e761cba4454eed57934d9b9 /Makefile
parent9e660e594f6d3a43ea1427fb872801a2fcedad93 (diff)
Change build to special directory
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files 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