0
0
Fork 0
zero-blog/Makefile

41 lines
662 B
Makefile

BUILDDIR=build
SRCDIR=src
gofiles=$(wildcard $(SRCDIR)/*.go) $(wildcard $(SRCDIR)/**/*)
content=$(wildcard post/*.md index.md)
static=$(wildcard static/**)
targets=$(addprefix $(BUILDDIR)/content/,$(content)) $(addprefix $(BUILDDIR)/,$(static)) $(subst $(SRCDIR),$(BUILDDIR),$(gofiles))
render:
go run src/main.go
build: prebuild zero-blog
all: build
prebuild:
-mkdir $(BUILDDIR)
zero-blog: $(targets)
go build -o zero-blog ./$(BUILDDIR)/
$(BUILDDIR)/content/%: %
@mkdir -p $(@D)
cp $< $@
$(BUILDDIR)/%: %
@mkdir -p $(@D)
cp -r $< $@
$(BUILDDIR)/%: $(SRCDIR)/%
@mkdir -p $(@D)
cp $< $@
clean:
rm -R $(BUILDDIR)
rm zero-blog
.PHONY: clean