summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 1ddf091..8e1c0dd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,18 @@
TARGET = zup
PREFIX = /usr
+SRC = crc16.c serial.c repl.c cmd.c zup.c
+OBJ = $(SRC:%.c=%.o)
-$(TARGET) : upload.c
- gcc -o $@ $<
+CFLAGS = -Werror -Wpedantic -I. -g -DUSE_READLINE
+LDFLAGS = -lreadline
+
+$(TARGET) : zup.h $(OBJ)
+ @echo ' (LD)' $(OBJ)
+ @gcc $(LDFLAGS) -o $@ $(OBJ)
+
+%.o : %.c zup.h
+ @echo ' (CC)' $<
+ @gcc $(CFLAGS) -c -o $@ $<
all : $(TARGET)
@@ -13,4 +23,4 @@ install :
.PHONY : clean
clean :
- rm $(TARGET)
+ rm $(TARGET) $(OBJ)