blob: 0e349b80686e76a421759b931ec04d194e446768 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Olof Johanssonf6041c12016-07-05 23:53:19 -07002hostprogs-$(CONFIG_SAMPLE_SECCOMP) := bpf-fancy dropper bpf-direct
Will Drewry8ac270d2012-04-12 16:48:04 -05003
4HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include
5HOSTCFLAGS_bpf-fancy.o += -idirafter $(objtree)/include
6HOSTCFLAGS_bpf-helper.o += -I$(objtree)/usr/include
7HOSTCFLAGS_bpf-helper.o += -idirafter $(objtree)/include
Will Drewry561381a2012-04-18 19:50:25 -05008bpf-fancy-objs := bpf-fancy.o bpf-helper.o
Will Drewry8ac270d2012-04-12 16:48:04 -05009
10HOSTCFLAGS_dropper.o += -I$(objtree)/usr/include
11HOSTCFLAGS_dropper.o += -idirafter $(objtree)/include
12dropper-objs := dropper.o
13
Will Drewry8ac270d2012-04-12 16:48:04 -050014HOSTCFLAGS_bpf-direct.o += -I$(objtree)/usr/include
15HOSTCFLAGS_bpf-direct.o += -idirafter $(objtree)/include
Will Drewry561381a2012-04-18 19:50:25 -050016bpf-direct-objs := bpf-direct.o
Will Drewry8ac270d2012-04-12 16:48:04 -050017
18# Try to match the kernel target.
Arnd Bergmann275aaa62013-02-04 14:28:52 -080019ifndef CROSS_COMPILE
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 -070038else
39# MIPS system calls are defined based on the -mabi that is passed
40# to the toolchain which may or may not be a valid option
41# for the host toolchain. So disable tests if target architecture
42# is MIPS but the host isn't.
43ifndef CONFIG_MIPS
Ricky Zhou0af04ba2016-10-13 10:29:14 -070044always := $(hostprogs-m)
Markos Chandrase9107f82014-04-03 14:48:32 -070045endif
46endif