-
Notifications
You must be signed in to change notification settings - Fork 16
/
makefile.aos4.common
130 lines (104 loc) · 4.02 KB
/
makefile.aos4.common
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#
# This is a makefile that is used for both build variants for SimpleGit
# on AmigaOS.
#
COMPILER := $(shell which ppc-amigaos-gcc)
ifeq ($(COMPILER),)
$(error No cross compiler for AmigaOS has been found!)
endif
####################################################
COMMITS := $(shell git rev-list HEAD --count)
VERSION_TAG := $(shell date "+%Y%m%d")-$(shell printf %06d $(COMMITS))
####################################################
LHA = $(shell pwd)/build-deps/lha/lha-1.14i.orig/src/lha
OPENSSL = interim-openssl/openssl/repo/libssl.a
PTHREAD = build-deps/Local/common/include/pthread.h
####################################################
# The openssl dependency needed by libgit2
# We use the interim openssl port to support ssl
.PHONY: openssl
openssl: $(OPENSSL)
$(OPENSSL):
(cd interim-openssl && git pull) || \
(git clone https://github.com/sba1/interim-openssl.git)
$(MAKE) -C interim-openssl checkout build CC=ppc-amigaos-gcc
####################################################
# The libssh2 dependency needed by libgit2, sources are compiled
# directly
libssh2:
git clone https://github.com/libssh2/libssh2
cd libssh2 && git checkout libssh2-1.8.0
####################################################
# The pthread dependency needed by sgit. We extract
# it from the official AmigaOS SDK
.PHONY: pthread
pthread: $(PTHREAD)
$(PTHREAD): build-deps/SDK_53.24.lha-done $(LHA)
cd build-deps && $(LHA) xf SDK_53.24.lha
cd build-deps && $(LHA) xf SDK_Install/pthread.lha
touch $@
build-deps/SDK_53.24.lha-done:
mkdir -p build-deps
wget "http://www.hyperion-entertainment.biz/index.php?option=com_registration&view=download&format=raw&file=69&Itemid=63" -O build-deps/SDK_53.24.lha
touch $@
#####################################################
# AmiSSL dependency
build-deps/amissl4-done: $(LHA)
mkdir -p build-deps/amissl4
cd build-deps/amissl4 && wget -N https://github.com/jens-maus/amissl/releases/download/4.2/AmiSSL-4.2.lha
cd build-deps/amissl4 && $(LHA) xf AmiSSL-4.2.lha
touch $@
####################################################
# The lha dependency needed for serveral subtasks
# such as building the release archive
.PHONY: lha
lha: $(LHA)
$(LHA):
mkdir -p build-deps/lha
cd build-deps/lha && wget -N http://archive.debian.org/debian-archive/debian/pool/non-free/l/lha/lha_1.14i.orig.tar.gz
cd build-deps/lha && wget -N http://archive.debian.org/debian-archive/debian/pool/non-free/l/lha/lha_1.14i-10.3.diff.gz
cd build-deps/lha && tar -xzf lha_1.14i.orig.tar.gz
cd build-deps/lha && zcat lha_1.14i-10.3.diff.gz | patch -p0
cd build-deps/lha/lha-1.14i.orig/ && make
.PHONY: libgit-repo
libgit-repo:
# Git repo
git submodule init
git submodule update
####################################################
# Packaging
ReadMe.plain: ReadMe.md
pandoc $< -t plain >$@
AMIGA_README = build-amiga/ReadMe
$(AMIGA_README): ReadMe.amiga.mak ReadMe.plain
mkdir -p build-amiga
# Generate the ReadMe file for Aminet
python -c "\
from mako.template import Template;\
from mako.lookup import TemplateLookup;\
print Template(\
filename='ReadMe.amiga.mak',\
input_encoding='utf-8',\
output_encoding='utf-8',\
lookup=TemplateLookup(['./'],input_encoding='utf-8')).render(SIMPLEGIT_VERSION='0.$(COMMITS)')\
iconv --from-code=UTF8 --to-code=ISO-8859-15 [email protected] >$@
.PHONY: prepare-os4-release
prepare-os4-release: $(LHA) $(AMIGA_README)
rm -Rf dist
mkdir -p dist/sgit-$(VERSION_TAG)
cp bin/sgit dist/sgit-$(VERSION_TAG)
cp $(AMIGA_README) dist/sgit-$(VERSION_TAG)
cp contrib/* dist/sgit-$(VERSION_TAG)
cd dist && $(LHA) ao5 sgit-$(VERSION_TAG).lha sgit-$(VERSION_TAG)
####################################################
# Upload the distribution to the main Aminet server
.PHONY: upload-os4-release
upload-os4-release:
cd dist && cp sgit-$(VERSION_TAG).lha sgit.lha
lftp -e "put dist/sgit.lha && put dist/sgit-$(VERSION_TAG)/ReadMe -o sgit.readme && quit" ftp://main.aminet.net/new
####################################################
# Tag the current version
.PHONY: tag
tag:
git tag sgit-$(VERSION_TAG)