Lindenii Project Forge
Login

server

Lindenii Forge’s main backend daemon
Commit info
ID
b56467df1951ed5f43f1b8fc989ef271bdd80ada
Author
Runxi Yu <me@runxiyu.org>
Author date
Sun, 17 Aug 2025 14:16:38 +0800
Committer
Runxi Yu <me@runxiyu.org>
Committer date
Sun, 17 Aug 2025 14:16:38 +0800
Actions
More build system updates
# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org>
#
# TODO: This Makefile utilizes a lot of GNU extensions. Some of them are
# unfortunately difficult to avoid as POSIX Make's pattern rules are not
# sufficiently expressive. This needs to be fixed sometime (or we might move to
# some other build system).
#

.PHONY: clean all

CFLAGS = -Wall -Wextra -pedantic -std=c99 -D_GNU_SOURCE

SOURCE_FILES = $(shell git ls-files)

all: dist/forged dist/git2d dist/hookc

dist/forged: $(SOURCE_FILES)
dist/forged: $(shell git ls-files forged)
	mkdir -p dist
	CGO_ENABLED=0 go build -o dist/forged -ldflags '-extldflags "-f no-PIC -static"' -tags 'osusergo netgo static_build' ./forged

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

/git2d
/hookc