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.
This commit is contained in:
Susan Potter
2011-01-06 04:42:29 +08:00
committed by Michael Dvorkin
parent 727a022192
commit f64978d6c2

View File

@@ -1,5 +1,7 @@
#!/usr/bin/make #!/usr/bin/make
#
# Prefix directory where pit binary gets installed to.
PREFIX = /usr/local
# The toplevel directory of the source tree. # The toplevel directory of the source tree.
SRCDIR = ./src 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 $(CC) -o $(OBJDIR)/util.o -c $(SRCDIR)/util.c
install: install:
cp $(BINDIR)/pit /usr/local/bin cp $(BINDIR)/$(APP) $(PREFIX)/bin/$(APP)
clean: clean:
rm -f $(OBJDIR)/*.o rm -f $(OBJDIR)/*.o