1f08c3bdfSopenharmony_ci# SPDX-License-Identifier: GPL-2.0-or-later
2f08c3bdfSopenharmony_ci# Copyright (c) 2021 SUSE LLC <rpalethorpe@suse.com>
3f08c3bdfSopenharmony_ci
4f08c3bdfSopenharmony_citop_srcdir		?= ../..
5f08c3bdfSopenharmony_ci
6f08c3bdfSopenharmony_ciinclude $(top_srcdir)/include/mk/env_pre.mk
7f08c3bdfSopenharmony_ciinclude $(top_srcdir)/include/mk/functions.mk
8f08c3bdfSopenharmony_ci
9f08c3bdfSopenharmony_ciSPARSE_SRC	?= sparse-src
10f08c3bdfSopenharmony_ci
11f08c3bdfSopenharmony_ci$(SPARSE_SRC)/Makefile:
12f08c3bdfSopenharmony_ciifeq ($(SPARSE_SRC),sparse-src)
13f08c3bdfSopenharmony_ci	git submodule update --init
14f08c3bdfSopenharmony_cielse
15f08c3bdfSopenharmony_ci	$(error "Can't find $(SPARSE_SRC)/Makefile")
16f08c3bdfSopenharmony_ciendif
17f08c3bdfSopenharmony_ci
18f08c3bdfSopenharmony_ci$(SPARSE_SRC)/libsparse.a: $(SPARSE_SRC)/Makefile
19f08c3bdfSopenharmony_ci	$(MAKE) -C $(SPARSE_SRC) libsparse.a
20f08c3bdfSopenharmony_ci
21f08c3bdfSopenharmony_ciHOST_MAKE_TARGETS	:= sparse-ltp
22f08c3bdfSopenharmony_ciMAKE_DEPS		+= $(SPARSE_SRC)/libsparse.a
23f08c3bdfSopenharmony_ciHOST_CFLAGS		+= -I$(SPARSE_SRC) -Werror -Wno-null-pointer-subtraction
24f08c3bdfSopenharmony_ciHOST_LDLIBS		+= $(SPARSE_SRC)/libsparse.a
25f08c3bdfSopenharmony_ci
26f08c3bdfSopenharmony_ci
27f08c3bdfSopenharmony_ciinclude $(top_srcdir)/include/mk/generic_leaf_target.mk
28