guowenxue
2020-08-21 02f4d9518378031c63df7a36c49d8b2eabdaab90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#*********************************************************************************
#      Copyright:  (C) 2012 Guo Wenxue<Email:guowenxue@gmail.com>
#                  All rights reserved.
#
#       Filename:  Makefile
#    Description:  This Makefile used to call function to compile all the C source
#                  in current folder and links all the objects file into a excutable
#                  binary file.
#                      
#        Version:  1.0.0(10/08/2011~)
#                  Author:  Guo Wenxue <guowenxue@gmail.com>
#      ChangeLog:  1, Release initial version on "10/08/2011 01:29:33 AM"
#                       
#********************************************************************************/
 
PWD=$(shell pwd)
INSTPATH=/tftp
 
APP_BINARY_NAME = sp2sck
 
LDFLAGS+=-lpthread
CFLAGS+=-Wall -Werror
 
VPATH= .
SRCS = $(wildcard ${VPATH}/*.c)
OBJS = $(patsubst %.c,%.o,$(SRCS))
 
CFLAGS+=-I${PWD}
 
CROSS_COMPILE=/opt/xtools/arm920t/bin/arm-linux-
export CC=${CROSS_COMPILE}gcc
export CXX=${CROSS_COMPILE}g++
export AR=${CROSS_COMPILE}ar
export AS=${CROSS_COMPILE}as
export RANLIB=${CROSS_COMPILE}ranlib
export STRIP=${CROSS_COMPILE}strip
export CFLAGS
export LDFLAGS
 
 
all: entry $(APP_BINARY_NAME)
    make install
 
entry: 
    @echo " ";
    @echo " =========================================================";
    @echo " **        Compile ${APP_BINARY_NAME} by ${CC}         ";
    @echo " =========================================================";
 
$(APP_BINARY_NAME):    $(OBJS) 
    $(CC)  -o $@ *.c ${LDFLAGS}
    @$(STRIP) $(APP_BINARY_NAME)
 
tag: 
    @ctags --c-kinds=+defglmnstuvx --langmap=c:.c.h.ho.hem.het.hec.hev.him.hit.hic.hiv -R .  
    @cscope -Rbq
 
install:
    @cp $(APP_BINARY_NAME) ${INSTPATH}
 
clean: 
    @rm -f *.o $(APP_BINARY_NAME) 
    @rm -rf *.gdb *.a *.so *.elf*
    @rm -f *.log
 
distclean: clean
    @rm -f  tags cscope*
 
.PHONY: clean entry