Skip to content
Browse files

Have Makefile intospect it's working directory

  • Loading branch information...
1 parent 6e8d577 commit 56750ec1d5d8f1247516291ed3b88cd88e9316c7 @jof jof committed Dec 15, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 Makefile
View
5 Makefile
@@ -1,14 +1,15 @@
CFLAGS=-Wall -O2
# Conditionally assign DESTDIR
DESTDIR ?= /usr/local
+TOP := $(dir $(lastword $(MAKEFILE_LIST)))
.PHONY: install upstart all clean
all: gateman
install: gateman upstart
- install --mode=0755 --owner=root --group=root ./gateman $(DESTDIR)/sbin
+ install --mode=0755 --owner=root --group=root $(TOP)/gateman $(DESTDIR)/sbin
upstart: upstart-gateman.conf
- install --mode=0644 --owner=root --group=root ./upstart-gateman.conf /etc/init/noisebridge-gateman.conf
+ install --mode=0644 --owner=root --group=root $(TOP)/upstart-gateman.conf /etc/init/noisebridge-gateman.conf
test:
@echo "DESTDIR is ${DESTDIR}"
clean:

0 comments on commit 56750ec

Please sign in to comment.
Something went wrong with that request. Please try again.