blob: ba942e3ead890de9f4632d25a5fc1fd000676296 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Michal Hocko6275ecb2018-02-14 10:15:12 +01002ifndef CROSS_COMPILE
Olof Johanssonf6041c12016-07-05 23:53:19 -07003hostprogs-$(CONFIG_SAMPLE_SECCOMP) := bpf-fancy dropper bpf-direct
Will Drewry8ac270d2012-04-12 16:48:04 -05004
5HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include
6HOSTCFLAGS_bpf-fancy.o += -idirafter $(objtree)/include
7HOSTCFLAGS_bpf-helper.o += -I$(objtree)/usr/include
8HOSTCFLAGS_bpf-helper.o += -idirafter $(objtree)/include
Will Drewry561381a2012-04-18 19:50:25 -05009bpf-fancy-objs := bpf-fancy.o bpf-helper.o
Will Drewry8ac270d2012-04-12 16:48:04 -050010
11HOSTCFLAGS_dropper.o += -I$(objtree)/usr/include
12HOSTCFLAGS_dropper.o += -idirafter $(objtree)/include
13dropper-objs := dropper.o
14
Will Drewry8ac270d2012-04-12 16:48:04 -050015HOSTCFLAGS_bpf-direct.o += -I$(objtree)/usr/include
16HOSTCFLAGS_bpf-direct.o += -idirafter $(objtree)/include
Will Drewry561381a2012-04-18 19:50:25 -050017bpf-direct-objs := bpf-direct.o
Will Drewry8ac270d2012-04-12 16:48:04 -050018
19# Try to match the kernel target.
Markos Chandrase9107f82014-04-03 14:48:32 -070020ifndef CONFIG_64BIT
Heiko Carstensb25b09e2012-09-08 10:23:42 +020021
22# s390 has -m31 flag to build 31 bit binaries
23ifndef CONFIG_S390
24MFLAG = -m32
25else
26MFLAG = -m31
27endif
28
29HOSTCFLAGS_bpf-direct.o += $(MFLAG)
30HOSTCFLAGS_dropper.o += $(MFLAG)
31HOSTCFLAGS_bpf-helper.o += $(MFLAG)
32HOSTCFLAGS_bpf-fancy.o += $(MFLAG)
33HOSTLOADLIBES_bpf-direct += $(MFLAG)
34HOSTLOADLIBES_bpf-fancy += $(MFLAG)
35HOSTLOADLIBES_dropper += $(MFLAG)
Will Drewry8ac270d2012-04-12 16:48:04 -050036endif
Ricky Zhou0af04ba2016-10-13 10:29:14 -070037always := $(hostprogs-m)
Markos Chandrase9107f82014-04-03 14:48:32 -070038endif