diff options
| author | Teddy Wing | 2021-05-23 20:25:15 +0200 |
|---|---|---|
| committer | Teddy Wing | 2021-05-23 20:26:00 +0200 |
| commit | a94ccb468515d770491bd0df3368cb18b5a35947 (patch) | |
| tree | 14d7dde67dd21cd3607fa93405e24581cddf8b18 /Makefile | |
| parent | 1f9796c48abdffde0842e73ebd000ab57f364e41 (diff) | |
| download | google-calendar-rsvp-a94ccb468515d770491bd0df3368cb18b5a35947.tar.bz2 | |
Makefile: Add packaging targetsv0.0.1
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -14,11 +14,51 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. +VERSION := $(shell egrep '^version = ' Cargo.toml | awk -F '"' '{ print $$2 }') +TOOLCHAIN := $(shell fgrep default_host_triple $(HOME)/.rustup/settings.toml | awk -F '"' '{ print $$2 }') + +SOURCES := $(shell find src -name '*.rs') +RELEASE_PRODUCT := target/release/google-calendar-rsvp + MAN_PAGE := doc/google-calendar-rsvp.1 +DIST := $(abspath dist) +DIST_PRODUCT := $(DIST)/bin/google-calendar-rsvp +DIST_MAN_PAGE := $(DIST)/share/man/man1/google-calendar-rsvp.1 + + +$(RELEASE_PRODUCT): $(SOURCES) + cargo build --release + .PHONY: doc doc: $(MAN_PAGE) $(MAN_PAGE): $(MAN_PAGE).txt a2x --no-xmllint --format manpage $< + + +.PHONY: dist +dist: $(DIST_PRODUCT) $(DIST_MAN_PAGE) + +$(DIST): + mkdir -p $@ + +$(DIST)/bin: | $(DIST) + mkdir -p $@ + +$(DIST)/share/man/man1: | $(DIST) + mkdir -p $@ + +$(DIST_PRODUCT): $(RELEASE_PRODUCT) | $(DIST)/bin + cp $< $@ + +$(DIST_MAN_PAGE): $(MAN_PAGE) | $(DIST)/share/man/man1 + cp $< $@ + + +.PHONY: pkg +pkg: google-calendar-rsvp_$(VERSION)_$(TOOLCHAIN).tar.bz2 + +google-calendar-rsvp_$(VERSION)_$(TOOLCHAIN).tar.bz2: dist + tar cjv -s /dist/google-calendar-rsvp_$(VERSION)_$(TOOLCHAIN)/ -f $@ dist |
