Compare commits

..

No commits in common. "bb4b1917d5907e61c520915679cc9a0859fb5142" and "d9b3d2b6aefd50c6c535dbb42a8a80bfa84f1bfd" have entirely different histories.

View File

@ -1,35 +1,33 @@
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
.PHONY: all clean install uninstall tncattach .PHONY: all clean install uninstall tncattach
RM ?= rm compiler = gcc
INSTALL ?= install flags = -Wall -std=gnu11 -static-libgcc
CC ?= gcc
CFLAGS ?= -Wall -std=gnu11 -static-libgcc
LDFLAGS ?=
PREFIX ?= /usr/local
all: tncattach all: tncattach
rebuild: clean all rebuild: clean all
clean: clean:
@echo "Cleaning tncattach build..." @echo "Cleaning tncattach build..."
$(RM) -f tncattach @rm -f tncattach
tncattach: tncattach:
@echo "Making tncattach..." @echo "Making tncattach..."
@echo "Compiling with: $(CC)" @echo "Compiling with: ${compiler}"
$(CC) $(CFLAGS) $(LDFLAGS) tncattach.c Serial.c TCP.c KISS.c TAP.c -o tncattach ${compiler} ${flags} tncattach.c Serial.c TCP.c KISS.c TAP.c -o tncattach -Wall
install: install:
@echo "Installing tncattach..." @echo "Installing tncattach..."
$(INSTALL) -d $(DESTDIR)/$(PREFIX)/bin @chmod a+x tncattach
$(INSTALL) -Dm755 tncattach $(DESTDIR)/$(PREFIX)/bin/tncattach cp ./tncattach /usr/local/sbin/
@echo "Installing man page..." @echo "Installing man page..."
gzip -9 tncattach.8 @mkdir -p /usr/local/man/man8
$(INSTALL) -d $(DESTDIR)/$(PREFIX)/share/man/man8 @install -m 644 -o root -g root tncattach.8 /usr/local/man/man8/tncattach.8
$(INSTALL) -Dm644 tncattach.8.gz $(DESTDIR)/$(PREFIX)/share/man/man8/tncattach.8.gz @echo "Updating mandb..."
@mandb -f /usr/local/man/man8/tncattach.8 2> /dev/null 1> /dev/null
@echo "Done"
uninstall: uninstall:
@echo "Uninstalling tncattach" @echo "Uninstalling tncattach"
$(RM) $(DESTDIR)/$(PREFIX)/bin/tncattach rm /usr/local/sbin/tncattach
$(RM) $(DESTDIR)/$(PREFIX)/share/man/man8/tncattach.8.gz rm /usr/local/man/man8/tncattach.8