Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # kbuild trick to avoid linker error. Can be omitted if a module is built.
  2. obj- := dummy.o
  3. hostprogs-$(CONFIG_SAMPLE_SECCOMP) := bpf-fancy dropper bpf-direct
  4. HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include
  5. HOSTCFLAGS_bpf-fancy.o += -idirafter $(objtree)/include
  6. HOSTCFLAGS_bpf-helper.o += -I$(objtree)/usr/include
  7. HOSTCFLAGS_bpf-helper.o += -idirafter $(objtree)/include
  8. bpf-fancy-objs := bpf-fancy.o bpf-helper.o
  9. HOSTCFLAGS_dropper.o += -I$(objtree)/usr/include
  10. HOSTCFLAGS_dropper.o += -idirafter $(objtree)/include
  11. dropper-objs := dropper.o
  12. HOSTCFLAGS_bpf-direct.o += -I$(objtree)/usr/include
  13. HOSTCFLAGS_bpf-direct.o += -idirafter $(objtree)/include
  14. bpf-direct-objs := bpf-direct.o
  15. # Try to match the kernel target.
  16. ifndef CROSS_COMPILE
  17. ifndef CONFIG_64BIT
  18. # s390 has -m31 flag to build 31 bit binaries
  19. ifndef CONFIG_S390
  20. MFLAG = -m32
  21. else
  22. MFLAG = -m31
  23. endif
  24. HOSTCFLAGS_bpf-direct.o += $(MFLAG)
  25. HOSTCFLAGS_dropper.o += $(MFLAG)
  26. HOSTCFLAGS_bpf-helper.o += $(MFLAG)
  27. HOSTCFLAGS_bpf-fancy.o += $(MFLAG)
  28. HOSTLOADLIBES_bpf-direct += $(MFLAG)
  29. HOSTLOADLIBES_bpf-fancy += $(MFLAG)
  30. HOSTLOADLIBES_dropper += $(MFLAG)
  31. endif
  32. always := $(hostprogs-y)
  33. else
  34. # MIPS system calls are defined based on the -mabi that is passed
  35. # to the toolchain which may or may not be a valid option
  36. # for the host toolchain. So disable tests if target architecture
  37. # is MIPS but the host isn't.
  38. ifndef CONFIG_MIPS
  39. always := $(hostprogs-y)
  40. endif
  41. endif