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