lib-y			+= log-simple.o
lib-y			+= util-fd.o
lib-y			+= util.o

ifeq ($(VDSO),y)
        lib-y		+= util-vdso.o
        lib-y		+= parasite-vdso.o
        lib-y		+= ./$(ARCH_DIR)/vdso-pie.o

        ifeq ($(SRCARCH),aarch64)
                lib-y	+= ./$(ARCH_DIR)/intraprocedure.o
        endif

        ifeq ($(SRCARCH),ppc64)
                lib-y	+= ./$(ARCH_DIR)/vdso-trampoline.o
        endif
endif

ifeq ($(SRCARCH),ppc64)
        lib-y		+= ./$(ARCH_DIR)/memcpy_power7.o
        lib-y		+= ./$(ARCH_DIR)/memcmp_64.o
        lib-y		+= ./$(ARCH_DIR)/misc.o
endif

ifeq ($(SRCARCH),x86)
        lib-y		+= ./$(ARCH_DIR)/memcpy.o
endif

#
# We can't provide proper mount implementation
# in parasite code -- it requires run-time rellocation
# applications, which is not the target of the
# project.
#
iquotes			:= -iquote $(SRC_DIR)/$(PIE_DIR)/piegen
iquotes			+= -iquote $(SRC_DIR)/$(ARCH_DIR)/include
iquotes			+= -iquote $(SRC_DIR) -iquote $(SRC_DIR)/criu/include -iquote $(SRC_DIR)/include
CFLAGS			:= $(filter-out -pg $(CFLAGS-GCOV),$(CFLAGS)) $(iquotes)
asflags-y		:= -D__ASSEMBLY__ $(iquotes)

ifeq ($(SRCARCH),arm)
	ccflags-y	+= -marm
endif

ifneq ($(filter-out ia32,$(ARCH)),)
        ccflags-y	+= -DCR_NOGLIBC -fpie -Wa,--noexecstack -fno-stack-protector
else
        ccflags-y	+= -DCR_NOGLIBC -fno-pic -Wa,--noexecstack -fno-stack-protector
endif
