-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
makefile
35 lines (29 loc) · 914 Bytes
/
makefile
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
27
28
29
30
31
32
33
34
35
.DEFAULT_GOAL := all
.PHONY: all clean install uninstall tncattach
RM ?= rm
INSTALL ?= install
CC ?= gcc
CFLAGS ?= -Wall -std=gnu11 -static-libgcc
LDFLAGS ?=
PREFIX ?= /usr/local
all: tncattach
rebuild: clean all
clean:
@echo "Cleaning tncattach build..."
$(RM) -f tncattach
tncattach:
@echo "Making tncattach..."
@echo "Compiling with: $(CC)"
$(CC) $(CFLAGS) $(LDFLAGS) tncattach.c Serial.c TCP.c KISS.c TAP.c -o tncattach
install:
@echo "Installing tncattach..."
$(INSTALL) -d $(DESTDIR)/$(PREFIX)/bin
$(INSTALL) -Dm755 tncattach $(DESTDIR)/$(PREFIX)/bin/tncattach
@echo "Installing man page..."
gzip -9 tncattach.8
$(INSTALL) -d $(DESTDIR)/$(PREFIX)/share/man/man8
$(INSTALL) -Dm644 tncattach.8.gz $(DESTDIR)/$(PREFIX)/share/man/man8/tncattach.8.gz
uninstall:
@echo "Uninstalling tncattach"
$(RM) $(DESTDIR)/$(PREFIX)/bin/tncattach
$(RM) $(DESTDIR)/$(PREFIX)/share/man/man8/tncattach.8.gz