xref: /aosp_15_r20/external/ltp/include/mk/testcases.mk (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker#
2*49cdfc7eSAndroid Build Coastguard Worker#    testcases include Makefile.
3*49cdfc7eSAndroid Build Coastguard Worker#
4*49cdfc7eSAndroid Build Coastguard Worker#    Copyright (C) 2009, Cisco Systems Inc.
5*49cdfc7eSAndroid Build Coastguard Worker#
6*49cdfc7eSAndroid Build Coastguard Worker#    This program is free software; you can redistribute it and/or modify
7*49cdfc7eSAndroid Build Coastguard Worker#    it under the terms of the GNU General Public License as published by
8*49cdfc7eSAndroid Build Coastguard Worker#    the Free Software Foundation; either version 2 of the License, or
9*49cdfc7eSAndroid Build Coastguard Worker#    (at your option) any later version.
10*49cdfc7eSAndroid Build Coastguard Worker#
11*49cdfc7eSAndroid Build Coastguard Worker#    This program is distributed in the hope that it will be useful,
12*49cdfc7eSAndroid Build Coastguard Worker#    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*49cdfc7eSAndroid Build Coastguard Worker#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*49cdfc7eSAndroid Build Coastguard Worker#    GNU General Public License for more details.
15*49cdfc7eSAndroid Build Coastguard Worker#
16*49cdfc7eSAndroid Build Coastguard Worker#    You should have received a copy of the GNU General Public License along
17*49cdfc7eSAndroid Build Coastguard Worker#    with this program; if not, write to the Free Software Foundation, Inc.,
18*49cdfc7eSAndroid Build Coastguard Worker#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*49cdfc7eSAndroid Build Coastguard Worker#
20*49cdfc7eSAndroid Build Coastguard Worker# Ngie Cooper, July 2009
21*49cdfc7eSAndroid Build Coastguard Worker#
22*49cdfc7eSAndroid Build Coastguard Worker
23*49cdfc7eSAndroid Build Coastguard Workerinclude $(top_srcdir)/include/mk/env_pre.mk
24*49cdfc7eSAndroid Build Coastguard Workerinclude $(top_srcdir)/include/mk/functions.mk
25*49cdfc7eSAndroid Build Coastguard Workerinclude $(top_srcdir)/include/mk/sparse.mk
26*49cdfc7eSAndroid Build Coastguard Worker
27*49cdfc7eSAndroid Build Coastguard WorkerAPICMDS_DIR	:= $(abs_top_builddir)/tools/apicmds
28*49cdfc7eSAndroid Build Coastguard Worker
29*49cdfc7eSAndroid Build Coastguard WorkerLIBLTP_DIR	:= $(abs_top_builddir)/lib
30*49cdfc7eSAndroid Build Coastguard Worker
31*49cdfc7eSAndroid Build Coastguard WorkerLIBLTP		:= $(LIBLTP_DIR)/libltp.a
32*49cdfc7eSAndroid Build Coastguard Worker
33*49cdfc7eSAndroid Build Coastguard Worker$(APICMDS_DIR)/tst_kvercmp: $(APICMDS_DIR)
34*49cdfc7eSAndroid Build Coastguard Worker	$(MAKE) -C "$^" -f "$(abs_top_srcdir)/tools/apicmds/Makefile" all
35*49cdfc7eSAndroid Build Coastguard Worker
36*49cdfc7eSAndroid Build Coastguard Worker$(LIBLTP): $(LIBLTP_DIR)
37*49cdfc7eSAndroid Build Coastguard Worker	$(MAKE) -C "$^" -f "$(abs_top_srcdir)/lib/Makefile" all
38*49cdfc7eSAndroid Build Coastguard Worker
39*49cdfc7eSAndroid Build Coastguard WorkerMAKE_DEPS	:= $(LIBLTP)
40*49cdfc7eSAndroid Build Coastguard Worker
41*49cdfc7eSAndroid Build Coastguard WorkerINSTALL_DIR	:= testcases/bin
42*49cdfc7eSAndroid Build Coastguard Worker
43*49cdfc7eSAndroid Build Coastguard WorkerLDLIBS		+= -lltp
44*49cdfc7eSAndroid Build Coastguard Worker
45*49cdfc7eSAndroid Build Coastguard Workerifdef LTPLIBS
46*49cdfc7eSAndroid Build Coastguard Worker
47*49cdfc7eSAndroid Build Coastguard WorkerLTPLIBS_DIRS = $(addprefix $(abs_top_builddir)/libs/lib, $(LTPLIBS))
48*49cdfc7eSAndroid Build Coastguard WorkerLTPLIBS_FILES = $(addsuffix .a, $(addprefix $(abs_top_builddir)/libs/, $(foreach LIB,$(LTPLIBS),lib$(LIB)/lib$(LIB))))
49*49cdfc7eSAndroid Build Coastguard Worker
50*49cdfc7eSAndroid Build Coastguard WorkerMAKE_DEPS += $(LTPLIBS_FILES)
51*49cdfc7eSAndroid Build Coastguard Worker
52*49cdfc7eSAndroid Build Coastguard Worker.PHONY: $(LTPLIBS_FILES)
53*49cdfc7eSAndroid Build Coastguard Worker
54*49cdfc7eSAndroid Build Coastguard Worker$(LTPLIBS_FILES): $(LTPLIBS_DIRS)
55*49cdfc7eSAndroid Build Coastguard Worker
56*49cdfc7eSAndroid Build Coastguard Worker$(LTPLIBS_FILES): %:
57*49cdfc7eSAndroid Build Coastguard Workerifdef VERBOSE
58*49cdfc7eSAndroid Build Coastguard Worker	$(MAKE) -C "$(dir $@)" -f "$(subst $(abs_top_builddir),$(abs_top_srcdir),$(dir $@))/Makefile" all
59*49cdfc7eSAndroid Build Coastguard Workerelse
60*49cdfc7eSAndroid Build Coastguard Worker	@echo "BUILD $(notdir $@)"
61*49cdfc7eSAndroid Build Coastguard Worker	@$(MAKE) --no-print-directory -C "$(dir $@)" -f "$(subst $(abs_top_builddir),$(abs_top_srcdir),$(dir $@))/Makefile" all
62*49cdfc7eSAndroid Build Coastguard Workerendif
63*49cdfc7eSAndroid Build Coastguard Worker
64*49cdfc7eSAndroid Build Coastguard WorkerLDFLAGS += $(addprefix -L$(top_builddir)/libs/lib, $(LTPLIBS))
65*49cdfc7eSAndroid Build Coastguard Worker
66*49cdfc7eSAndroid Build Coastguard Workerendif
67*49cdfc7eSAndroid Build Coastguard Worker
68*49cdfc7eSAndroid Build Coastguard Worker$(LTPLIBS_DIRS) $(APICMDS_DIR) $(LIBLTP_DIR): %:
69*49cdfc7eSAndroid Build Coastguard Worker	mkdir -p "$@"
70