
INSTALLDIR = /usr/sbin
MODULE_PATH=IEC10X
APP_PATH=main

CC = arm-openwrt-linux-gcc

C_FLAGS += -Wall -O0 -g
CFLAGS +=-I$(MODULE_PATH) -I./include -I./include/mqtt -I$(STAGING_DIR)/usr/include/dy_utils -lpthread
CFLAGS +=-I$(APP_PATH) -L /home/lwj/openwrt_work/openwrt_lora/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.16_eabi/usr/lib/ -L /home/lwj/openwrt_work/openwrt_lora/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.16_eabi/lib/

OBJ=dy_huayun
dir=$(MODULE_PATH) $(APP_PATH) module
SOURCES=$(subst ./, , $(foreach dir,$(dir),$(wildcard $(dir)/*.c)) ) 

LDFLAGS := -ldyutils -luci -lubox -lpthread  -lrt -lipc_helper -lmosquitto

all:
	$(CC) $(C_FLAGS) $(CFLAGS) $(SOURCES) \
	-o $(OBJ) -lpthread  $(LDFLAGS)

install:
	cp -rf ./$(OBJ) $(INSTALLDIR)

clean:
	rm -rf $(OBJ)
	

