xref: /DragonOS/user/apps/about/Makefile (revision bc6f0a967c8cb1e9379ced184b25a7722fbda2a4)
1*bc6f0a96S裕依ifeq ($(ARCH), x86_64)
2*bc6f0a96S裕依	CROSS_COMPILE=x86_64-linux-musl-
3*bc6f0a96S裕依else ifeq ($(ARCH), riscv64)
4*bc6f0a96S裕依	CROSS_COMPILE=riscv64-linux-musl-
5*bc6f0a96S裕依endif
67285c927Slogin
77a818da8Slogin# 获得当前git提交的sha1,并截取前8位
87a818da8SloginGIT_COMMIT_SHA1=$(shell git log -n 1 | head -n 1 | cut -d ' ' -f 2 | cut -c1-8)
9*bc6f0a96S裕依CC=$(CROSS_COMPILE)gcc
107a818da8Slogin
11e2a59dbdSfslongjin
12*bc6f0a96S裕依all: version_header about.c
13*bc6f0a96S裕依	$(CC) -static -o about about.c
14e2a59dbdSfslongjin
15*bc6f0a96S裕依.PHONY: install clean
16*bc6f0a96S裕依install: all
17*bc6f0a96S裕依	mv about $(DADK_CURRENT_BUILD_DIR)/about.elf
187a818da8Slogin
19*bc6f0a96S裕依clean:
20*bc6f0a96S裕依	rm about *.o
217a818da8Slogin
227a818da8Slogin# 生成版本头文件sys_version.h
237a818da8Sloginversion_header: about.c
247a818da8Slogin	@echo "#define DRAGONOS_GIT_COMMIT_SHA1 \"$(GIT_COMMIT_SHA1)\"" > sys_version.h
25*bc6f0a96S裕依
26*bc6f0a96S裕依fmt:
27