-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile.inc
46 lines (37 loc) · 1.46 KB
/
Makefile.inc
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
34
35
36
37
38
39
40
41
42
43
44
45
46
# This is a Makefile INCLUDE - it assumes that the variable PACKNAME is defined
#
# It also assumes that the current directory contains a file called VERSION
# containing just the current version of the pack.
#
# It also assumes that there is a file called pack.pl with placeholders for
# the version and package name.
VER=$(shell cat VERSION)
PACKFILE=release/$(PACKNAME)-$(VER).tgz
EPACKFILE=release\/$(PACKNAME)-$(VER).tgz
ZIPFILE=release/$(PACKNAME)-$(VER).zip
DOWNLOAD=https:\/\/raw.githubusercontent.com\/samer--\/prolog\/master\/$(PACKNAME)\/$(EPACKFILE)
main:
packdir:
mkdir -p $(PACKNAME) $(PACKNAME)/prolog
sed -e "s/<VER>/$(VER)/g" < pack.pl | sed -e "s/<EMAIL>/$(EMAIL)/g" | sed -e "s/<PACKNAME>/$(PACKNAME)/g" | sed -e "s/<DOWNLOAD>/$(DOWNLOAD)/g" > $(PACKNAME)/pack.pl
rsync -ar --delete --exclude '.*' prolog $(PACKNAME)
cp -p README $(PACKNAME)
cp -p ../COPYING* $(PACKNAME)
pack: packdir
COPYFILE_DISABLE=1 tar czf $(PACKFILE) $(PACKNAME)
rm -rf $(PACKNAME)
git add $(PACKFILE)
zip: packdir
zip -r $(ZIPFILE) $(PACKNAME)
rm -rf $(PACKNAME)
git add $(ZIPFILE)
push:
git push
install:
swipl -g "pack_install('$(PACKFILE)',[upgrade(true),interactive(false)]), halt"
install-git:
(git commit $(PACKFILE) || echo 'Local up to date') && (git push || echo 'Remote up to date')
swipl -g "pack_property($(PACKNAME),download(D)), pack_install(D,[upgrade(true),interactive(false)]), halt"
chmod -w $(PACKFILE)
dist-clean: