include $(TOPDIR)/rules.mk

TARGET=pv_pcs

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

CFLAGS += -Werror -fstack-protector-strong -fstack-protector-all

SOURCES=$(wildcard *.c)

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

LDFLAGS += -ldyutils -luci -lubox -lpthread -lipc_helper


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)
