Re: [hackers] [lchat] Makefile: add dist target to create release tarballs || Jan Klemkow
On Thu, Oct 20, 2022 at 5:11 PM <git_AT_suckless.org> wrote:
>
> commit f212a3b26b2b248aa41c50f6393564cf1e29dbc2
> Author: Jan Klemkow <j.klemkow_AT_wemelug.de>
> AuthorDate: Thu Oct 20 23:09:58 2022 +0200
> Commit: Jan Klemkow <j.klemkow_AT_wemelug.de>
> CommitDate: Thu Oct 20 23:09:58 2022 +0200
>
> Makefile: add dist target to create release tarballs
>
> diff --git a/Makefile b/Makefile
> index ff911d9..ee6839e 100644
> --- a/Makefile
> +++ b/Makefile
> _AT_@ -1,6 +1,6 @@
> include config.mk
>
> -.PHONY: all install uninstall filter clean test
> +.PHONY: all install uninstall filter clean test dist
>
> all: lchat
> clean:
> _AT_@ -16,6 +16,12 @@ uninstall:
> test: sl_test
> ./sl_test
>
> +dist:
> + mkdir -p lchat-$(VERSION)
> + cp -r $$(git ls-tree --name-only HEAD) lchat-$(VERSION)
> + tar -czf lchat-$(VERSION).tar.gz lchat-$(VERSION)
> + rm -fr lchat-$(VERSION)
> +
> lchat: lchat.o slackline.o util.o
> $(CC) -o $_AT_ lchat.o slackline.o util.o $(LIBS)
>
> diff --git a/config.mk b/config.mk
> index 62c4af0..0ca7653 100644
> --- a/config.mk
> +++ b/config.mk
> _AT_@ -1,3 +1,5 @@
> +VERSION = 1.0
> +
> # paths
> PREFIX = /usr/local
> BINDIR = $(PREFIX)/bin
>
If you want to stick with git, the mkdir, cp, tar, and rm commands
could be replaced with:
git archive --prefix lchat-$(VERSION)/ HEAD | gzip > lchat-$(VERSION).tar.gz
Received on Fri Oct 21 2022 - 01:18:42 CEST
This archive was generated by hypermail 2.3.0
: Fri Oct 21 2022 - 07:00:36 CEST