Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. IWINFO_BACKENDS = $(BACKENDS)
  2. IWINFO_CFLAGS = $(CFLAGS) -std=gnu99 -fstrict-aliasing -Iinclude
  3. IWINFO_LDFLAGS = -luci -lubox
  4. IWINFO_LIB = libiwinfo.so
  5. IWINFO_LIB_LDFLAGS = $(LDFLAGS) -shared
  6. IWINFO_LIB_OBJ = iwinfo_utils.o iwinfo_wext.o iwinfo_wext_scan.o iwinfo_lib.o
  7. IWINFO_LUA = iwinfo.so
  8. IWINFO_LUA_LDFLAGS = $(LDFLAGS) -shared -L. -liwinfo -llua
  9. IWINFO_LUA_OBJ = iwinfo_lua.o
  10. IWINFO_CLI = iwinfo
  11. IWINFO_CLI_LDFLAGS = $(LDFLAGS) -L. -liwinfo
  12. IWINFO_CLI_OBJ = iwinfo_cli.o
  13. ifneq ($(filter wl,$(IWINFO_BACKENDS)),)
  14. IWINFO_CFLAGS += -DUSE_WL
  15. IWINFO_LIB_OBJ += iwinfo_wl.o
  16. endif
  17. ifneq ($(filter madwifi,$(IWINFO_BACKENDS)),)
  18. IWINFO_CFLAGS += -DUSE_MADWIFI
  19. IWINFO_LIB_OBJ += iwinfo_madwifi.o
  20. endif
  21. ifneq ($(filter nl80211,$(IWINFO_BACKENDS)),)
  22. IWINFO_CFLAGS += -DUSE_NL80211
  23. IWINFO_CLI_LDFLAGS += -lnl-tiny
  24. IWINFO_LIB_LDFLAGS += -lnl-tiny
  25. IWINFO_LIB_OBJ += iwinfo_nl80211.o
  26. endif
  27. %.o: %.c
  28. $(CC) $(IWINFO_CFLAGS) $(FPIC) -c -o $@ $<
  29. compile: clean $(IWINFO_LIB_OBJ) $(IWINFO_LUA_OBJ) $(IWINFO_CLI_OBJ)
  30. $(CC) $(IWINFO_LDFLAGS) $(IWINFO_LIB_LDFLAGS) -o $(IWINFO_LIB) $(IWINFO_LIB_OBJ)
  31. $(CC) $(IWINFO_LDFLAGS) $(IWINFO_LUA_LDFLAGS) -o $(IWINFO_LUA) $(IWINFO_LUA_OBJ)
  32. $(CC) $(IWINFO_LDFLAGS) $(IWINFO_CLI_LDFLAGS) -o $(IWINFO_CLI) $(IWINFO_CLI_OBJ)
  33. clean:
  34. rm -f *.o $(IWINFO_LIB) $(IWINFO_LUA) $(IWINFO_CLI)