# /*****************************************************************************
#* Ȩ (C)2015, ͨѶɷ޹˾
#* 
#* ļ:     Makefile
#* ļʶ:     Makefile
#* ժҪ:     Makefile of ZTE applications
#* ʹ÷:     void
#* 
#* ޸        汾      ޸ı        ޸          ޸
#* -----------------------------------------------------------------------------
#* 2017/02/16      V1.0        Create          ax          
#* 
# ******************************************************************************/

#*******************************************************************************
# include ZTE application makefile
#*******************************************************************************
include $(zte_app_mak)

WORKPATH = $(zte_lib_path)

#*******************************************************************************
# execute
#*******************************************************************************
EXEC  = zte_audio_ctrl
SRCS = $(wildcard *.c)
OBJS = $(patsubst %.c,%.o, $(SRCS))


#*******************************************************************************
# include path
#*******************************************************************************                
INCLUE_PATH = -I. 
CFLAGS += -I$(zte_app_path)/include

CFLAGS += -Wextra -Wall $(INCLUE_PATH)
CFLAGS += -I$(zte_lib_path)/libnvram
CFLAGS += -g
CFLAGS += -g -Werror=implicit-function-declaration
#*******************************************************************************
# macro definition
#*******************************************************************************


#*******************************************************************************
# library
#*******************************************************************************
LDLIBS += -lpthread -lm -lrt -lnvram

LDLIBS += -latutils
LDLIBS += -lsoftap
LDLIBS += -lsoft_timer
#*******************************************************************************
# library path
#*******************************************************************************
LDLIBS += -L$(zte_lib_path)/libnvram
LDLIBS += -L$(zte_lib_path)/libsoftap
LDLIBS += -L$(zte_lib_path)/libatutils
LDLIBS += -L$(zte_lib_path)/libsoft_timer
#*******************************************************************************
# targets
#*******************************************************************************
all: $(EXEC)

$(EXEC): $(OBJS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LDLIBS) -Wl,--end-group

romfs:
	cp $(EXEC) $(EXEC).elf
	$(ROMFSINST)  /bin/$(EXEC)

	
clean:
	-rm -f $(EXEC) $(OBJS) *.elf *.gdb *.o
