Will Drewry | 8ac270d | 2012-04-12 16:48:04 -0500 | [diff] [blame^] | 1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. |
| 2 | obj- := dummy.o |
| 3 | |
| 4 | hostprogs-$(CONFIG_SECCOMP) := bpf-fancy dropper |
| 5 | bpf-fancy-objs := bpf-fancy.o bpf-helper.o |
| 6 | |
| 7 | HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include |
| 8 | HOSTCFLAGS_bpf-fancy.o += -idirafter $(objtree)/include |
| 9 | HOSTCFLAGS_bpf-helper.o += -I$(objtree)/usr/include |
| 10 | HOSTCFLAGS_bpf-helper.o += -idirafter $(objtree)/include |
| 11 | |
| 12 | HOSTCFLAGS_dropper.o += -I$(objtree)/usr/include |
| 13 | HOSTCFLAGS_dropper.o += -idirafter $(objtree)/include |
| 14 | dropper-objs := dropper.o |
| 15 | |
| 16 | # bpf-direct.c is x86-only. |
| 17 | ifeq ($(SRCARCH),x86) |
| 18 | # List of programs to build |
| 19 | hostprogs-$(CONFIG_SECCOMP) += bpf-direct |
| 20 | bpf-direct-objs := bpf-direct.o |
| 21 | endif |
| 22 | |
| 23 | HOSTCFLAGS_bpf-direct.o += -I$(objtree)/usr/include |
| 24 | HOSTCFLAGS_bpf-direct.o += -idirafter $(objtree)/include |
| 25 | |
| 26 | # Try to match the kernel target. |
| 27 | ifeq ($(CONFIG_64BIT),) |
| 28 | HOSTCFLAGS_bpf-direct.o += -m32 |
| 29 | HOSTCFLAGS_dropper.o += -m32 |
| 30 | HOSTCFLAGS_bpf-helper.o += -m32 |
| 31 | HOSTCFLAGS_bpf-fancy.o += -m32 |
| 32 | HOSTLOADLIBES_bpf-direct += -m32 |
| 33 | HOSTLOADLIBES_bpf-fancy += -m32 |
| 34 | HOSTLOADLIBES_dropper += -m32 |
| 35 | endif |
| 36 | |
| 37 | # Tell kbuild to always build the programs |
| 38 | always := $(hostprogs-y) |