Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. ALL=wlantest wlantest_cli test_vectors
  2. all: $(ALL)
  3. ifndef CC
  4. CC=gcc
  5. endif
  6. ifndef RANLIB
  7. RANLIB=ranlib
  8. endif
  9. ifndef CFLAGS
  10. CFLAGS = -MMD -O2 -Wall -g
  11. endif
  12. CFLAGS += -I.
  13. CFLAGS += -I../src
  14. CFLAGS += -I../src/utils
  15. # glibc < 2.17 needs -lrt for clock_gettime()
  16. LIBS += -lrt
  17. ifndef LDO
  18. LDO=$(CC)
  19. endif
  20. Q=@
  21. E=echo
  22. ifeq ($(V), 1)
  23. Q=
  24. E=true
  25. endif
  26. ifeq ($(QUIET), 1)
  27. Q=@
  28. E=true
  29. endif
  30. %.o: %.c
  31. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  32. @$(E) " CC " $<
  33. OBJS_lib += ../src/utils/libutils.a
  34. OBJS_lib += ../src/crypto/libcrypto.a
  35. CFLAGS += -DCONFIG_PEERKEY
  36. CFLAGS += -DCONFIG_IEEE80211W
  37. CFLAGS += -DCONFIG_IEEE80211R
  38. CFLAGS += -DCONFIG_HS20
  39. CFLAGS += -DCONFIG_DEBUG_FILE
  40. CFLAGS += -DCONFIG_FILS
  41. OBJS += ../src/common/ieee802_11_common.o
  42. OBJS += ../src/common/wpa_common.o
  43. OBJS += ../src/radius/radius.o
  44. OBJS += ../src/rsn_supp/wpa_ie.o
  45. OBJS += wlantest.o
  46. OBJS += readpcap.o
  47. OBJS += writepcap.o
  48. OBJS += monitor.o
  49. OBJS += process.o
  50. OBJS += wired.o
  51. OBJS += rx_mgmt.o
  52. OBJS += rx_data.o
  53. OBJS += rx_eapol.o
  54. OBJS += rx_ip.o
  55. OBJS += rx_tdls.o
  56. OBJS += bss.o
  57. OBJS += sta.o
  58. OBJS += ccmp.o
  59. OBJS += tkip.o
  60. OBJS += ctrl.o
  61. OBJS += inject.o
  62. OBJS += wep.o
  63. OBJS += bip.o
  64. OBJS += gcmp.o
  65. LIBS += -lpcap
  66. TOBJS += test_vectors.o
  67. TOBJS += ccmp.o
  68. TOBJS += tkip.o
  69. TOBJS += wep.o
  70. TOBJS += bip.o
  71. TOBJS += gcmp.o
  72. ../src/utils/libutils.a:
  73. $(MAKE) -C ../src/utils
  74. ../src/crypto/libcrypto.a:
  75. $(MAKE) -C ../src/crypto
  76. ifneq ($(CONFIG_SOLIB), yes)
  77. LIBWLANTEST = libwlantest.a
  78. libwlantest.a: $(OBJS_lib)
  79. $(AR) crT libwlantest.a $(OBJS_lib)
  80. $(RANLIB) libwlantest.a
  81. else
  82. CFLAGS += -fPIC -DPIC
  83. LDFLAGS += -shared
  84. LIBWLANTEST = libwlantest.so
  85. libwlantest.so: $(OBJS_lib)
  86. $(LDO) $(LDFLAGS) $(OBJS_lib) -o $(LIBWLANTEST)
  87. endif
  88. OBJS_cli = wlantest_cli.o
  89. wlantest: $(OBJS) $(LIBWLANTEST)
  90. $(LDO) $(LDFLAGS) -o wlantest $(OBJS) -L. -lwlantest $(LIBS)
  91. wlantest_cli: $(OBJS_cli) $(LIBWLANTEST)
  92. $(LDO) $(LDFLAGS) -o wlantest_cli $(OBJS_cli) -L. -lwlantest $(LIBS)
  93. test_vectors: $(TOBJS) $(LIBWLANTEST)
  94. $(LDO) $(LDFLAGS) -o test_vectors $(TOBJS) -L. -lwlantest $(LIBS)
  95. clean:
  96. $(MAKE) -C ../src clean
  97. rm -f core *~ *.o *.d libwlantest.a libwlantest.so $(ALL)
  98. -include $(OBJS:%.o=%.d)