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
51
52
53
54
55
#********************************************************************************
#      Copyright:  (C) 2023 LingYun IoT System Studio
#                  All rights reserved.
#
#       Filename:  Makefile
#    Description:  This file used to compile all the C file to respective binary,
#                  and it will auto detect cross compile or local compile.
#
#        Version:  1.0.0(11/08/23)
#         Author:  Guo Wenxue <guowenxue@gmail.com>
#      ChangeLog:  1, Release initial version on "11/08/23 16:18:43"
#
#*******************************************************************************
 
PWD=$(shell pwd)
INSTPATH=/tftp
 
CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf-
CC=${CROSS_COMPILE}gcc
 
LDFLAGS += -lm
 
SRCS = $(wildcard ${VPATH}/*.c)
OBJS = $(patsubst %.c,%.o,$(SRCS))
 
SRCFILES = $(wildcard *.c)
BINARIES=$(SRCFILES:%.c=%)
 
# libgpiod compile install path
LIBS_PATH=install
CFLAGS+=-I ${LIBS_PATH}/include
LDFLAGS+=-L ${LIBS_PATH}/lib -lgpiod
 
all: libs binaries install
 
libs:
    make -C libgpiod CROSS_COMPILE=${CROSS_COMPILE}
 
binaries:  ${BINARIES}
 
%:  %.c
    $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
 
install:
    cp $(BINARIES) ${INSTPATH}
 
clean:
    @rm -f *.o *.lo $(BINARIES)
 
distclean: clean
    @rm -f tags cscope*
    @make clean -C libgpiod
    @rm -rf install
 
.PHONY: clean entry