From 65d32812c489556c81b0dfdee52880fb208aa328 Mon Sep 17 00:00:00 2001 From: Estelle Poulin Date: Thu, 25 Apr 2019 18:20:08 -0400 Subject: [PATCH] Add support for installing and releasing --- .gitignore | 3 ++- Makefile | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9c43172..ac413fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ parse-ssh-cl +parse-ssh-cl.tar.gz ## # From github/gitignore C.gitignore @@ -54,4 +55,4 @@ parse-ssh-cl modules.order Module.symvers Mkfile.old -dkms.conf \ No newline at end of file +dkms.conf diff --git a/Makefile b/Makefile index d6fd041..d6d895b 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,33 @@ CC=gcc +NAME=parse-ssh-cl CFLAGS=-I. DEPS = utils.h OBJ = utils.o main.o +PREFIX = $(HOME)/.local %.o: %.c $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) -parse-ssh-cl: $(OBJ) +$(NAME): $(OBJ) $(CC) -o $@ $^ $(CFLAGS) .PHONY: clean clean: rm -f *.o *~ core *~ + + +$(NAME).tar.gz: $(NAME) + tar -czf $(NAME).tar.gz $(NAME) + +.PHONY: release + +release: $(NAME).tar.gz + + +$(PREFIX)/bin/$(NAME): $(NAME) + install -m 0755 $(NAME) "$(PREFIX)/bin/$(NAME)" + +.PHONY: install + +install: $(PREFIX)/bin/$(NAME)