summaryrefslogtreecommitdiff
path: root/Makefile
blob: 38084b9e644fadc39d2bddec9482e87bc04f2570 (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 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)