tncattach/makefile

36 lines
914 B
Makefile
Raw Normal View History

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
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
rebuild: clean all
2020-05-25 05:29:33 -06:00
clean:
@echo "Cleaning tncattach build..."
$(RM) -f tncattach
2020-05-25 05:29:33 -06:00
tncattach:
@echo "Making tncattach..."
@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..."
$(INSTALL) -d $(DESTDIR)/$(PREFIX)/bin
$(INSTALL) -Dm755 tncattach $(DESTDIR)/$(PREFIX)/bin/tncattach
2020-09-28 03:11:27 -06:00
@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
2020-05-27 02:39:35 -06:00
uninstall:
@echo "Uninstalling tncattach"
$(RM) $(DESTDIR)/$(PREFIX)/bin/tncattach
$(RM) $(DESTDIR)/$(PREFIX)/share/man/man8/tncattach.8.gz