Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. all: libwpadbus.a
  2. clean:
  3. rm -f *~ *.o *.d
  4. rm -f libwpadbus.a
  5. install:
  6. @echo Nothing to be made.
  7. ifndef CC
  8. CC=gcc
  9. endif
  10. ifndef CFLAGS
  11. CFLAGS = -MMD -O2 -Wall -g
  12. endif
  13. PKG_CONFIG ?= pkg-config
  14. CFLAGS += -I../../src -I../../src/utils
  15. Q=@
  16. E=echo
  17. ifeq ($(V), 1)
  18. Q=
  19. E=true
  20. endif
  21. %.o: %.c
  22. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  23. @$(E) " CC " $<
  24. ifdef CONFIG_WPS
  25. CFLAGS += -DCONFIG_WPS
  26. endif
  27. CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  28. CFLAGS += -DCONFIG_CTRL_IFACE_DBUS
  29. ifndef DBUS_LIBS
  30. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  31. endif
  32. ifndef DBUS_INCLUDE
  33. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  34. endif
  35. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  36. CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  37. DBUS_INCLUDE += $(shell xml2-config --cflags)
  38. DBUS_LIBS += $(shell xml2-config --libs)
  39. endif
  40. dbus_version=$(subst ., ,$(shell $(PKG_CONFIG) --modversion dbus-1))
  41. DBUS_VERSION_MAJOR=$(word 1,$(dbus_version))
  42. DBUS_VERSION_MINOR=$(word 2,$(dbus_version))
  43. ifeq ($(DBUS_VERSION_MAJOR),)
  44. DBUS_VERSION_MAJOR=0
  45. endif
  46. ifeq ($(DBUS_VERSION_MINOR),)
  47. DBUS_VERSION_MINOR=0
  48. endif
  49. DBUS_INCLUDE += -DDBUS_VERSION_MAJOR=$(DBUS_VERSION_MAJOR)
  50. DBUS_INCLUDE += -DDBUS_VERSION_MINOR=$(DBUS_VERSION_MINOR)
  51. CFLAGS += $(DBUS_INCLUDE)
  52. LIB_OBJS= \
  53. dbus_common.o \
  54. dbus_old.o \
  55. dbus_old_handlers.o \
  56. dbus_new.o \
  57. dbus_new_handlers.o \
  58. dbus_new_helpers.o \
  59. dbus_new_introspect.o \
  60. dbus_dict_helpers.o
  61. ifdef CONFIG_WPS
  62. LIB_OBJS += dbus_old_handlers_wps.o
  63. LIB_OBJS += dbus_new_handlers_wps.o
  64. endif
  65. libwpadbus.a: $(LIB_OBJS)
  66. $(AR) crT $@ $?
  67. -include $(OBJS:%.o=%.d)