From 4e19749f95f47cb329d408559b458c4ba9f9653a Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Fri, 27 Sep 2024 14:33:10 +0800 Subject: [PATCH] update booster makefile --- booster/makefile | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/booster/makefile b/booster/makefile index 0fd869e..3c592b3 100644 --- a/booster/makefile +++ b/booster/makefile @@ -13,25 +13,29 @@ PWD=$(shell pwd ) -BUILD_ARCH=$(shell uname -m) -ifneq ($(findstring $(BUILD_ARCH), "x86_64" "i386"),) - CROSS_COMPILE?=arm-linux-gnueabihf- +ARCH?=x86 + +ifeq ($(ARCH), arm) + CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf- +else ifeq ($(ARCH), arm64) + CROSS_COMPILE=/opt/gcc-aarch64-10.3-2021.07/bin/aarch64-none-linux-gnu- endif -#CROSS_COMPILE= - LIBNAME=$(shell basename ${PWD} ) -TOPDIR=$(shell dirname ${PWD} ) -CFLAGS+=-D_GNU_SOURCE all: clean @rm -f *.o - @${CROSS_COMPILE}gcc ${CFLAGS} -I${TOPDIR} -c *.c + @${CROSS_COMPILE}gcc ${CFLAGS} -c *.c ${CROSS_COMPILE}ar -rcs lib${LIBNAME}.a *.o clean: - @rm -f *.o - @rm -f *.a + @rm -f *.o *.a + +test: + make -C testcase CROSS_COMPILE=${CROSS_COMPILE} distclean: @make clean + @make clean -C testcase + +.PHONY: clean test distclean -- Gitblit v1.9.1