LingYun Studio embeded system framwork software, such as thirdparty build shell and lingyun library
guowenxue
2024-08-21 d48b80fc277cb123738461b6125a58ffe9923019
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
#*********************************************************************************
#      Copyright:  (C) 2022 Avnet. All rights reserved.
#         Author:  Guo Wenxue<wenxue.guo@avnet.com>
#
#       Filename:  Makefile
#    Description:  This Makefile used to compile all the C source code file in
#                  current folder to a excutable binary file.
#
#********************************************************************************/
 
PRJ_PATH=$(shell pwd)
APP_NAME = drm_test
 
CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf-
 
# C source files in top-level directory
SRCFILES = $(wildcard *.c)
 
# common CFLAGS for our source code
CFLAGS = -Wall -Wshadow -Wundef -Wmaybe-uninitialized
 
# CFLAGS and LDFLAGS for opensource library in libs
CFLAGS+=-I ${PRJ_PATH}
CFLAGS+=-I ${PRJ_PATH}/libs/install/include/
CFLAGS+=-I ${PRJ_PATH}/libs/install/include/libdrm
LDFLAGS+=-L ${PRJ_PATH}/libs/install/lib
LDFLAGS+=-L ${PRJ_PATH}/libs/install/lib
 
LIBS+=-ldrm
 
.PHONY:libs
all: libs binary
 
libs:
    cd libs && ./build.sh ${CROSS_COMPILE}
 
modules:
    @set -e; for d in ${DIRS}; do $(MAKE) CROSS_COMPILE=${CROSS_COMPILE} CFLAGS="${CFLAGS}" -C $${d}; done
 
binary:  ${SRCFILES}
    $(CROSS_COMPILE)gcc $(CFLAGS) -o ${APP_NAME} $^ ${LDFLAGS} ${LIBS}
    @echo " Compile over"
 
#set -e; for d in ${DIRS}; do $(MAKE) clean -C $${d}; done
clean:
    @rm -f *.o $(APP_NAME)
 
distclean: clean
    @rm -rf cscope* tags
    @cd libs && ./build.sh distclean