xref: /DragonOS/user/apps/about/Makefile (revision 7285c927d95bb4b5c692c51a8f86c47009d07667)
1*7285c927SloginOLD_LIBC_INSTALL_PATH=$(ROOT_PATH)/bin/sysroot/usr/old_libc
2*7285c927Slogin
37a818da8Slogin# 获得当前git提交的sha1,并截取前8位
47a818da8SloginGIT_COMMIT_SHA1=$(shell git log -n 1 | head -n 1 | cut -d ' ' -f 2 | cut -c1-8)
57a818da8Slogin
6e2a59dbdSfslongjinall: about.o
7e2a59dbdSfslongjin
8*7285c927Slogin	$(LD) -b elf64-x86-64 -z muldefs -o $(tmp_output_dir)/about  $(shell find . -name "*.o") $(OLD_LIBC_INSTALL_PATH)/lib/libc.a -T about.lds
9e2a59dbdSfslongjin
105ed4cd46Sguanjinquan	$(OBJCOPY) -I elf64-x86-64 -R ".eh_frame" -R ".comment" -O elf64-x86-64 $(tmp_output_dir)/about $(output_dir)/about.elf
117a818da8Slogin
127a818da8Sloginabout.o: version_header about.c
13fbe1e23eSlongjin	$(CC) $(CFLAGS) -c about.c  -o about.o
147a818da8Slogin
157a818da8Slogin# 生成版本头文件sys_version.h
167a818da8Sloginversion_header: about.c
177a818da8Slogin	@echo "#define DRAGONOS_GIT_COMMIT_SHA1 \"$(GIT_COMMIT_SHA1)\"" > sys_version.h
18