lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | # /***************************************************************************** |
| 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: |
| 19 | ifeq ($(LINUX_TYPE),uClinux) |
| 20 | include $(COMMON_MK) |
| 21 | endif |
| 22 | #include ../net_team.mk |
| 23 | #******************************************************************************* |
| 24 | # execute |
| 25 | #******************************************************************************* |
| 26 | EXEC = zping |
| 27 | |
| 28 | #******************************************************************************* |
| 29 | # objects |
| 30 | #******************************************************************************* |
| 31 | OBJSRC = $(filter-out zping.c,$(wildcard *.c)) |
| 32 | OBJS = $(patsubst %.c,%.o,$(OBJSRC)) |
| 33 | |
| 34 | #******************************************************************************* |
| 35 | # include path |
| 36 | #******************************************************************************* |
| 37 | ifeq ($(LINUX_TYPE),uClinux) |
| 38 | CFLAGS += -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 |
| 39 | CFLAGS += -Wl,--allow-multiple-definition,-elf2flt=-s131072 |
| 40 | else |
| 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 |
| 42 | CFLAGS += -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 |
| 43 | endif |
| 44 | |
| 45 | CFLAGS += -g |
| 46 | CFLAGS += -I../include |
| 47 | CFLAGS += -g -Werror=implicit-function-declaration |
| 48 | #******************************************************************************* |
| 49 | # macro definition |
| 50 | #******************************************************************************* |
| 51 | ifeq ($(CUSTOM_MODEL), MF29S2) |
| 52 | CFLAGS += -DCUSTOM_VERSION_MF29S2_ZTE |
| 53 | endif |
| 54 | #CPPFLAGS += -D_MBB_OS_UCLINUX |
| 55 | #******************************************************************************* |
| 56 | # library |
| 57 | #******************************************************************************* |
| 58 | |
| 59 | LDLIBS += -lsoft_timer_sc |
| 60 | LDLIBS += -lsoftap |
| 61 | LDLIBS += -lpthread -lnl -lm -lnvram_sc |
| 62 | LDLIBS += -L$(zte_lib_path)/libnvram |
| 63 | LDLIBS += -L$(zte_lib_path)/libsoft_timer |
| 64 | LDLIBS += -L$(zte_lib_path)/libsoftap |
| 65 | CFLAGS += -I$(zte_lib_path)/libnvram |
| 66 | ifeq ($(LINUX_TYPE),uClinux) |
| 67 | LDFLAGS += -L$(zte_lib_path)/libnl_2/libnl-2.0/lib/.libs -Wl,--allow-multiple-definition |
| 68 | else |
| 69 | #LDFLAGS += -L$(ROOT_PATH)/lib/zte_libs/libnl_2/libnl-2.0/lib/.libs |
| 70 | LDFLAGS += -L$(zte_lib_path)/libnl_2/libnl-2.0/lib/.libs |
| 71 | endif |
| 72 | |
| 73 | #******************************************************************************* |
| 74 | # library path |
| 75 | #******************************************************************************* |
| 76 | |
| 77 | #******************************************************************************* |
| 78 | # targets |
| 79 | #******************************************************************************* |
| 80 | all: $(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 | |
| 88 | romfs root_fs: |
| 89 | #$(ROMFSINST) /bin/$(EXEC) |
| 90 | cp -v zping ../test_tools/ |
| 91 | |
| 92 | clean: |
| 93 | -rm -f $(EXEC) *.elf *.gdb *.o |
| 94 | |