github.com/metux/go-metabuild@v0.0.0-20240118143255-d9ed5ab697f9/Makefile (about) 1 2 my_path := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) 3 4 test_zlib_path := ../zlib 5 test_lincity_path := ../lincity 6 test_xfwm4_path := ../xfwm4 7 8 metabuild := $(my_path)/bin/metabuild 9 conf := $(my_path)/examples/conf/settings.yaml 10 11 all: test 12 13 vet: 14 @go vet ./... 15 16 fmt: 17 @go fmt ./... 18 19 test: build test-util test-specobj test-autoconf 20 21 test-util: 22 @go test -timeout 10s -v ./util/... || (echo "======= TEST FAILED =======" ; false) 23 24 test-specobj: 25 @go test -timeout 10s -v ./util/specobj/... || (echo "======= TEST FAILED =======" ; false) 26 27 test-autoconf: 28 @go test -timeout 10s -v ./engine/autoconf/... || (echo "======= TEST FAILED =======" ; false) 29 30 define RUNTEST 31 cd $(1) && $(metabuild) -conf $(my_path)/examples/pkg/$(strip $(2))/metabuild.yaml -global $(conf) build 32 endef 33 34 test-zlib: build 35 $(call RUNTEST, $(test_zlib_path), zlib) 36 37 test-lincity: build 38 $(call RUNTEST, $(test_lincity_path), lincity) 39 40 test-xfwm4: build 41 $(call RUNTEST, $(test_xfwm4_path), xfwm4) 42 43 build: 44 @rm -Rf bin 45 @mkdir -p bin 46 @go build -o bin/ ./cmd/...