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