凌云实验室推出的ARM Linux物联网网关开发板IGKBoard(IoT Gateway Kit Board)项目源码
guowenxue
2021-12-13 fce744b0d9a648da5e2765af625c96370492f698
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
70
71
72
73
74
75
#*********************************************************************************
#      Copyright:  (C) 2021 Guo Wenxue <guowenxue@gmail.com>
#                  All rights reserved.
#
#       Filename:  Makefile
#    Description:  This Makefile used to compile all the C source code file in current 
#                  folder to respective excutable binary files.
#                      
#        Version:  1.0.0(11/17/2021~)
#                  Author:  Guo Wenxue <guowenxue@gmail.com>
#      ChangeLog:  1, Release initial version on "11/17/2021 01:29:33 PM"
#                       
#********************************************************************************/
    
PWD=$(shell pwd)
INSTPATH=/tftp
 
CROSS_COMPILE=/opt/buildroot/cortexA7/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
 
LIB_PATH=$(shell dirname ${PWD})
LIB_NAME=$(shell basename ${LIB_PATH})
 
CFLAGS+=-I${LIB_PATH}
 
#LDFLAGS+=-L${LIB_PATH} -l${LIB_NAME}
#LDFLAGS+=-static
 
SRCS = $(wildcard ${VPATH}/*.c)
OBJS = $(patsubst %.c,%.o,$(SRCS))
 
SRCFILES = $(wildcard *.c)
BINARIES=$(SRCFILES:%.c=%)
 
all: entry binaries install
 
libs:
    make -C ..
 
entry: 
    @echo " ";
    @echo " =========================================================";
    @echo " **      Cross  compile \"${BINARIES}\"                   ";
    @echo " =========================================================";
    @make clean
 
binaries:  ${BINARIES} 
    @echo " Compile over"
 
%:  %.c 
    $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
 
tag: 
    @ctags --c-kinds=+defglmnstuvx --langmap=c:.c.h.ho.hem.het.hec.hev.him.hit.hic.hiv -R .  
    @cscope -Rbq
 
install:
    cp $(BINARIES) ${INSTPATH}
 
clean: 
    @rm -f version.h 
    @rm -f *.o *.lo $(BINARIES) 
    @rm -rf *.gdb *.a *.so *.elf*
    @rm -f *.log
 
distclean: clean
    @rm -f  tags cscope*
 
.PHONY: clean entry