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.

Revisions

  1. azilber created this gist Jun 12, 2014.
    29 changes: 29 additions & 0 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    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