From 282a754d8594c573f365bf21d0480d2efb40b423 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 29 Nov 2016 20:08:44 -0500 Subject: [PATCH] Added install and uninstall tasks to makefile default PREFIX of $HOME --- Makefile | 11 +++++++++++ config.mk | 3 +++ xedit.c | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 12b1afb..a49c3ee 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,17 @@ all: xedit xpick clean: $(RM) *.o lib*/*.o test/*.o *.a xpick xedit unittests +install: all + mkdir -p $(PREFIX)/bin + cp xedit $(PREFIX)/bin + cp xpick $(PREFIX)/bin + cp xfilepick $(PREFIX)/bin + +uninstall: all + rm -f $(PREFIX)/bin/xedit + rm -f $(PREFIX)/bin/xpick + rm -f $(PREFIX)/bin/xfilepick + test: unittests ./unittests diff --git a/config.mk b/config.mk index 4dac5a5..33775f1 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,8 @@ # Customize this file to fit your system +# Install location +PREFIX = $(HOME) + # Compiler Setup CC = c99 CFLAGS = -g -O0 $(INCS) diff --git a/xedit.c b/xedit.c index 31afa7d..5cd3c38 100644 --- a/xedit.c +++ b/xedit.c @@ -170,8 +170,8 @@ static char* CopyCmd[] = { "xsel", "-bi", NULL }; static char* PasteCmd[] = { "xsel", "-bo", NULL }; #endif static char* ShellCmd[] = { "/bin/sh", "-c", NULL, NULL }; -static char* PickFileCmd[] = { "./xfilepick", ".", NULL }; -static char* OpenCmd[] = { "./xedit", NULL, NULL }; +static char* PickFileCmd[] = { "xfilepick", ".", NULL }; +static char* OpenCmd[] = { "xedit", NULL, NULL }; /* Main Routine *****************************************************************************/ -- 2.52.0