From fac26f795cf96ec624a3a334ba9b78ea2d86811d Mon Sep 17 00:00:00 2001 From: Kalle Vahlman Date: Fri, 16 Sep 2011 09:04:54 +0300 Subject: Propagate PREFIX to the code to find the default config file Now that we can install into PREFIX, we need to reflect that in the location of the default config file. --- Makefile | 8 ++++---- riff/main.h | 2 +- riff/riff.mk | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b601628..e480c02 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,16 @@ # Makefile - riff +DESTDIR := +PREFIX := /usr + .PHONY: all all: \ CDAL \ riff - .PHONY: riff riff: CDAL - cd riff/ && $(MAKE) -f riff.mk + cd riff/ && $(MAKE) -f riff.mk PREFIX=$(PREFIX) .PHONY: CDAL CDAL: @@ -49,8 +51,6 @@ debian: clean all rm -rf debian rm -rf doc/man/temp -DESTDIR := -PREFIX := /usr INSTDIR = $(DESTDIR)$(PREFIX) .PHONY: install diff --git a/riff/main.h b/riff/main.h index 7826eb4..916e523 100644 --- a/riff/main.h +++ b/riff/main.h @@ -31,7 +31,7 @@ enum ConnectionType { Logger* logger_; Config* config_; -char configFile[PATH_LENGTH] = "/usr/share/riff/config"; +char configFile[PATH_LENGTH] = RIFF_CONFIG_PREFIX "/share/riff/config"; char flashimage[PATH_LENGTH] = "\0"; char address[PATH_LENGTH] = "0"; char length[PATH_LENGTH] = "0"; diff --git a/riff/riff.mk b/riff/riff.mk index f083879..b81d343 100644 --- a/riff/riff.mk +++ b/riff/riff.mk @@ -1,7 +1,8 @@ # Makefile - riff +PREFIX := /usr CXX=g++ -CFLAGS=-I../os_wrappers -I../CDAL -D_FILE_OFFSET_BITS=64 +CFLAGS=-I../os_wrappers -I../CDAL -D_FILE_OFFSET_BITS=64 -DRIFF_CONFIG_PREFIX=\"$(PREFIX)\" CXXFLAGS=$(CFLAGS) LD=$(CXX) $(CXXFLAGS) LDFLAGS=-L../CDAL -- cgit v1.2.3