1all: libwpadbus.a
2
3clean:
4	rm -f *~ *.o *.d *.gcno *.gcda *.gcov
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
18PKG_CONFIG ?= pkg-config
19CFLAGS += -I../../src -I../../src/utils
20
21
22Q=@
23E=echo
24ifeq ($(V), 1)
25Q=
26E=true
27endif
28
29%.o: %.c
30	$(Q)$(CC) -c -o $@ $(CFLAGS) $<
31	@$(E) "  CC " $<
32
33
34ifdef CONFIG_WPS
35CFLAGS += -DCONFIG_WPS
36endif
37
38CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
39CFLAGS += -DCONFIG_CTRL_IFACE_DBUS
40
41ifndef DBUS_LIBS
42DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
43endif
44ifndef DBUS_INCLUDE
45DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
46endif
47ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
48CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
49DBUS_INCLUDE += $(shell xml2-config --cflags)
50DBUS_LIBS += $(shell xml2-config --libs)
51endif
52
53CFLAGS += $(DBUS_INCLUDE)
54
55LIB_OBJS= \
56	dbus_common.o \
57	dbus_old.o \
58	dbus_old_handlers.o \
59	dbus_new.o \
60	dbus_new_handlers.o \
61	dbus_new_helpers.o \
62	dbus_new_introspect.o \
63	dbus_dict_helpers.o
64
65ifdef CONFIG_WPS
66LIB_OBJS += dbus_old_handlers_wps.o
67LIB_OBJS += dbus_new_handlers_wps.o
68endif
69
70libwpadbus.a: $(LIB_OBJS)
71	$(AR) crT $@ $?
72
73-include $(OBJS:%.o=%.d)
74