datefmt

format unix timestamps over stdin
git clone git://jb55.com/datefmt
Log | Files | Refs | README | LICENSE

Makefile (1275B)


      1 
      2 CFLAGS = -g -Wall -Werror -std=c99
      3 PREFIX ?= /usr
      4 
      5 all: datefmt docs
      6 
      7 docs: doc/datefmt.html doc/datefmt.1 README
      8 
      9 README: datefmt.c
     10 	./datefmt --help > $@
     11 
     12 dist: docs version
     13 	@mkdir -p dist
     14 	git archive HEAD --format tar.gz --prefix datefmt-$(shell cat version)/ -o dist/datefmt-$(shell cat version).tar.gz
     15 	@ls -dt dist/* | head -n1 | xargs echo "tgz "
     16 	cd dist;\
     17 	sha256sum *.tar.gz > SHA256SUMS.txt;\
     18 	gpg -u 0x8A478B64FFE30F1095A8736BF5F27EFD1B38DABB --sign --armor --detach-sig --output SHA256SUMS.txt.asc SHA256SUMS.txt
     19 	rsync -avzP dist/ charon:/www/cdn.jb55.com/tarballs/datefmt/
     20 	scp doc/datefmt.html charon:public/datefmt/index.html
     21 	scp CHANGELOG.md charon:/www/cdn.jb55.com/tarballs/datefmt/CHANGELOG.txt
     22 
     23 version: datefmt.c
     24 	grep '^#define VERSION' $< | sed -En 's,.*"([^"]+)".*,\1,p' > $@
     25 
     26 doc/datefmt.md: doc/datefmt.gmi version
     27 	<$< gmi2md | sed "s,@VERSION,$(shell cat version),g" > $@
     28 
     29 doc/datefmt.html: doc/datefmt.md
     30 	pandoc -s $< -o $@
     31 
     32 datefmt: datefmt.c
     33 	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
     34 
     35 install: datefmt docs
     36 	install -Dm644 doc/datefmt.1 $(PREFIX)/share/man/man1/datefmt.1
     37 	install -Dm755 datefmt $(PREFIX)/bin/datefmt
     38 
     39 doc/datefmt.1: doc/datefmt.scd
     40 	scdoc < $^ > $@
     41 
     42 clean:
     43 	rm -f datefmt
     44 
     45 tags:
     46 	ctags datefmt.c
     47 
     48 .PHONY: install clean dist