Makefile bash mk文件

Qual_Arm.mk

ARCH=arm
tool_path =  /compile/名字/code/IPQ807X_ILQ_11-1-CSU1/staging_dir/toolchain-aarch64_cortex-a53_gcc-5.2.0_musl-1.1.16/bin
lib_path = /compile/名字/code/IPQ807X_ILQ_11-1-CSU1/staging_dir/toolchain-aarch64_cortex-a53_gcc-5.2.0_musl-1.1.16/lib
include_path = /compile/名字/code/IPQ807X_ILQ_11-1-CSU1/staging_dir/toolchain-aarch64_cortex-a53_gcc-5.2.0_musl-1.1.16/include
CROSS_COMPILE = $(tool_path)/aarch64-openwrt-linux-musl-
export CROSS_COMPILE
CROSS_LIB = -L$(lib_path)
export CROSS_LIB
CROSS_INCLUDE = -I$(include_path)
export CROSS_INCLUDE
TARGET_CFLAGS =
LD_CFLAGS =
AS    = $(CROSS_COMPILE)as
LD        = $(CROSS_COMPILE)ld $(LD_CFLAGS)
CC        = $(CROSS_COMPILE)gcc $(TARGET_CFLAGS)
CPP        = $(CC) -E
CXX        = $(CROSS_COMPILE)c++ $(TARGET_CFLAGS)
G++        = $(CROSS_COMPILE)g++ $(TARGET_CFLAGS)
AR        = $(CROSS_COMPILE)ar
NM        = $(CROSS_COMPILE)nm
STRIP        = $(CROSS_COMPILE)strip
OBJCOPY        = $(CROSS_COMPILE)objcopy
OBJDUMP        = $(CROSS_COMPILE)objdump
RANLIB = $(CROSS_COMPILE)ranlib
ELF2FLT        = $(CROSS_COMPILE)elf2flt

export AS LD CC CPP CXX AR NM STRIP OBFCOPY OBJDUMP RANLIB ELF2FLT ARCH
include ./Qual_Arm.mk
hello:hello.o
	$(CC) -o hello hello.o
hello.o:hello.c
	$(CC) -c hello.c
clean:
	rm hello.o

  交叉编译hello world

posted on 2022-03-09 21:27  lydstory  阅读(48)  评论(0)    收藏  举报

导航