-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (25 loc) · 1.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## Copyright 2020 Marco Miretti <[email protected]>
##
## Copying and distribution of this file, with or without modification,
## are permitted in any medium without royalty provided the copyright
## notice and this notice are preserved. This file is offered as-is,
## without any warranty.
GREP ?= grep
CUT ?= cut
TR ?= tr
package := $(shell $(GREP) "^Name: " DESCRIPTION | $(CUT) -f2 -d" " | \
$(TR) '[:upper:]' '[:lower:]')
version := $(shell $(GREP) "^Version: " DESCRIPTION | $(CUT) -f2 -d" ")
target_dir := target
version_dir := $(package)-$(shell git rev-parse --short HEAD)
version_tarball := $(target_dir)/$(package)-$(shell git rev-parse --short HEAD).tar.gz
.PHONY: version
version:
mkdir -p $(target_dir)
git archive --format=tar --prefix=$(version_dir)/ HEAD | gzip >$(version_tarball)
install: version
octave --eval "pkg install $(version_tarball)"
htmldoc: install
octave --eval "pkg load generate_html; options = get_html_options ('octave-forge'); generate_package_html ('websockets', 'public', options);"
clean:
rm -rf $(target_dir)