Commit 89bb170a authored by Christopher Covington's avatar Christopher Covington Committed by Pavel Emelyanov

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: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f287d29e
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment