From c13c9806f957ebc675462737f4b328d3ab89e028 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Mon, 10 Jul 2023 17:29:22 +0800
Subject: [PATCH] update gpsd.c

---
 gpsd/makefile |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/gpsd/makefile b/gpsd/makefile
new file mode 100644
index 0000000..2a4a0f4
--- /dev/null
+++ b/gpsd/makefile
@@ -0,0 +1,57 @@
+#*********************************************************************************
+#      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 = gpsd
+INST_PATH= /tftp
+
+BUILD_ARCH=$(shell uname -m)
+
+ifneq ($(findstring $(BUILD_ARCH), "x86_64" "i386"),)
+	CROSSTOOL=arm-linux-gnueabi-
+endif
+
+# C source files in top-level directory
+SRCFILES = $(wildcard *.c)
+
+# common CFLAGS for our source code
+CFLAGS = -Wall -Wshadow -Wundef -Wmaybe-uninitialized -D_GNU_SOURCE
+
+# C source file in sub-directory
+DIRS= booster
+DIRS_PATH=$(patsubst %,${PRJ_PATH}/%,$(DIRS))
+CFLAGS+=$(patsubst %,-I%,$(DIRS_PATH))
+LDFLAGS+=$(patsubst %,-L%,$(DIRS_PATH))
+LIBS=$(patsubst %,-l%,$(DIRS))
+
+LDFLAGS+=-lpthread
+
+.PHONY:libs
+all: entry modules binary
+
+entry:
+	@echo "Building ${APP_NAME} on ${BUILD_ARCH}"
+
+modules:
+	@set -e; for d in ${DIRS}; do $(MAKE) CROSSTOOL=${CROSSTOOL} CFLAGS="${CFLAGS}" -C $${d}; done
+
+binary:  ${SRCFILES}
+	$(CROSSTOOL)gcc $(CFLAGS) -o ${APP_NAME} $^ ${LDFLAGS} ${LIBS}
+	@echo " Compile over"
+
+clean:
+	set -e; for d in ${DIRS}; do $(MAKE) clean -C $${d}; done
+	@rm -f *.o $(APP_NAME)
+
+distclean: clean
+	@rm -rf cscope* tags
+
+install:
+	cp ${APP_NAME} ${INST_PATH}

--
Gitblit v1.9.1