2020-05-25 05:29:33 -06:00
|
|
|
.DEFAULT_GOAL := all
|
2020-05-27 02:39:35 -06:00
|
|
|
.PHONY: all clean install uninstall tncattach
|
2020-05-25 05:29:33 -06:00
|
|
|
|
2023-05-27 07:56:32 -06:00
|
|
|
RM ?= rm
|
|
|
|
INSTALL ?= install
|
|
|
|
CC ?= gcc
|
|
|
|
CFLAGS ?= -Wall -std=gnu11 -static-libgcc
|
|
|
|
LDFLAGS ?=
|
|
|
|
PREFIX ?= /usr/local
|
2020-05-25 05:29:33 -06:00
|
|
|
|
|
|
|
all: tncattach
|
2020-05-25 08:31:55 -06:00
|
|
|
rebuild: clean all
|
2020-05-25 05:29:33 -06:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "Cleaning tncattach build..."
|
2023-05-27 07:56:32 -06:00
|
|
|
$(RM) -f tncattach
|
2020-05-25 05:29:33 -06:00
|
|
|
|
|
|
|
tncattach:
|
|
|
|
@echo "Making tncattach..."
|
2023-05-27 07:56:32 -06:00
|
|
|
@echo "Compiling with: $(CC)"
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) tncattach.c Serial.c TCP.c KISS.c TAP.c -o tncattach
|
2020-05-25 05:29:33 -06:00
|
|
|
|
2020-05-27 02:39:35 -06:00
|
|
|
install:
|
|
|
|
@echo "Installing tncattach..."
|
2023-05-27 07:56:32 -06:00
|
|
|
$(INSTALL) -d $(DESTDIR)/$(PREFIX)/bin
|
|
|
|
$(INSTALL) -Dm755 tncattach $(DESTDIR)/$(PREFIX)/bin/tncattach
|
2020-09-28 03:11:27 -06:00
|
|
|
@echo "Installing man page..."
|
2023-05-27 07:56:32 -06:00
|
|
|
gzip -9 tncattach.8
|
|
|
|
$(INSTALL) -d $(DESTDIR)/$(PREFIX)/share/man/man8
|
|
|
|
$(INSTALL) -Dm644 tncattach.8.gz $(DESTDIR)/$(PREFIX)/share/man/man8/tncattach.8.gz
|
2020-05-27 02:39:35 -06:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
@echo "Uninstalling tncattach"
|
2023-05-27 07:56:32 -06:00
|
|
|
$(RM) $(DESTDIR)/$(PREFIX)/bin/tncattach
|
|
|
|
$(RM) $(DESTDIR)/$(PREFIX)/share/man/man8/tncattach.8.gz
|