Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ALL=wlantest
  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. ifndef LDO
  16. LDO=$(CC)
  17. endif
  18. Q=@
  19. E=echo
  20. ifeq ($(V), 1)
  21. Q=
  22. E=true
  23. endif
  24. %.o: %.c
  25. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  26. @$(E) " CC " $<
  27. OBJS_lib += ../src/utils/libutils.a
  28. OBJS_lib += ../src/crypto/libcrypto.a
  29. CFLAGS += -DCONFIG_PEERKEY
  30. CFLAGS += -DCONFIG_IEEE80211W
  31. CFLAGS += -DCONFIG_IEEE80211R
  32. OBJS += ../src/common/ieee802_11_common.o
  33. OBJS += ../src/common/wpa_common.o
  34. OBJS += ../src/radius/radius.o
  35. OBJS += ../src/rsn_supp/wpa_ie.o
  36. OBJS += wlantest.o
  37. OBJS += readpcap.o
  38. OBJS += monitor.o
  39. OBJS += process.o
  40. OBJS += wired.o
  41. OBJS += rx_mgmt.o
  42. OBJS += rx_data.o
  43. OBJS += bss.o
  44. OBJS += sta.o
  45. OBJS += crc32.o
  46. OBJS += ccmp.o
  47. LIBS += -lpcap
  48. ../src/utils/libutils.a:
  49. $(MAKE) -C ../src/utils
  50. ../src/crypto/libcrypto.a:
  51. $(MAKE) -C ../src/crypto
  52. ifneq ($(CONFIG_SOLIB), yes)
  53. LIBWLANTEST = libwlantest.a
  54. libwlantest.a: $(OBJS_lib)
  55. $(AR) crT libwlantest.a $(OBJS_lib)
  56. $(RANLIB) libwlantest.a
  57. else
  58. CFLAGS += -fPIC -DPIC
  59. LDFLAGS += -shared
  60. LIBWLANTEST = libwlantest.so
  61. libwlantest.so: $(OBJS_lib)
  62. $(LDO) $(LDFLAGS) $(OBJS_lib) -o $(LIBWLANTEST)
  63. endif
  64. wlantest: $(OBJS) $(LIBWLANTEST)
  65. $(LDO) $(LDFLAGS) -o wlantest $(OBJS) -L. -lwlantest $(LIBS)
  66. clean:
  67. $(MAKE) -C ../src clean
  68. rm -f core *~ *.o *.d libwlantest.a libwlantest.so $(ALL)
  69. -include $(OBJS:%.o=%.d)