diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -1,7 +1,18 @@ -BIN = txt2web -DIST = $(BIN).tar.xz -SCRIPT = $(BIN).ros +PKG = txt2web +SCRIPT = $(PKG).ros + +ifeq ($(OS),Windows_NT) + BIN = $(PKG).exe + DIST = $(PKG).zip + ARCMD = "zip" + ARARGS = "-r" +else + BIN = $(PKG) + DIST = $(PKG).tar.xz + ARCMD = "tar" + ARARGS = "cfvJ" +endif BLACK := $(shell tput setaf 0) RED := $(shell tput setaf 1) @@ -26,7 +37,7 @@ graphs: diagrams.png $(BIN): bin/$(BIN) ln -f $< -bin/$(BIN): *.asd src/*.lisp src/*.ps strings/*.sexp bin/$(BIN).ros +bin/$(BIN): *.asd src/*.lisp src/*.ps strings/*.sexp bin/$(PKG).ros @echo @echo "* ${GREEN}Building ${YELLOW}${BIN} ${GREEN}binary${RESET}..." ros build bin/$(SCRIPT) @@ -37,7 +48,7 @@ bin/$(BIN): *.asd src/*.lisp src/*.ps st $(DIST): $(BIN) extras/* @echo @echo "* ${GREEN}Packaging${RESET}..." - tar cfvJ $@ $< extras + $(ARCMD) $(ARARGS) $@ $< extras clean: rm -f $(BIN) bin/$(BIN) $(DIST)