aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 9 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 36e86d7..10fc5cc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,19 @@
CC = gcc
+OUT = build
PLATFORM = unix
DUCKY_OBJ = src/ducky.o
-CFLAGS = -lbsd -lm -O2 -g -I src/ -I target/$(PLATFORM)
+CFLAGS = -lbsd -lm -Og -g -I src/ -I target/$(PLATFORM)
-$(PLATFORM).bin: $(DUCKY_OBJ) target/$(PLATFORM)/main.o
- $(CC) $(DUCKY_OBJ) target/$(PLATFORM)/main.o $(CFLAGS) -o $(PLATFORM).bin
+$(OUT)/$(PLATFORM).bin: $(DUCKY_OBJ) target/$(PLATFORM)/main.o Makefile
+ mkdir -p $(OUT)
+ $(CC) $(DUCKY_OBJ) target/$(PLATFORM)/main.o $(CFLAGS) -o $(OUT)/$(PLATFORM).bin
+
+install: $(OUT)/$(PLATFORM).bin
+ install $(OUT)/$(PLATFORM).bin /bin/ducky
clean:
- rm -f $(PLATFORM).bin
+ rm -f $(OUT)/$(PLATFORM).bin
rm -f target/$(PLATFORM)/main.o
rm -f $(DUCKY_OBJ)