From c57bd066d1f56c64642892c400e3dde8a982639c Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 6 Jun 2013 00:37:52 +0200 Subject: [PATCH] Build fix, if ROOTDIR was set linking failed. Use TOPDIR internally. Signed-off-by: Joachim Nilsson --- Makefile | 3 ++- common.mk | 2 +- plugins/Makefile | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 64506bbd..9daad7bf 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,7 @@ SRCS = $(OBJS:.o=.c) DEPS = $(addprefix .,$(SRCS:.c=.d)) # Installation paths, always prepended with DESTDIR if set +TOPDIR = $(shell pwd) prefix ?= /usr sysconfdir ?= /etc sbindir ?= /sbin @@ -60,7 +61,7 @@ CPPFLAGS += -Ilibite -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE CPPFLAGS += -DVERSION=\"$(VERSION)\" -DWHOAMI=\"`whoami`@`hostname`\" CPPFLAGS += -DFINIT_FIFO=\"$(FINIT_FIFO)\" -DFINIT_CONF=\"$(FINIT_CONF)\" CPPFLAGS += -DFINIT_RCSD=\"$(FINIT_RCSD)\" -DPLUGIN_PATH=\"$(plugindir)\" -LDFLAGS += -rdynamic -L$(ROOTDIR)/libite +LDFLAGS += -rdynamic -L$(TOPDIR)/libite DEPLIBS = libite/libite.so LDLIBS += -ldl -lite diff --git a/common.mk b/common.mk index 4235695f..eb3b2e38 100644 --- a/common.mk +++ b/common.mk @@ -1,5 +1,5 @@ # Top directory for building complete system, fall back to this directory -ROOTDIR ?= $(shell pwd) +ROOTDIR ?= $(TOPDIR) # Some junk files we always want to be removed when doing a make clean. JUNK = *~ *.bak *.aux *.dvi *.idx *.ind *.log *.ps *.map .*.d DEADJOE semantic.cache *.gdb *.elf core core.* diff --git a/plugins/Makefile b/plugins/Makefile index d6528e8a..0cabbddb 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -6,6 +6,7 @@ LDFLAGS += -shared PLUGINS ?= initctl.so alsa-utils.so bootmisc.so dbus.so hwclock.so \ resolvconf.so urandom.so x11-common.so tty.so DEPS = $(addprefix .,$(PLUGINS:.so=.d)) +TOPDIR ?= $(shell pwd) include ../common.mk