Skip to content

Commit

Permalink
fix: contribs/makefile
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Jun 12, 2024
1 parent cafbb79 commit 0a5daf1
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions contribs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ help:
@echo "Available make commands:"
@cat Makefile | grep '^[a-z][^:]*:' | cut -d: -f1 | sort | sed 's/^/ /'

programs=$(wildcard */)
programs=gnodev gnofaucet

# command to run dependency utilities, like goimports.
rundep=go run -modfile ../misc/devdeps/go.mod
Expand Down Expand Up @@ -31,30 +31,27 @@ install:
@echo 'To install a tool, go to the subdirectory, then run `make install`.'
@echo 'To do a full installation, run `make install_all`.'

install_all: $(addsuffix .install,$(programs))
%.install:
@echo "[+] make -C $(basename $@) install"
$(MAKE) --no-print-directory -C $(basename $@) install
.PHONY: install_all
install_all:
@set -e; for program in $(programs); do ( set -e; \
echo "[+] make -C $$program install"; \
$(MAKE) --no-print-directory -C $$program install; \
); done

########################################
# Test suite
.PHONY: test
test:
@set -e; for program in $(programs); do ( set -e; \
echo "[+] make -C $$program test"; \
$(MAKE) --no-print-directory -C $$program test; \
); done
test: $(addsuffix .test,$(programs))
%.test:
@echo "[+] make -C $(basename $@) install"
$(MAKE) --no-print-directory -C $(basename $@) test
.PHONY: test

########################################
# Lint
.PHONY: lint
lint:
@set -e; for program in $(programs); do ( set -e; \
echo "[+] make -C $$program lint"; \
$(MAKE) --no-print-directory -C $$program lint; \
); done
lint: $(addsuffix .lint,$(programs))
%.lint:
@echo "[+] make -C $(basename $@) install"
$(MAKE) --no-print-directory -C $(basename $@) lint

########################################
# Dev tools
Expand All @@ -66,9 +63,4 @@ fmt:

.PHONY: tidy
tidy:
@for gomod in `find . -name go.mod`; do ( \
dir=`dirname $$gomod`; \
set -xe; \
cd $$dir; \
go mod tidy -v; \
); done
find . -name go.mod -execdir go mod tidy -v \;

0 comments on commit 0a5daf1

Please sign in to comment.