Added a Makefile to document build of pEpEmgine dependencies on Linux
authorEdouard Tisserant
Sat, 25 Jun 2016 00:07:29 +0200
changeset 766c6012809cc49
parent 765 681cfd246db6
child 767 ea2cc8609026
child 769 8660da4da019
child 770 265f59c3343f
Added a Makefile to document build of pEpEmgine dependencies on Linux
build-linux/Makefile
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build-linux/Makefile	Sat Jun 25 00:07:29 2016 +0200
     1.3 @@ -0,0 +1,320 @@
     1.4 +#------------------------------------------------------------------------------#
     1.5 +# Makefile to build libEtpan GPGME, GnuPG and deps for use with pEpEngine 
     1.6 +#  based on pEpJNIAdapter/android/external/Makefile
     1.7 +#------------------------------------------------------------------------------#
     1.8 +
     1.9 +all: build 
    1.10 +
    1.11 +build: libetpan-install gnupg-install gpgme-install
    1.12 +
    1.13 +PREFIX ?= $(HOME)
    1.14 +
    1.15 +CFLAGS = 
    1.16 +LDFLAGS = 
    1.17 +
    1.18 +#------------------------------------------------------------------------------#
    1.19 +# libgpg-error
    1.20 +
    1.21 +EXTERNAL_GIT_REPOS += libgpg-error|git://git.gnupg.org/libgpg-error.git?libgpg-error-1.20
    1.22 +
    1.23 +libgpg-error/configure: libgpg-error.src.stamp libgpg-error/configure.ac 
    1.24 +	cd libgpg-error && ./autogen.sh
    1.25 +
    1.26 +libgpg-error/Makefile: libgpg-error/configure 
    1.27 +	cd libgpg-error && \
    1.28 +		./configure \
    1.29 +			CFLAGS="$(CFLAGS)" \
    1.30 +			LDFLAGS="$(LDFLAGS)" \
    1.31 +			--disable-doc \
    1.32 +			--disable-languages \
    1.33 +			--prefix=$(PREFIX)
    1.34 +	ls -l libgpg-error/libtool
    1.35 +
    1.36 +libgpg-error/src/.libs/libgpg-error.so: libgpg-error/Makefile 
    1.37 +	$(MAKE) -C libgpg-error
    1.38 +
    1.39 +libgpg-error-build: libgpg-error/src/.libs/libgpg-error.so
    1.40 +
    1.41 +$(PREFIX)/lib/libgpg-error.so: libgpg-error/src/.libs/libgpg-error.so
    1.42 +	$(MAKE) -C libgpg-error prefix=$(PREFIX) install
    1.43 +	ls -l $(PREFIX)/lib/libgpg-error.so*
    1.44 +
    1.45 +libgpg-error-install: $(PREFIX)/lib/libgpg-error.so
    1.46 +
    1.47 +#------------------------------------------------------------------------------#
    1.48 +# libgcrypt
    1.49 +
    1.50 +EXTERNAL_GIT_REPOS += libgcrypt|git://git.gnupg.org/libgcrypt.git?libgcrypt-1.6.4
    1.51 +
    1.52 +libgcrypt/configure: libgcrypt.src.stamp libgcrypt/configure.ac 
    1.53 +	cd libgcrypt && ./autogen.sh
    1.54 +
    1.55 +libgcrypt/Makefile: libgcrypt/configure 
    1.56 +	cd libgcrypt && \
    1.57 +		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
    1.58 +			./configure \
    1.59 +				--enable-maintainer-mode \
    1.60 +				--with-gpg-error-prefix=$(PREFIX) \
    1.61 +				--prefix=$(PREFIX)
    1.62 +
    1.63 +libgcrypt/src/.libs/libgcrypt.so: $(PREFIX)/lib/libgpg-error.so libgcrypt/Makefile
    1.64 +	$(MAKE) -C libgcrypt
    1.65 +
    1.66 +$(PREFIX)/lib/libgcrypt.so: libgcrypt/src/.libs/libgcrypt.so
    1.67 +	$(MAKE) -C libgcrypt prefix=$(PREFIX) install
    1.68 +	ls -l $(PREFIX)/lib/libgcrypt.so
    1.69 +
    1.70 +libgcrypt-build: libgcrypt/src/.libs/libgcrypt.so
    1.71 +
    1.72 +libgcrypt-install: $(PREFIX)/lib/libgcrypt.so
    1.73 +
    1.74 +#------------------------------------------------------------------------------#
    1.75 +# libassuan
    1.76 +
    1.77 +EXTERNAL_GIT_REPOS += libassuan|git://git.gnupg.org/libassuan.git?libassuan-2.3.0
    1.78 +
    1.79 +libassuan/configure: libassuan.src.stamp libassuan/configure.ac 
    1.80 +	cd libassuan && ./autogen.sh && autoreconf --install --force --verbose
    1.81 +
    1.82 +libassuan/Makefile: libassuan/configure
    1.83 +	cd libassuan && \
    1.84 +		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
    1.85 +			./configure \
    1.86 +				--enable-maintainer-mode \
    1.87 +				--with-gpg-error-prefix=$(PREFIX) \
    1.88 +				--prefix=$(PREFIX)
    1.89 +
    1.90 +libassuan/src/.libs/libassuan.so: $(PREFIX)/lib/libgpg-error.so libassuan/Makefile
    1.91 +	$(MAKE) -C libassuan
    1.92 +
    1.93 +$(PREFIX)/lib/libassuan.so: libassuan/src/.libs/libassuan.so
    1.94 +	$(MAKE) -C libassuan prefix=$(PREFIX) install
    1.95 +	ls -l $(PREFIX)/lib/libassuan.so
    1.96 +
    1.97 +libassuan-build: libassuan/src/.libs/libassuan.so
    1.98 +
    1.99 +libassuan-install: $(PREFIX)/lib/libassuan.so
   1.100 +
   1.101 +#------------------------------------------------------------------------------#
   1.102 +# libksba
   1.103 +
   1.104 +EXTERNAL_GIT_REPOS += libksba|git://git.gnupg.org/libksba.git?libksba-1.3.3
   1.105 +
   1.106 +libksba/configure: libksba.src.stamp libksba/configure.ac 
   1.107 +	cd libksba && ./autogen.sh
   1.108 +
   1.109 +libksba/Makefile: $(PREFIX)/lib/libgpg-error.so libksba/configure
   1.110 +	cd libksba && \
   1.111 +		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
   1.112 +			./configure \
   1.113 +				--enable-maintainer-mode \
   1.114 +				--with-gpg-error-prefix=$(PREFIX) \
   1.115 +				--prefix=$(PREFIX)
   1.116 +
   1.117 +libksba/src/.libs/libksba.so: libksba/Makefile
   1.118 +	$(MAKE) -C libksba
   1.119 +
   1.120 +$(PREFIX)/lib/libksba.so: libksba/src/.libs/libksba.so
   1.121 +	$(MAKE) -C libksba prefix=$(PREFIX) install
   1.122 +	ls -l $(PREFIX)/lib/libksba.so
   1.123 +
   1.124 +libksba-build: libksba/src/.libs/libksba.so
   1.125 +
   1.126 +libksba-install: $(PREFIX)/lib/libksba.so
   1.127 +
   1.128 +#------------------------------------------------------------------------------#
   1.129 +# curl
   1.130 +
   1.131 +EXTERNAL_GIT_REPOS += curl|https://github.com/bagder/curl?curl-7_45_0
   1.132 +
   1.133 +curl/configure: curl.src.stamp curl/configure.ac 
   1.134 +	cd curl && ./buildconf
   1.135 +
   1.136 +curl/Makefile: curl/configure
   1.137 +	cd curl && \
   1.138 +		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
   1.139 +			./configure \
   1.140 +				--prefix=$(PREFIX) \
   1.141 +				--with-gnu-ld \
   1.142 +				--disable-imap \
   1.143 +				--disable-ldap \
   1.144 +				--disable-pop3 \
   1.145 +				--disable-rtsp \
   1.146 +				--disable-smtp
   1.147 +
   1.148 +curl/lib/.libs/libcurl.so: curl/Makefile
   1.149 +	$(MAKE) -C curl
   1.150 +
   1.151 +$(PREFIX)/lib/libcurl.so: curl/lib/.libs/libcurl.so
   1.152 +	$(MAKE) -C curl prefix=$(PREFIX) install
   1.153 +	ls -l $(PREFIX)/lib/libcurl.so
   1.154 +
   1.155 +curl-build: curl/lib/.libs/libcurl.so
   1.156 +
   1.157 +curl-install: $(PREFIX)/lib/libcurl.so
   1.158 +
   1.159 +
   1.160 +#------------------------------------------------------------------------------#
   1.161 +# gnupg
   1.162 +
   1.163 +EXTERNAL_GIT_REPOS += gnupg|git://git.gnupg.org/gnupg.git?gnupg-2.0.29
   1.164 +
   1.165 +gnupg/configure: gnupg.src.stamp gnupg/configure.ac 
   1.166 +	-sed -i '/^tests/d' gnupg/configure.ac
   1.167 +	-sed -i 's/tests = tests/tests =/' gnupg/Makefile.am
   1.168 +	cd gnupg && ./autogen.sh
   1.169 +
   1.170 +gnupg/Makefile: gnupg/configure
   1.171 +	cd gnupg && \
   1.172 +		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
   1.173 +			./configure \
   1.174 +				--enable-maintainer-mode \
   1.175 +				--with-gpg-error-prefix=$(PREFIX) \
   1.176 +				--with-libgcrypt-prefix=$(PREFIX) \
   1.177 +				--with-libassuan-prefix=$(PREFIX) \
   1.178 +				--with-ksba-prefix=$(PREFIX) \
   1.179 +				--with-libcurl=$(PREFIX) \
   1.180 +				--disable-agent \
   1.181 +				--disable-scdaemon \
   1.182 +				--disable-ldap \
   1.183 +				--disable-doc \
   1.184 +				--disable-gpgsm \
   1.185 +				--prefix=$(PREFIX)
   1.186 +
   1.187 +gnupg/g10/gpg2: $(PREFIX)/lib/libgpg-error.so $(PREFIX)/lib/libgcrypt.so $(PREFIX)/lib/libksba.so $(PREFIX)/lib/libassuan.so $(PREFIX)/lib/libcurl.so gnupg/Makefile
   1.188 +	$(MAKE) -C gnupg
   1.189 +
   1.190 +$(PREFIX)/bin/gpg2: gnupg/g10/gpg2 gnupg/configure
   1.191 +	$(MAKE) -C gnupg prefix=$(PREFIX) install
   1.192 +	ls -l $(PREFIX)/bin/gpg2
   1.193 +
   1.194 +gnupg-build: gnupg/g10/gpg2
   1.195 +
   1.196 +gnupg-install: $(PREFIX)/bin/gpg2
   1.197 +
   1.198 +#------------------------------------------------------------------------------#
   1.199 +# gpgme
   1.200 +
   1.201 +EXTERNAL_GIT_REPOS += gpgme|git://git.gnupg.org/gpgme.git?gpgme-1.6.0
   1.202 +
   1.203 +gpgme/configure: gpgme.src.stamp gpgme/configure.ac 
   1.204 +	cd gpgme && ./autogen.sh 
   1.205 +
   1.206 +gpgme/Makefile: gpgme/configure
   1.207 +	cd gpgme && \
   1.208 +		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
   1.209 +			./configure \
   1.210 +				--enable-maintainer-mode \
   1.211 +				--with-gpg-error-prefix=$(PREFIX) \
   1.212 +				--with-libassuan-prefix=$(PREFIX) \
   1.213 +				--enable-fixed-path=$(PREFIX)/bin \
   1.214 +				--without-g13 \
   1.215 +				--disable-glibtest \
   1.216 +				--disable-gpg-test \
   1.217 +				--disable-gpgsm-test \
   1.218 +				--disable-gpgconf-test \
   1.219 +				--disable-parallel-test \
   1.220 +				--disable-g13-test \
   1.221 +				--prefix=$(PREFIX)
   1.222 +
   1.223 +
   1.224 +gpgme/src/.libs/libgpgme.so: gpgme/Makefile
   1.225 +	$(MAKE) -C gpgme
   1.226 +
   1.227 +$(PREFIX)/lib/libgpgme.so: gpgme/src/.libs/libgpgme.so
   1.228 +	$(MAKE) -C gpgme prefix=$(PREFIX) install
   1.229 +
   1.230 +gpgme-build: gpgme/src/.libs/libgpgme.so
   1.231 +
   1.232 +gpgme-install: $(PREFIX)/bin/gpg2 $(PREFIX)/lib/libgpgme.so
   1.233 +
   1.234 +#------------------------------------------------------------------------------#
   1.235 +# libetpan
   1.236 +
   1.237 +EXTERNAL_GIT_REPOS += libetpan|https://github.com/fdik/libetpan.git?HEAD
   1.238 +
   1.239 +libetpan/configure: libetpan.src.stamp
   1.240 +	cd libetpan && ./autogen.sh
   1.241 +
   1.242 +libetpan/Makefile: libetpan/configure
   1.243 +	cd libetpan && \
   1.244 +		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
   1.245 +			./configure \
   1.246 +				--prefix=$(PREFIX)
   1.247 +
   1.248 +libetpan/src/.libs/libetpan.so: libetpan/Makefile
   1.249 +	$(MAKE) -C libetpan
   1.250 +
   1.251 +$(PREFIX)/lib/libetpan.so: libetpan/src/.libs/libetpan.so
   1.252 +	$(MAKE) -C libetpan install
   1.253 +
   1.254 +libetpan-build: libetpan/src/.libs/libetpan.so
   1.255 +
   1.256 +libetpan-install: $(PREFIX)/lib/libetpan.so
   1.257 +
   1.258 +#------------------------------------------------------------------------------#
   1.259 +# Clone update and archive external projects GIT repos
   1.260 +# Local clone is in external/$project.git while 
   1.261 +# selected commit is archived in external/$project
   1.262 +
   1.263 +define per_repo_targets
   1.264 +$(1).git.stamp:
   1.265 +	git clone $(2) $(1).git
   1.266 +	touch $(1).git.stamp
   1.267 +
   1.268 +$(1).git_update: $(1).git.stamp
   1.269 +	cd $(1).git; git pull
   1.270 +	touch $(1).git.stamp
   1.271 +
   1.272 +$(1).src.stamp: $(1).git.stamp
   1.273 +	rm -rf $(1)
   1.274 +	mkdir $(1)
   1.275 +	(cd $(1).git; git archive --format=tar $(3)) | tar -C $(1) -x
   1.276 +	touch $(1).src.stamp
   1.277 +
   1.278 +$(1)-src: $(1).src.stamp
   1.279 +
   1.280 +$(1)-clean: 
   1.281 +	rm -rf $(1)
   1.282 +	rm -f $(1).src.stamp
   1.283 +
   1.284 +EXTERNAL_LOCAL_GITS += $(1).git.stamp
   1.285 +EXTERNAL_LOCAL_GITS_UPDATE += $(1).git_update
   1.286 +EXTERNAL_SRCS += $(1)-src
   1.287 +EXTERNAL_SRCS_CLEAN += $(1)-clean
   1.288 +endef
   1.289 +
   1.290 +define per_repo
   1.291 +$(call per_repo_targets,\
   1.292 +    $(1),\
   1.293 +    $(word 1,$(subst ?, ,$(2))),\
   1.294 +    $(word 2,$(subst ?, ,$(2))))
   1.295 +endef
   1.296 +
   1.297 +$(foreach repo, $(EXTERNAL_GIT_REPOS), $(eval $(call per_repo,\
   1.298 +    $(word 1,$(subst |, ,$(repo))),\
   1.299 +    $(word 2,$(subst |, ,$(repo))))))
   1.300 +
   1.301 +git_clones: $(EXTERNAL_LOCAL_GITS)
   1.302 +
   1.303 +git_update: $(EXTERNAL_LOCAL_GITS_UPDATE)
   1.304 +
   1.305 +#------------------------------------------------------------------------------#
   1.306 +# clean
   1.307 +
   1.308 +clean: $(EXTERNAL_SRCS_CLEAN) clean-install libetpan-cleanzip
   1.309 +
   1.310 +#------------------------------------------------------------------------------#
   1.311 +
   1.312 +.PHONY = clean clean-install libetpan-cleanzip\
   1.313 +	libgpg-error-build libgpg-error-install \
   1.314 +	libgcrypt-build libgcrypt-install \
   1.315 +	libassuan-build libassuan-install \
   1.316 +	libksba-build libksba-install \
   1.317 +	gnupg-build  gnupg-install\
   1.318 +	gpgme-build  gpgme-install\
   1.319 +	curl-build curl-install \
   1.320 +	clean-install \
   1.321 +    $(EXTERNAL_LOCAL_GITS_UPDATE) $(EXTERNAL_SRCS) $(EXTERNAL_SRCS_CLEAN) \
   1.322 +	showsetup
   1.323 +