include $(TOPDIR)/rules.mk

TARGET=ble

CFLAGS += -g

SOURCES=$(wildcard *.c)

CFLAGS += -I$(STAGING_DIR)/usr/include -Ibluez-5.50 -DVERSION=5.50 \
	-I$(STAGING_DIR)/usr/include/glib-2.0 -I$(STAGING_DIR)/usr/include/dbus-1.0 \
	-I$(STAGING_DIR)/usr/lib/dbus-1.0/include

LDFLAGS += -L$(STAGING_DIR)/usr/lib/bluez -ldyutils -luci -lubox -lpthread -lbluetooth -lgthread-2.0 \
	-lglib-2.0 -lgio-2.0 -lgobject-2.0 -ldbus-1 -lgdbus-internal -lbluetooth-internal -lshared-glib \
	-lreadline

# SOURCES=supervisor.c scanner.c gatt-server.c

all: $(TARGET)

$(TARGET):
	$(CC) $(CFLAGS) -o $(TARGET) $(SOURCES) $(LDFLAGS)

clean:
	find . -name '*.o' -type f -print -exec rm -rf {} \;
	find . -name '*.a' -type f -print -exec rm -rf {} \;
	rm -f $(TARGET)
