2018-03-27 12:49:19 +03:00
all :
top_srcdir = ../../../../
UNAME_M := $( shell uname -m)
2018-03-28 10:45:34 +03:00
LIBKVM = lib/assert.c lib/elf.c lib/io.c lib/kvm_util.c lib/sparsebit.c
2018-03-27 23:46:11 +03:00
LIBKVM_x86_64 = lib/x86.c lib/vmx.c
2018-03-27 12:49:19 +03:00
2018-08-20 20:32:16 +03:00
TEST_GEN_PROGS_x86_64 = platform_info_test
TEST_GEN_PROGS_x86_64 += set_sregs_test
2018-03-28 10:45:34 +03:00
TEST_GEN_PROGS_x86_64 += sync_regs_test
2018-03-27 23:46:11 +03:00
TEST_GEN_PROGS_x86_64 += vmx_tsc_adjust_test
2018-06-26 06:41:57 +03:00
TEST_GEN_PROGS_x86_64 += cr4_cpuid_sync_test
2018-07-26 14:19:23 +03:00
TEST_GEN_PROGS_x86_64 += state_test
2018-08-22 10:20:00 +03:00
TEST_GEN_PROGS_x86_64 += dirty_log_test
2018-03-27 12:49:19 +03:00
TEST_GEN_PROGS += $( TEST_GEN_PROGS_$( UNAME_M) )
LIBKVM += $( LIBKVM_$( UNAME_M) )
INSTALL_HDR_PATH = $( top_srcdir) /usr
LINUX_HDR_PATH = $( INSTALL_HDR_PATH) /include/
2018-08-22 10:19:58 +03:00
LINUX_TOOL_INCLUDE = $( top_srcdir) tools/include
CFLAGS += -O2 -g -std= gnu99 -I$( LINUX_TOOL_INCLUDE) -I$( LINUX_HDR_PATH) -Iinclude -I$( <D) -I..
2018-08-29 10:04:08 +03:00
LDFLAGS += -pthread
2018-03-27 12:49:19 +03:00
# After inclusion, $(OUTPUT) is defined and
# $(TEST_GEN_PROGS) starts with $(OUTPUT)/
i n c l u d e . . / l i b . m k
STATIC_LIBS := $( OUTPUT) /libkvm.a
LIBKVM_OBJ := $( patsubst %.c, $( OUTPUT) /%.o, $( LIBKVM) )
EXTRA_CLEAN += $( LIBKVM_OBJ) $( STATIC_LIBS)
x := $( shell mkdir -p $( sort $( dir $( LIBKVM_OBJ) ) ) )
$(LIBKVM_OBJ) : $( OUTPUT ) /%.o : %.c
$( CC) $( CFLAGS) $( CPPFLAGS) $( TARGET_ARCH) -c $< -o $@
$(OUTPUT)/libkvm.a : $( LIBKVM_OBJ )
$( AR) crs $@ $^
2018-09-04 13:47:21 +03:00
all : $( STATIC_LIBS )
2018-03-27 12:49:19 +03:00
$(TEST_GEN_PROGS) : $( STATIC_LIBS )
2018-09-04 13:47:21 +03:00
$(STATIC_LIBS) : | khdr