blob: 3a6429600ca28307f4aa3137d3842e27dceba72e [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001# /*****************************************************************************
2#* °æÈ¨ËùÓÐ (C)2015, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
3#*
4#* ÎļþÃû³Æ: Makefile
5#* Îļþ±êʶ: Makefile
6#* ÄÚÈÝÕªÒª: Makefile of ZTE applications
7#* ʹÓ÷½·¨: void
8#*
9#* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
10#* -----------------------------------------------------------------------------
11#* 2015/03/12 V1.0 Create ²ÜÈü ´´½¨
12#*
13# ******************************************************************************/
14
15#*******************************************************************************
16# include ZTE application makefile
17#*******************************************************************************
18.EXPORT_ALL_VARIABLES:
19ifeq ($(LINUX_TYPE),uClinux)
20include $(COMMON_MK)
21endif
22#include ../net_team.mk
23#*******************************************************************************
24# execute
25#*******************************************************************************
26EXEC = zping
27
28#*******************************************************************************
29# objects
30#*******************************************************************************
31OBJSRC = $(filter-out zping.c,$(wildcard *.c))
32OBJS = $(patsubst %.c,%.o,$(OBJSRC))
33
34#*******************************************************************************
35# include path
36#*******************************************************************************
37ifeq ($(LINUX_TYPE),uClinux)
38CFLAGS += -I../include -I$(zte_lib_path)/libnl_2/libnl-2.0/include -lnl -lm -L$(zte_lib_path)/libnl_2/libnl-2.0/lib/.libs
39CFLAGS += -Wl,--allow-multiple-definition,-elf2flt=-s131072
40else
41#CFLAGS += -I../include -I$(ROOT_PATH)/lib/zte_libs/libnl_2/libnl-2.0/include -lnl -lm -L$(ROOT_PATH)/lib/zte_libs/libnl_2/libnl-2.0/lib/.libs
42CFLAGS += -I../include -I$(zte_lib_path)/libnl_2/libnl-2.0/include -lnl -lm -L$(zte_lib_path)/libnl_2/libnl-2.0/lib/.libs
43endif
44
45CFLAGS += -g
46CFLAGS += -I../include
47CFLAGS += -g -Werror=implicit-function-declaration
48#*******************************************************************************
49# macro definition
50#*******************************************************************************
51ifeq ($(CUSTOM_MODEL), MF29S2)
52CFLAGS += -DCUSTOM_VERSION_MF29S2_ZTE
53endif
54#CPPFLAGS += -D_MBB_OS_UCLINUX
55#*******************************************************************************
56# library
57#*******************************************************************************
58
59LDLIBS += -lsoft_timer_sc
60LDLIBS += -lsoftap
61LDLIBS += -lpthread -lnl -lm -lnvram_sc
62LDLIBS += -L$(zte_lib_path)/libnvram
63LDLIBS += -L$(zte_lib_path)/libsoft_timer
64LDLIBS += -L$(zte_lib_path)/libsoftap
65CFLAGS += -I$(zte_lib_path)/libnvram
66ifeq ($(LINUX_TYPE),uClinux)
67LDFLAGS += -L$(zte_lib_path)/libnl_2/libnl-2.0/lib/.libs -Wl,--allow-multiple-definition
68else
69#LDFLAGS += -L$(ROOT_PATH)/lib/zte_libs/libnl_2/libnl-2.0/lib/.libs
70LDFLAGS += -L$(zte_lib_path)/libnl_2/libnl-2.0/lib/.libs
71endif
72
73#*******************************************************************************
74# library path
75#*******************************************************************************
76
77#*******************************************************************************
78# targets
79#*******************************************************************************
80all: $(EXEC)
81
82$(EXEC): $(OBJS)
83 $(CC) $(CFLAGS) -o $@ $(EXEC).c $(OBJS) -Wl,--start-group $(LDLIBS) -Wl,--end-group $(LDFLAGS)
84
85$(OBJS):%.o:%.c
86 $(CC) $(CFLAGS) -c $<
87
88romfs root_fs:
89 #$(ROMFSINST) /bin/$(EXEC)
90 cp -v zping ../test_tools/
91
92clean:
93 -rm -f $(EXEC) *.elf *.gdb *.o
94