fermentord/vendor/github.com/warthog618/go-gpiocdev/Makefile

34 lines
657 B
Makefile
Raw Normal View History

# SPDX-FileCopyrightText: 2019 Kent Gibson <warthog618@gmail.com>
#
# SPDX-License-Identifier: MIT
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
VERSION ?= $(shell git describe --tags --always --dirty 2> /dev/null )
LDFLAGS=-ldflags "-X=main.version=$(VERSION)"
spis=$(patsubst %.go, %, $(wildcard example/spi/*/*.go))
examples=$(patsubst %.go, %, $(wildcard example/*/*.go))
bins= $(spis) $(examples)
2024-06-15 13:58:47 +00:00
cli=$(patsubst %.go, %, $(wildcard cli/gpio*.go))
all: tools $(bins)
2024-06-15 13:58:47 +00:00
$(cli) : % : %.go
cd $(@D); \
2024-06-15 13:58:47 +00:00
$(GOBUILD) -o gpiocdev $(LDFLAGS)
$(bins) : % : %.go
cd $(@D); \
$(GOBUILD)
clean:
$(GOCLEAN) ./...
2024-06-15 13:58:47 +00:00
rm cli/gpiocdev
2024-06-15 13:58:47 +00:00
tools: $(cli)