tncattach/makefile

34 lines
838 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
compiler = gcc
2020-06-24 06:01:35 -06:00
flags = -Wall -std=gnu11 -static-libgcc
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..."
2020-05-27 02:39:35 -06:00
@rm -f tncattach
2020-05-25 05:29:33 -06:00
tncattach:
@echo "Making tncattach..."
@echo "Compiling with: ${compiler}"
2020-06-24 06:01:35 -06:00
${compiler} ${flags} tncattach.c Serial.c TCP.c KISS.c TAP.c -o tncattach -Wall
2020-05-25 05:29:33 -06:00
2020-05-27 02:39:35 -06:00
install:
@echo "Installing tncattach..."
2020-09-28 03:11:27 -06:00
@chmod a+x tncattach
2020-05-27 02:39:35 -06:00
cp ./tncattach /usr/local/sbin/
2020-09-28 03:11:27 -06:00
@echo "Installing man page..."
@mkdir -p /usr/local/man/man8
@install -m 644 -o root -g root tncattach.8 /usr/local/man/man8/tncattach.8
@echo "Updating mandb..."
@mandb -f /usr/local/man/man8/tncattach.8 2> /dev/null 1> /dev/null
@echo "Done"
2020-05-27 02:39:35 -06:00
uninstall:
@echo "Uninstalling tncattach"
2020-06-24 06:01:35 -06:00
rm /usr/local/sbin/tncattach
2020-09-12 06:34:03 -06:00
rm /usr/local/man/man8/tncattach.8