summaryrefslogtreecommitdiff
path: root/Makefile
blob: b32cd807642da91a6b27500a2764ad96a156f570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
TARGET = zup
PREFIX = /usr
SRC = crc16.c serial.c repl.c cmd.c zup.c
OBJ = $(SRC:%.c=%.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)

.PHONY : install
install :
    mkdir -p $(PREFIX)/bin
    install $(TARGET) $(PREFIX)/bin/$(TARGET)

.PHONY : clean
clean :
    rm $(TARGET) $(OBJ)