From f64978d6c2628e1d4897696997b551f6b186d4bc Mon Sep 17 00:00:00 2001 From: Susan Potter Date: Thu, 6 Jan 2011 04:42:29 +0800 Subject: [PATCH] Added PREFIX variable (def:/usr/local) for install Instead of hard coding without any option to override the installation prefix directory, I added a PREFIX variable with the default value of /usr/local. Also used $(APP) for binary basename references instead of hardcoding "pit". This way if you want to have two versions of pit running you can rename one to, say, pit2. --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5960a3d..7b0b4cb 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ #!/usr/bin/make -# + +# Prefix directory where pit binary gets installed to. +PREFIX = /usr/local # The toplevel directory of the source tree. SRCDIR = ./src @@ -84,7 +86,7 @@ $(OBJDIR)/util.o: $(SRCDIR)/util.c $(SRCDIR)/pit.h $(SRCDIR)/object.h $(SRCDIR)/ $(CC) -o $(OBJDIR)/util.o -c $(SRCDIR)/util.c install: - cp $(BINDIR)/pit /usr/local/bin + cp $(BINDIR)/$(APP) $(PREFIX)/bin/$(APP) clean: rm -f $(OBJDIR)/*.o