RaspberrPi project source code
guowenxue
2024-05-27 2c971f2fcf6c6322a0ea584b2af4c3cef20d3d63
commit | author | age
d6b4a7 1 #********************************************************************************
G 2 #      Copyright:  (C) 2023 LingYun IoT System Studio
3 #                  All rights reserved.
4 #
5 #       Filename:  Makefile
6 #    Description:  This file used compile all the source code to static library
7 #
8 #        Version:  1.0.0(11/08/23)
9 #         Author:  Guo Wenxue <guowenxue@gmail.com>
10 #      ChangeLog:  1, Release initial version on "11/08/23 16:18:43"
11 #
12 #*******************************************************************************
13
14 PWD=$(shell pwd )
15
16 BUILD_ARCH=$(shell uname -m)
17 ifneq ($(findstring $(BUILD_ARCH), "x86_64" "i386"),)
18     CROSS_COMPILE?=arm-linux-gnueabihf-
19 endif
20
2c971f 21 #CROSS_COMPILE=
G 22
d6b4a7 23 LIBNAME=$(shell basename ${PWD} )
G 24 TOPDIR=$(shell dirname ${PWD} )
25 CFLAGS+=-D_GNU_SOURCE
26
27 all: clean
28     @rm -f *.o
29     @${CROSS_COMPILE}gcc ${CFLAGS} -I${TOPDIR} -c *.c
30     ${CROSS_COMPILE}ar -rcs  lib${LIBNAME}.a *.o
31
32 clean:
33     @rm -f *.o
34     @rm -f *.a
35
36 distclean:
37     @make clean