# SPDX-License-Identifier: GPL-2.0-only
#
# Makefile for the RBA LSM
#

obj-$(CONFIG_SECURITY_RBA) := rba.o

rba-y := rba_lsm.o

rba-$(CONFIG_SECURITY_RBA_KIC) += kic/kic.o

rba-$(CONFIG_SECURITY_RBA_MLS) += mls/mls.o

rba-$(CONFIG_SECURITY_RBA_ROLE) += role/role.o

ccflags-y := -I$(srctree)/security/rba

genhdrs := flask.h av_permissions.h

# see the note above, replace the dependency rule with the one below:
#  $(addprefix $(obj)/,$(rba-y)): $(addprefix $(obj)/,$(genhdrs))
$(addprefix $(obj)/,$(rba-y)): $(obj)/flask.h

quiet_cmd_genhdrs = GEN     $(addprefix $(obj)/,$(genhdrs))
      cmd_genhdrs = $< $(addprefix $(obj)/,$(genhdrs))

# see the note above, replace the $targets and 'flask.h' rule with the lines
# below:
#  targets += $(genhdrs)
#  $(addprefix $(obj)/,$(genhdrs)) &: scripts/rba/...
targets += flask.h
$(obj)/flask.h: scripts/rba/genheaders/genheaders FORCE
	$(call if_changed,genhdrs)
