RaspberrPi project source code
Guo Wenxue
6 days ago f7889e2ceddbc3e15ea4b5377d831f4432169f76
commit | author | age
13d8a8 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
21 LIBNAME=$(shell basename ${PWD} )
22 TOPDIR=$(shell dirname ${PWD} )
23 CFLAGS+=-D_GNU_SOURCE
24
25 all: clean
26     @rm -f *.o
27     @${CROSS_COMPILE}gcc ${CFLAGS} -I${TOPDIR} -c *.c
28     ${CROSS_COMPILE}ar -rcs  lib${LIBNAME}.a *.o
29
30 clean:
31     @rm -f *.o
32     @rm -f *.a
33
34 distclean:
35     @make clean