GitRoot

craft your forge, build your project, grow your community freely
 1# SPDX-FileCopyrightText: 2025 Romain Maneschi <romain@gitroot.dev>
 2#
 3# SPDX-License-Identifier: EUPL-1.2
 4
 5VERSION=`git describe --exact-match --tags HEAD 2> /dev/null`
 6COMMIT=`git rev-parse HEAD`
 7PLUGINS_DIR=$(shell find app/plugins/ -maxdepth 1 -mindepth 1 -type d)
 8MAKEFLAGS += --no-print-directory
 9
10build:
11	cd app/server/ && go build -race -ldflags "-X main.version=${VERSION} -X main.commit=${COMMIT}"  -o ../../gitroot
12
13build-plugins:
14	for dir in $(PLUGINS_DIR) ; do \
15		make -C  $$dir build; \
16	done
17
18test:
19	cd app/libs/golang/glob && go test -race ./...
20	cd app/libs/golang/plugin && go test -race ./...
21	for dir in $(PLUGINS_DIR) ; do \
22		make -C  $$dir test; \
23	done
24	cd app/server/ && go test -race ./...
25
26testsuite: build-plugins
27	cd app/testsuite && ./runtest.sh && ./proxy.sh
28
29testall: test testsuite
30
31force-build-plugins: clean-plugins build-plugins
32
33clean-plugins:
34	for dir in $(PLUGINS_DIR) ; do \
35		make -C  $$dir clean; \
36	done
37
38clean: clean-plugins
39	cd app/server/ && go clean
40	rm -rf gitroot