Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. all: libwpadbus.a
  2. clean:
  3. rm -f *~ *.o *.d *.gcno *.gcda *.gcov
  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. CFLAGS += $(DBUS_INCLUDE)
  41. LIB_OBJS= \
  42. dbus_common.o \
  43. dbus_old.o \
  44. dbus_old_handlers.o \
  45. dbus_new.o \
  46. dbus_new_handlers.o \
  47. dbus_new_helpers.o \
  48. dbus_new_introspect.o \
  49. dbus_dict_helpers.o
  50. ifdef CONFIG_WPS
  51. LIB_OBJS += dbus_old_handlers_wps.o
  52. LIB_OBJS += dbus_new_handlers_wps.o
  53. endif
  54. libwpadbus.a: $(LIB_OBJS)
  55. $(AR) crT $@ $?
  56. -include $(OBJS:%.o=%.d)