Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. OBJS += ../src/common/ieee802_11_common.o
  30. OBJS += wlantest.o
  31. OBJS += readpcap.o
  32. OBJS += monitor.o
  33. OBJS += process.o
  34. OBJS += bss.o
  35. OBJS += crc32.o
  36. LIBS += -lpcap
  37. ../src/utils/libutils.a:
  38. $(MAKE) -C ../src/utils
  39. ../src/crypto/libcrypto.a:
  40. $(MAKE) -C ../src/crypto
  41. ifneq ($(CONFIG_SOLIB), yes)
  42. LIBWLANTEST = libwlantest.a
  43. libwlantest.a: $(OBJS_lib)
  44. $(AR) crT libwlantest.a $(OBJS_lib)
  45. $(RANLIB) libwlantest.a
  46. else
  47. CFLAGS += -fPIC -DPIC
  48. LDFLAGS += -shared
  49. LIBWLANTEST = libwlantest.so
  50. libwlantest.so: $(OBJS_lib)
  51. $(LDO) $(LDFLAGS) $(OBJS_lib) -o $(LIBWLANTEST)
  52. endif
  53. wlantest: $(OBJS) $(LIBWLANTEST)
  54. $(LDO) $(LDFLAGS) -o wlantest $(OBJS) -L. -lwlantest $(LIBS)
  55. clean:
  56. $(MAKE) -C ../src clean
  57. rm -f core *~ *.o *.d libwlantest.a libwlantest.so $(ALL)
  58. -include $(OBJS:%.o=%.d)