central-arch/Makefile
2024-11-01 11:54:59 +01:00

35 lines
644 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 build-asmtest build-simtest
.PHONY: build-cpusim
build-cpusim: $(BINDIR)/cpusim
$(BINDIR)/cpusim: $(SRC)
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)
.PHONY: clean
clean:
@rm -rf '$(BINDIR)'