1f08c3bdfSopenharmony_ci#
2f08c3bdfSopenharmony_ci#  Copyright (C) 2012  Red Hat, Inc.
3f08c3bdfSopenharmony_ci#
4f08c3bdfSopenharmony_ci#  This program is free software;  you can redistribute it and/or modify
5f08c3bdfSopenharmony_ci#  it under the terms of the GNU General Public License as published by
6f08c3bdfSopenharmony_ci#  the Free Software Foundation; either version 2 of the License, or
7f08c3bdfSopenharmony_ci#  (at your option) any later version.
8f08c3bdfSopenharmony_ci#
9f08c3bdfSopenharmony_ci#  This program is distributed in the hope that it will be useful,
10f08c3bdfSopenharmony_ci#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
11f08c3bdfSopenharmony_ci#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
12f08c3bdfSopenharmony_ci#  the GNU General Public License for more details.
13f08c3bdfSopenharmony_ci#
14f08c3bdfSopenharmony_ci#  You should have received a copy of the GNU General Public License
15f08c3bdfSopenharmony_ci#  along with this program;  if not, write to the Free Software
16f08c3bdfSopenharmony_ci#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17f08c3bdfSopenharmony_ci#
18f08c3bdfSopenharmony_ci
19f08c3bdfSopenharmony_ciMEM_SRCDIR		:= $(abs_top_srcdir)/testcases/kernel/mem
20f08c3bdfSopenharmony_ciLIBMEM_SRCDIR		:= $(MEM_SRCDIR)/lib
21f08c3bdfSopenharmony_ci
22f08c3bdfSopenharmony_ciMEM_DIR			:= $(top_builddir)/testcases/kernel/mem
23f08c3bdfSopenharmony_ciLIBMEM_DIR		:= $(MEM_DIR)/lib
24f08c3bdfSopenharmony_ciLIBMEM			:= $(LIBMEM_DIR)/libmem.a
25f08c3bdfSopenharmony_ciFILTER_OUT_DIRS		:= $(LIBMEM_DIR)
26f08c3bdfSopenharmony_ciCFLAGS			+= -I$(MEM_SRCDIR)/include -pthread
27f08c3bdfSopenharmony_ciLDLIBS			+= $(NUMA_LIBS) -lmem -lltp
28f08c3bdfSopenharmony_ciLDFLAGS			+= -L$(LIBMEM_DIR)
29f08c3bdfSopenharmony_ci
30f08c3bdfSopenharmony_ci$(LIBMEM_DIR):
31f08c3bdfSopenharmony_ci	mkdir -p "$@"
32f08c3bdfSopenharmony_ci
33f08c3bdfSopenharmony_ci$(LIBMEM): $(LIBMEM_DIR)
34f08c3bdfSopenharmony_ci	$(MAKE) -C $^ -f "$(LIBMEM_SRCDIR)/Makefile" all
35f08c3bdfSopenharmony_ci
36f08c3bdfSopenharmony_ciMAKE_DEPS		+= $(LIBMEM)
37f08c3bdfSopenharmony_ci
38f08c3bdfSopenharmony_citrunk-clean:: | lib-clean
39f08c3bdfSopenharmony_ci
40f08c3bdfSopenharmony_cilib-clean:: $(LIBMEM_DIR)
41f08c3bdfSopenharmony_ci	$(MAKE) -C $^ -f "$(LIBMEM_SRCDIR)/Makefile" clean
42f08c3bdfSopenharmony_ci
43f08c3bdfSopenharmony_ciinclude $(top_srcdir)/testcases/kernel/include/lib.mk
44