2024-10-09 20:31:30 +00:00
|
|
|
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
|
2024-11-01 10:54:59 +00:00
|
|
|
build: build-cpusim build-asmtest build-simtest
|
2024-10-09 20:31:30 +00:00
|
|
|
|
|
|
|
.PHONY: build-cpusim
|
|
|
|
build-cpusim: $(BINDIR)/cpusim
|
|
|
|
|
|
|
|
$(BINDIR)/cpusim: $(SRC)
|
2024-11-01 10:54:59 +00:00
|
|
|
go build -trimpath -o $@ ./cmd/$(@F)
|
|
|
|
|
|
|
|
.PHONY: build-asmtest
|
|
|
|
build-asmtest: $(BINDIR)/asmtest
|
|
|
|
|
|
|
|
$(BINDIR)/asmtest: $(SRC)
|
|
|
|
go build -trimpath -o $@ ./cmd/$(@F)
|
|
|
|
|
|
|
|
.PHONY: build-simtest
|
|
|
|
build-simtest: $(BINDIR)/simtest
|
|
|
|
|
|
|
|
$(BINDIR)/simtest: $(SRC)
|
|
|
|
go build -trimpath -o $@ ./cmd/$(@F)
|
2024-10-09 20:31:30 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
@rm -rf '$(BINDIR)'
|