diff options
author | Runxi Yu <me@runxiyu.org> | 2025-08-17 14:11:33 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-08-17 14:11:33 +0800 |
commit | 0ccb1b33091a54fd101c49bedc90bb0232b6eae3 (patch) | |
tree | 15602ae9530988e382ca0922a5dd14d4de5d80f2 /Makefile | |
parent | Fix incoming's calls to misc.Listen* (diff) | |
download | forge-0ccb1b33091a54fd101c49bedc90bb0232b6eae3.tar.gz forge-0ccb1b33091a54fd101c49bedc90bb0232b6eae3.tar.zst forge-0ccb1b33091a54fd101c49bedc90bb0232b6eae3.zip |
Simplify build process
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 27 |
1 files changed, 12 insertions, 15 deletions
@@ -7,29 +7,26 @@ # some other build system). # -.PHONY: clean +.PHONY: clean all CFLAGS = -Wall -Wextra -pedantic -std=c99 -D_GNU_SOURCE -VERSION = $(shell git describe --tags --always --dirty) SOURCE_FILES = $(shell git ls-files) -EMBED = git2d/git2d hookc/hookc $(wildcard LICENSE*) $(wildcard forged/static/*) $(wildcard forged/templates/*) -EMBED_ = $(EMBED:%=forged/internal/embed/%) -forge: $(EMBED_) $(SOURCE_FILES) - CGO_ENABLED=0 go build -o forge -ldflags '-extldflags "-f no-PIC -static" -X "go.lindenii.runxiyu.org/forge/forged/internal/unsorted.version=$(VERSION)"' -tags 'osusergo netgo static_build' ./forged +all: dist/forged dist/git2d dist/hookc -hookc/hookc: +dist/forged: $(SOURCE_FILES) + mkdir -p dist + CGO_ENABLED=0 go build -o dist/forged -ldflags '-extldflags "-f no-PIC -static"' -tags 'osusergo netgo static_build' ./forged -git2d/git2d: $(wildcard git2d/*.c) - $(CC) $(CFLAGS) -o git2d/git2d $^ $(shell pkg-config --cflags --libs libgit2) -lpthread +dist/git2d: $(wildcard git2d/*.c) + mkdir -p dist + $(CC) $(CFLAGS) -o dist/git2d $^ $(shell pkg-config --cflags --libs libgit2) -lpthread + +dist/hookc: $(wildcard hookc/*.c) + mkdir -p dist + $(CC) $(CFLAGS) -o dist/hookc $^ clean: rm -rf forge hookc/hookc git2d/git2d */*.o -forged/internal/embed/%: % - @mkdir -p $(shell dirname $@) - @cp $^ $@ - -forged/internal/embed/.gitignore: - @touch $@ |