include $(TOPDIR)/rules.mk

TARGET=tm1640-gpio

ifdef WITH_DEBUG
  CFLAGS += -g
else
  CFLAGS += -DNDEBUG -g
endif

ifneq ($(CONFIG_SUPPORT_LED),)
  CFLAGS += -DSUPPORT_LED=1
else
  CFLAGS += -DSUPPORT_LED=0
endif

CFLAGS += -Werror

SOURCES=$(wildcard *.c)
OBJECTS=$(subst .c,.o, $(SOURCES))

CFLAGS += -I$(STAGING_DIR)/usr/include

LDFLAGS += -lrdkafka -latomic -ldyutils -luci -lubox -lpthread -lipc_helper -lmqtt_session -lmosquitto

all: $(TARGET)

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