1*3c82aa56SChiichenCC=$(DragonOS_GCC)/x86_64-elf-gcc 2*3c82aa56SChiichenLD=ld 3*3c82aa56SChiichenOBJCOPY=objcopy 4*3c82aa56SChiichen# 修改这里,把它改为你的relibc的sysroot路径 5*3c82aa56SChiichenRELIBC_OPT=$(DADK_BUILD_CACHE_DIR_RELIBC_0_1_0) 6*3c82aa56SChiichenCFLAGS=-I $(RELIBC_OPT)/include -D__dragonos__ 7*3c82aa56SChiichen 8*3c82aa56SChiichentmp_output_dir=$(ROOT_PATH)/bin/tmp/user 9*3c82aa56SChiichenoutput_dir=$(DADK_BUILD_CACHE_DIR_TEST_SIGNAL_0_1_0) 10*3c82aa56SChiichen 11*3c82aa56SChiichen 12*3c82aa56SChiichenLIBC_OBJS:=$(shell find $(RELIBC_OPT)/lib -name "*.o" | sort ) 13*3c82aa56SChiichenLIBC_OBJS+=$(RELIBC_OPT)/lib/libc.a 147285c927Slogin 151a2eaa40Sloginall: main.o 161a2eaa40Slogin 17*3c82aa56SChiichen $(LD) -b elf64-x86-64 -z muldefs -o $(tmp_output_dir)/test_signal $(shell find . -name "*.o") $(LIBC_OBJS) -T link.lds 181a2eaa40Slogin 195ed4cd46Sguanjinquan $(OBJCOPY) -I elf64-x86-64 -R ".eh_frame" -R ".comment" -O elf64-x86-64 $(tmp_output_dir)/test_signal $(output_dir)/test_signal.elf 20*3c82aa56SChiichen mv $(output_dir)/test_signal.elf $(output_dir)/test_signal 211a2eaa40Sloginmain.o: main.c 221a2eaa40Slogin $(CC) $(CFLAGS) -c main.c -o main.o 23*3c82aa56SChiichen 24*3c82aa56SChiichenclean: 25*3c82aa56SChiichen rm -f *.o