Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1 | all: libwpadbus.a |
| 2 | |
| 3 | clean: |
Dmitry Shmidt | 01904cf | 2013-12-05 11:08:35 -0800 | [diff] [blame] | 4 | rm -f *~ *.o *.d *.gcno *.gcda *.gcov |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 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 | |
Dmitry Shmidt | c55524a | 2011-07-07 11:18:38 -0700 | [diff] [blame] | 18 | PKG_CONFIG ?= pkg-config |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 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 |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 39 | |
| 40 | ifndef DBUS_LIBS |
Dmitry Shmidt | c55524a | 2011-07-07 11:18:38 -0700 | [diff] [blame] | 41 | DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 42 | endif |
| 43 | ifndef DBUS_INCLUDE |
Dmitry Shmidt | c55524a | 2011-07-07 11:18:38 -0700 | [diff] [blame] | 44 | DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 45 | endif |
| 46 | ifdef CONFIG_CTRL_IFACE_DBUS_INTRO |
| 47 | CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO |
| 48 | DBUS_INCLUDE += $(shell xml2-config --cflags) |
| 49 | DBUS_LIBS += $(shell xml2-config --libs) |
| 50 | endif |
| 51 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 52 | CFLAGS += $(DBUS_INCLUDE) |
| 53 | |
| 54 | LIB_OBJS= \ |
| 55 | dbus_common.o \ |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 56 | dbus_new.o \ |
| 57 | dbus_new_handlers.o \ |
| 58 | dbus_new_helpers.o \ |
| 59 | dbus_new_introspect.o \ |
| 60 | dbus_dict_helpers.o |
| 61 | |
| 62 | ifdef CONFIG_WPS |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 63 | LIB_OBJS += dbus_new_handlers_wps.o |
| 64 | endif |
| 65 | |
| 66 | libwpadbus.a: $(LIB_OBJS) |
| 67 | $(AR) crT $@ $? |
| 68 | |
| 69 | -include $(OBJS:%.o=%.d) |