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