aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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