Add build task for make

This commit is contained in:
Aoran Zeng 2025-06-20 08:18:23 +08:00
parent b9e7937526
commit 75c1401776
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98

View File

@ -8,7 +8,7 @@
# | sanchuanhehe <wyihe5520@gmail.com> # | sanchuanhehe <wyihe5520@gmail.com>
# | # |
# Created On : <2023-08-28> # Created On : <2023-08-28>
# Last Modified : <2025-06-19> # Last Modified : <2025-06-20>
# -------------------------------------------------------------- # --------------------------------------------------------------
On-Linux = 0 On-Linux = 0
@ -63,24 +63,25 @@ ifeq ($(MAKECMDGOALS), CI)
endif endif
#======================= #=======================
all: build
all: build:
ifeq ($(STATIC), 1) ifeq ($(STATIC), 1)
CFLAGS += -static CFLAGS += -static
endif endif
all: build:
@echo "Starting: Compile chsrc executable" @echo "Starting: Compile chsrc executable"
@$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(Target-Name) @$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(Target-Name)
@echo Finished: Compile chsrc executable using \'$(CC)\' $(CFLAGS) @echo Finished: Compile chsrc executable using \'$(CC)\' $(CFLAGS)
CI: all CI: build
@mv $(Target-Name) $(CI_ARTIFACT_NAME) @mv $(Target-Name) $(CI_ARTIFACT_NAME)
debug: CFLAGS += -g debug: CFLAGS += -g
debug: Target-Name = $(Debuggable-Target-Name) debug: Target-Name = $(Debuggable-Target-Name)
debug: all debug: build
@$(DEBUGGER) $(Debuggable-Target-Name) @$(DEBUGGER) $(Debuggable-Target-Name)
test: test-make-env test-xy test-fw test: test-make-env test-xy test-fw
@ -140,4 +141,4 @@ install: $(Target-Name)
install -D -m 755 $(Target-Name) $(DESTDIR)/usr/bin/$(Target-Name) install -D -m 755 $(Target-Name) $(DESTDIR)/usr/bin/$(Target-Name)
install -D -m 644 doc/chsrc.1 $(DESTDIR)/usr/share/man/man1/chsrc.1 install -D -m 644 doc/chsrc.1 $(DESTDIR)/usr/share/man/man1/chsrc.1
.PHONY: all CI debug check test test-make-env test-xy test-fw fastcheck test-cli clean install build-deb clean-deb .PHONY: all build CI debug check test test-make-env test-xy test-fw fastcheck test-cli clean install build-deb clean-deb