Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. CFLAGS += -I../../src -I../../src/utils
  14. Q=@
  15. E=echo
  16. ifeq ($(V), 1)
  17. Q=
  18. E=true
  19. endif
  20. %.o: %.c
  21. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  22. @$(E) " CC " $<
  23. #CFLAGS += -DCONFIG_WPS
  24. CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  25. CFLAGS += -DCONFIG_CTRL_IFACE_DBUS
  26. ifndef DBUS_LIBS
  27. DBUS_LIBS := $(shell pkg-config --libs dbus-1)
  28. endif
  29. ifndef DBUS_INCLUDE
  30. DBUS_INCLUDE := $(shell pkg-config --cflags dbus-1)
  31. endif
  32. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  33. CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  34. DBUS_INCLUDE += $(shell xml2-config --cflags)
  35. DBUS_LIBS += $(shell xml2-config --libs)
  36. endif
  37. dbus_version=$(subst ., ,$(shell pkg-config --modversion dbus-1))
  38. DBUS_VERSION_MAJOR=$(word 1,$(dbus_version))
  39. DBUS_VERSION_MINOR=$(word 2,$(dbus_version))
  40. ifeq ($(DBUS_VERSION_MAJOR),)
  41. DBUS_VERSION_MAJOR=0
  42. endif
  43. ifeq ($(DBUS_VERSION_MINOR),)
  44. DBUS_VERSION_MINOR=0
  45. endif
  46. DBUS_INCLUDE += -DDBUS_VERSION_MAJOR=$(DBUS_VERSION_MAJOR)
  47. DBUS_INCLUDE += -DDBUS_VERSION_MINOR=$(DBUS_VERSION_MINOR)
  48. CFLAGS += $(DBUS_INCLUDE)
  49. LIB_OBJS= \
  50. ctrl_iface_dbus.o \
  51. ctrl_iface_dbus_handlers.o \
  52. ctrl_iface_dbus_new.o \
  53. ctrl_iface_dbus_new_handlers.o \
  54. ctrl_iface_dbus_new_helpers.o \
  55. dbus_dict_helpers.o
  56. libwpadbus.a: $(LIB_OBJS)
  57. $(AR) crT $@ $?
  58. -include $(OBJS:%.o=%.d)