23 lines
375 B
Makefile
23 lines
375 B
Makefile
|
BINDIR := $(CURDIR)/bin
|
||
|
|
||
|
LDFLAGS := -w
|
||
|
|
||
|
# Rebuild the binary if any of these files change
|
||
|
SRC := $(shell find . -type f -name '*.go' -print) go.mod go.sum
|
||
|
|
||
|
.PHONY: all
|
||
|
all: build
|
||
|
|
||
|
.PHONY: build
|
||
|
build: build-cpusim
|
||
|
|
||
|
.PHONY: build-cpusim
|
||
|
build-cpusim: $(BINDIR)/cpusim
|
||
|
|
||
|
$(BINDIR)/cpusim: $(SRC)
|
||
|
go build -trimpath -o $@ ./cmd/cpusim
|
||
|
|
||
|
.PHONY: clean
|
||
|
clean:
|
||
|
@rm -rf '$(BINDIR)'
|