# SPDX-License-Identifier: GPL-2.0
################################################################################
#
# Driver for Solarflare and Xilinx network controllers and boards
# Copyright 2019 Solarflare Communications Inc.
# Copyright 2019-2020 Xilinx Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published
# by the Free Software Foundation, incorporated herein by reference.
#
################################################################################

ifndef NOWERROR
ifdef BUILD_INKERNEL_TESTS
else
build_selftests :=
endif
else
build_selftests :=
endif # NOWERROR

all modules:
	$(MAKE) -C drivers/base $@
	$(build_selftests)

install modules_install:
	@echo INSTALL_MOD_PATH=$(INSTALL_MOD_PATH)
	@echo INSTALL_MOD_DIR=$(INSTALL_MOD_DIR)
	$(MAKE) -C drivers/base modules_install
	$(build_selftests)
	depmod

export-srpm export:
	$(MAKE) -C drivers/base $@
	$(MAKE) -C include/linux $@
	$(build_selftests)

clean:
	$(MAKE) -C drivers/base $@
	$(RM) -r deb rpm .version
	$(build_selftests)

ifndef NOWERROR
.PHONY: deb

srpm:
	+scripts/makesrpm --$@

deb:
	+scripts/mkdeb

sdeb:
	+scripts/mkdeb -S
endif # NOWERROR
