From 89bb170a26e8705dbc4ad57a2d738bb2884efd08 Mon Sep 17 00:00:00 2001 From: Christopher Covington Date: Fri, 7 Feb 2014 12:04:37 -0500 Subject: [PATCH] Always use ARCH_DIR The top-level makefile defines an ARCH_DIR variable. Always use it rather than referencing ARCH directly, since ARCH may be set by the user on the command line and that raw input may not be what needs to be used internally. Signed-off-by: Pavel Emelyanov --- Makefile | 20 ++++++++++---------- Makefile.crtools | 2 +- lib/Makefile | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index fd8c29d1c..7224463d8 100644 --- a/Makefile +++ b/Makefile @@ -101,8 +101,8 @@ else endif CFLAGS += $(WARNINGS) $(DEFINES) -SYSCALL-LIB := arch/$(ARCH)/syscalls.built-in.o -ARCH-LIB := arch/$(ARCH)/crtools.built-in.o +SYSCALL-LIB := $(ARCH_DIR)/syscalls.built-in.o +ARCH-LIB := $(ARCH_DIR)/crtools.built-in.o CRIU-SO := libcriu CRIU-LIB := lib/$(CRIU-SO).so CRIU-INC := lib/criu.h include/criu-plugin.h include/criu-log.h protobuf/rpc.proto @@ -126,7 +126,7 @@ build-crtools := -r -R -f scripts/Makefile.build makefile=Makefile.crtools obj PROGRAM := criu .PHONY: all zdtm test rebuild clean distclean tags cscope \ - docs help pie protobuf arch/$(ARCH) clean-built lib + docs help pie protobuf $(ARCH_DIR) clean-built lib ifeq ($(GCOV),1) %.o $(PROGRAM): override CFLAGS += --coverage @@ -140,14 +140,14 @@ protobuf/%:: protobuf: $(Q) $(MAKE) $(build)=protobuf all -arch/$(ARCH)/%:: protobuf - $(Q) $(MAKE) $(build)=arch/$(ARCH) $@ -arch/$(ARCH): protobuf - $(Q) $(MAKE) $(build)=arch/$(ARCH) all +$(ARCH_DIR)/%:: protobuf + $(Q) $(MAKE) $(build)=$(ARCH_DIR) $@ +$(ARCH_DIR): protobuf + $(Q) $(MAKE) $(build)=$(ARCH_DIR) all -pie/%:: arch/$(ARCH) +pie/%:: $(ARCH_DIR) $(Q) $(MAKE) $(build)=pie $@ -pie: arch/$(ARCH) +pie: $(ARCH_DIR) $(Q) $(MAKE) $(build)=pie all %.o %.i %.s %.d: $(VERSION_HEADER) pie @@ -181,7 +181,7 @@ test: zdtm clean-built: $(Q) $(RM) $(VERSION_HEADER) - $(Q) $(MAKE) $(build)=arch/$(ARCH) clean + $(Q) $(MAKE) $(build)=$(ARCH_DIR) clean $(Q) $(MAKE) $(build)=protobuf clean $(Q) $(MAKE) $(build)=pie clean $(Q) $(MAKE) $(build)=lib clean diff --git a/Makefile.crtools b/Makefile.crtools index 094013e56..374cd8570 100644 --- a/Makefile.crtools +++ b/Makefile.crtools @@ -57,7 +57,7 @@ obj-y += kerndat.o obj-y += stats.o obj-y += string.o obj-y += sigframe.o -obj-y += arch/$(ARCH)/vdso.o +obj-y += $(ARCH_DIR)/vdso.o obj-y += cr-service.o obj-y += sd-daemon.o obj-y += plugin.o diff --git a/lib/Makefile b/lib/Makefile index a590126eb..a9a661ff6 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -2,7 +2,7 @@ lib-so += $(CRIU-SO) obj-y += criu.o obj-ext-src-y += protobuf/rpc.pb-c.o -includes += -iquote $(obj)/../arch/$(ARCH)/include -iquote $(obj)/../include -iquote $(obj)/.. -iquote $(obj)/../protobuf +includes += -iquote $(obj)/../$(ARCH_DIR)/include -iquote $(obj)/../include -iquote $(obj)/.. -iquote $(obj)/../protobuf cflags-y += $(includes) -fPIC -Wa,--noexecstack -fno-stack-protector cflags-so += $(CFLAGS) -rdynamic -Wl,-soname,$(lib-so).so.$(VERSION_SO_MAJOR) ldflags-so += -lprotobuf-c