Skip to content

Instantly share code, notes, and snippets.

@azilber
Created June 12, 2014 06:19
Show Gist options
  • Save azilber/083050a94c1933d8dfef to your computer and use it in GitHub Desktop.
Save azilber/083050a94c1933d8dfef to your computer and use it in GitHub Desktop.
sshutout Makefile for ubuntu (works n 14.x)
CC = gcc
WARNINGS = -Wall
COMPILE = -pipe -O2
#DEBUG = -ggdb
LD_OPT = -s
CFLAGS = $(DEBUG) $(WARNINGS) $(COMPILE)
SRCS = sshutout.c
OBJS = $(SRCS:.c=.o)
sshutout: $(SRCS) $(OBJS) $(HEADERS)
$(CC) $(CFLAGS) $(LD_OPT) -o $@ $(OBJS)
install: sshutout
cp sshutout /usr/local/sbin/sshutout
chown root:root /usr/local/sbin/sshutout
chmod 755 /usr/local/sbin/sshutout
if [ -r /etc/sshutout.conf ]; then mv /etc/sshutout.conf /etc/sshutout.conf~; fi
cp sshutout.conf /etc/sshutout.conf
chown root:root /etc/sshutout.conf
chmod 640 /etc/sshutout.conf
if [ ! -d /usr/share/man/man8 ]; then mkdir -m 755 /usr/share/man/man8; fi
cp sshutout.8 /usr/share/man/man8/sshutout.8
chown root:root /usr/share/man/man8/sshutout.8
chmod 644 /usr/share/man/man8/sshutout.8
clean:
rm -f $(OBJS) sshutout core
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment