build-linux/Makefile
author Volker Birk <vb@pep-project.org>
Fri, 04 Oct 2019 16:14:30 +0200
branchsync
changeset 4105 982548344703
parent 1513 e7f7e42385b5
permissions -rw-r--r--
warning
vb@1513
     1
# This file is under GNU General Public License 3.0
vb@1513
     2
# see LICENSE.txt
vb@1513
     3
Edouard@766
     4
#------------------------------------------------------------------------------#
Edouard@766
     5
# Makefile to build libEtpan GPGME, GnuPG and deps for use with pEpEngine 
Edouard@766
     6
#  based on pEpJNIAdapter/android/external/Makefile
Edouard@766
     7
#------------------------------------------------------------------------------#
Edouard@766
     8
vb@4105
     9
all:
vb@4105
    10
	@echo use make install to install GnuPG dependencies
vb@4105
    11
	@echo this is not needed for builds with other OpenPGP implementations
vb@4105
    12
	@echo use the Makefile in main directory and depend on README.md there
Edouard@766
    13
vb@4105
    14
install: libetpan-install gnupg-install gpgme-install
Edouard@766
    15
Edouard@766
    16
PREFIX ?= $(HOME)
Edouard@766
    17
Edouard@766
    18
CFLAGS = 
Edouard@766
    19
LDFLAGS = 
Edouard@766
    20
Edouard@766
    21
#------------------------------------------------------------------------------#
Edouard@766
    22
# libgpg-error
Edouard@766
    23
Edouard@766
    24
EXTERNAL_GIT_REPOS += libgpg-error|git://git.gnupg.org/libgpg-error.git?libgpg-error-1.20
Edouard@766
    25
Edouard@766
    26
libgpg-error/configure: libgpg-error.src.stamp libgpg-error/configure.ac 
Edouard@766
    27
	cd libgpg-error && ./autogen.sh
Edouard@766
    28
Edouard@766
    29
libgpg-error/Makefile: libgpg-error/configure 
Edouard@766
    30
	cd libgpg-error && \
Edouard@766
    31
		./configure \
Edouard@766
    32
			CFLAGS="$(CFLAGS)" \
Edouard@766
    33
			LDFLAGS="$(LDFLAGS)" \
Edouard@766
    34
			--disable-doc \
Edouard@766
    35
			--disable-languages \
Edouard@766
    36
			--prefix=$(PREFIX)
Edouard@766
    37
	ls -l libgpg-error/libtool
Edouard@766
    38
Edouard@766
    39
libgpg-error/src/.libs/libgpg-error.so: libgpg-error/Makefile 
Edouard@766
    40
	$(MAKE) -C libgpg-error
Edouard@766
    41
Edouard@766
    42
libgpg-error-build: libgpg-error/src/.libs/libgpg-error.so
Edouard@766
    43
Edouard@766
    44
$(PREFIX)/lib/libgpg-error.so: libgpg-error/src/.libs/libgpg-error.so
Edouard@766
    45
	$(MAKE) -C libgpg-error prefix=$(PREFIX) install
Edouard@766
    46
	ls -l $(PREFIX)/lib/libgpg-error.so*
Edouard@766
    47
Edouard@766
    48
libgpg-error-install: $(PREFIX)/lib/libgpg-error.so
Edouard@766
    49
Edouard@766
    50
#------------------------------------------------------------------------------#
Edouard@766
    51
# libgcrypt
Edouard@766
    52
Edouard@766
    53
EXTERNAL_GIT_REPOS += libgcrypt|git://git.gnupg.org/libgcrypt.git?libgcrypt-1.6.4
Edouard@766
    54
Edouard@766
    55
libgcrypt/configure: libgcrypt.src.stamp libgcrypt/configure.ac 
Edouard@766
    56
	cd libgcrypt && ./autogen.sh
Edouard@766
    57
Edouard@766
    58
libgcrypt/Makefile: libgcrypt/configure 
Edouard@766
    59
	cd libgcrypt && \
Edouard@766
    60
		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
Edouard@766
    61
			./configure \
Edouard@766
    62
				--enable-maintainer-mode \
Edouard@766
    63
				--with-gpg-error-prefix=$(PREFIX) \
Edouard@766
    64
				--prefix=$(PREFIX)
Edouard@766
    65
Edouard@766
    66
libgcrypt/src/.libs/libgcrypt.so: $(PREFIX)/lib/libgpg-error.so libgcrypt/Makefile
Edouard@766
    67
	$(MAKE) -C libgcrypt
Edouard@766
    68
Edouard@766
    69
$(PREFIX)/lib/libgcrypt.so: libgcrypt/src/.libs/libgcrypt.so
Edouard@766
    70
	$(MAKE) -C libgcrypt prefix=$(PREFIX) install
Edouard@766
    71
	ls -l $(PREFIX)/lib/libgcrypt.so
Edouard@766
    72
Edouard@766
    73
libgcrypt-build: libgcrypt/src/.libs/libgcrypt.so
Edouard@766
    74
Edouard@766
    75
libgcrypt-install: $(PREFIX)/lib/libgcrypt.so
Edouard@766
    76
Edouard@766
    77
#------------------------------------------------------------------------------#
Edouard@766
    78
# libassuan
Edouard@766
    79
Edouard@766
    80
EXTERNAL_GIT_REPOS += libassuan|git://git.gnupg.org/libassuan.git?libassuan-2.3.0
Edouard@766
    81
Edouard@766
    82
libassuan/configure: libassuan.src.stamp libassuan/configure.ac 
Edouard@766
    83
	cd libassuan && ./autogen.sh && autoreconf --install --force --verbose
Edouard@766
    84
Edouard@766
    85
libassuan/Makefile: libassuan/configure
Edouard@766
    86
	cd libassuan && \
Edouard@766
    87
		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
Edouard@766
    88
			./configure \
Edouard@766
    89
				--enable-maintainer-mode \
Edouard@766
    90
				--with-gpg-error-prefix=$(PREFIX) \
Edouard@766
    91
				--prefix=$(PREFIX)
Edouard@766
    92
Edouard@766
    93
libassuan/src/.libs/libassuan.so: $(PREFIX)/lib/libgpg-error.so libassuan/Makefile
Edouard@766
    94
	$(MAKE) -C libassuan
Edouard@766
    95
Edouard@766
    96
$(PREFIX)/lib/libassuan.so: libassuan/src/.libs/libassuan.so
Edouard@766
    97
	$(MAKE) -C libassuan prefix=$(PREFIX) install
Edouard@766
    98
	ls -l $(PREFIX)/lib/libassuan.so
Edouard@766
    99
Edouard@766
   100
libassuan-build: libassuan/src/.libs/libassuan.so
Edouard@766
   101
Edouard@766
   102
libassuan-install: $(PREFIX)/lib/libassuan.so
Edouard@766
   103
Edouard@766
   104
#------------------------------------------------------------------------------#
Edouard@766
   105
# libksba
Edouard@766
   106
Edouard@766
   107
EXTERNAL_GIT_REPOS += libksba|git://git.gnupg.org/libksba.git?libksba-1.3.3
Edouard@766
   108
Edouard@766
   109
libksba/configure: libksba.src.stamp libksba/configure.ac 
Edouard@766
   110
	cd libksba && ./autogen.sh
Edouard@766
   111
Edouard@766
   112
libksba/Makefile: $(PREFIX)/lib/libgpg-error.so libksba/configure
Edouard@766
   113
	cd libksba && \
Edouard@766
   114
		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
Edouard@766
   115
			./configure \
Edouard@766
   116
				--enable-maintainer-mode \
Edouard@766
   117
				--with-gpg-error-prefix=$(PREFIX) \
Edouard@766
   118
				--prefix=$(PREFIX)
Edouard@766
   119
Edouard@766
   120
libksba/src/.libs/libksba.so: libksba/Makefile
Edouard@766
   121
	$(MAKE) -C libksba
Edouard@766
   122
Edouard@766
   123
$(PREFIX)/lib/libksba.so: libksba/src/.libs/libksba.so
Edouard@766
   124
	$(MAKE) -C libksba prefix=$(PREFIX) install
Edouard@766
   125
	ls -l $(PREFIX)/lib/libksba.so
Edouard@766
   126
Edouard@766
   127
libksba-build: libksba/src/.libs/libksba.so
Edouard@766
   128
Edouard@766
   129
libksba-install: $(PREFIX)/lib/libksba.so
Edouard@766
   130
Edouard@766
   131
#------------------------------------------------------------------------------#
Edouard@766
   132
# curl
Edouard@766
   133
Edouard@766
   134
EXTERNAL_GIT_REPOS += curl|https://github.com/bagder/curl?curl-7_45_0
Edouard@766
   135
Edouard@766
   136
curl/configure: curl.src.stamp curl/configure.ac 
Edouard@766
   137
	cd curl && ./buildconf
Edouard@766
   138
Edouard@766
   139
curl/Makefile: curl/configure
Edouard@766
   140
	cd curl && \
Edouard@766
   141
		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
Edouard@766
   142
			./configure \
Edouard@766
   143
				--prefix=$(PREFIX) \
Edouard@766
   144
				--with-gnu-ld \
Edouard@766
   145
				--disable-imap \
Edouard@766
   146
				--disable-ldap \
Edouard@766
   147
				--disable-pop3 \
Edouard@766
   148
				--disable-rtsp \
Edouard@766
   149
				--disable-smtp
Edouard@766
   150
Edouard@766
   151
curl/lib/.libs/libcurl.so: curl/Makefile
Edouard@766
   152
	$(MAKE) -C curl
Edouard@766
   153
Edouard@766
   154
$(PREFIX)/lib/libcurl.so: curl/lib/.libs/libcurl.so
Edouard@766
   155
	$(MAKE) -C curl prefix=$(PREFIX) install
Edouard@766
   156
	ls -l $(PREFIX)/lib/libcurl.so
Edouard@766
   157
Edouard@766
   158
curl-build: curl/lib/.libs/libcurl.so
Edouard@766
   159
Edouard@766
   160
curl-install: $(PREFIX)/lib/libcurl.so
Edouard@766
   161
Edouard@766
   162
Edouard@766
   163
#------------------------------------------------------------------------------#
Edouard@766
   164
# gnupg
Edouard@766
   165
Edouard@766
   166
EXTERNAL_GIT_REPOS += gnupg|git://git.gnupg.org/gnupg.git?gnupg-2.0.29
Edouard@766
   167
Edouard@766
   168
gnupg/configure: gnupg.src.stamp gnupg/configure.ac 
Edouard@766
   169
	-sed -i '/^tests/d' gnupg/configure.ac
Edouard@766
   170
	-sed -i 's/tests = tests/tests =/' gnupg/Makefile.am
Edouard@766
   171
	cd gnupg && ./autogen.sh
Edouard@766
   172
Edouard@766
   173
gnupg/Makefile: gnupg/configure
Edouard@766
   174
	cd gnupg && \
Edouard@766
   175
		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
Edouard@766
   176
			./configure \
Edouard@766
   177
				--enable-maintainer-mode \
Edouard@766
   178
				--with-gpg-error-prefix=$(PREFIX) \
Edouard@766
   179
				--with-libgcrypt-prefix=$(PREFIX) \
Edouard@766
   180
				--with-libassuan-prefix=$(PREFIX) \
Edouard@766
   181
				--with-ksba-prefix=$(PREFIX) \
Edouard@766
   182
				--with-libcurl=$(PREFIX) \
Edouard@766
   183
				--disable-agent \
Edouard@766
   184
				--disable-scdaemon \
Edouard@766
   185
				--disable-ldap \
Edouard@766
   186
				--disable-doc \
Edouard@766
   187
				--disable-gpgsm \
Edouard@766
   188
				--prefix=$(PREFIX)
Edouard@766
   189
Edouard@766
   190
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
Edouard@766
   191
	$(MAKE) -C gnupg
Edouard@766
   192
Edouard@766
   193
$(PREFIX)/bin/gpg2: gnupg/g10/gpg2 gnupg/configure
Edouard@766
   194
	$(MAKE) -C gnupg prefix=$(PREFIX) install
Edouard@766
   195
	ls -l $(PREFIX)/bin/gpg2
Edouard@766
   196
Edouard@766
   197
gnupg-build: gnupg/g10/gpg2
Edouard@766
   198
Edouard@766
   199
gnupg-install: $(PREFIX)/bin/gpg2
Edouard@766
   200
Edouard@766
   201
#------------------------------------------------------------------------------#
Edouard@766
   202
# gpgme
Edouard@766
   203
Edouard@766
   204
EXTERNAL_GIT_REPOS += gpgme|git://git.gnupg.org/gpgme.git?gpgme-1.6.0
Edouard@766
   205
Edouard@766
   206
gpgme/configure: gpgme.src.stamp gpgme/configure.ac 
Edouard@766
   207
	cd gpgme && ./autogen.sh 
Edouard@766
   208
Edouard@766
   209
gpgme/Makefile: gpgme/configure
Edouard@766
   210
	cd gpgme && \
Edouard@766
   211
		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
Edouard@766
   212
			./configure \
Edouard@766
   213
				--enable-maintainer-mode \
Edouard@766
   214
				--with-gpg-error-prefix=$(PREFIX) \
Edouard@766
   215
				--with-libassuan-prefix=$(PREFIX) \
Edouard@766
   216
				--enable-fixed-path=$(PREFIX)/bin \
Edouard@766
   217
				--without-g13 \
Edouard@766
   218
				--disable-glibtest \
Edouard@766
   219
				--disable-gpg-test \
Edouard@766
   220
				--disable-gpgsm-test \
Edouard@766
   221
				--disable-gpgconf-test \
Edouard@766
   222
				--disable-parallel-test \
Edouard@766
   223
				--disable-g13-test \
Edouard@766
   224
				--prefix=$(PREFIX)
Edouard@766
   225
Edouard@766
   226
Edouard@766
   227
gpgme/src/.libs/libgpgme.so: gpgme/Makefile
Edouard@766
   228
	$(MAKE) -C gpgme
Edouard@766
   229
Edouard@766
   230
$(PREFIX)/lib/libgpgme.so: gpgme/src/.libs/libgpgme.so
Edouard@766
   231
	$(MAKE) -C gpgme prefix=$(PREFIX) install
Edouard@766
   232
Edouard@766
   233
gpgme-build: gpgme/src/.libs/libgpgme.so
Edouard@766
   234
Edouard@766
   235
gpgme-install: $(PREFIX)/bin/gpg2 $(PREFIX)/lib/libgpgme.so
Edouard@766
   236
Edouard@766
   237
#------------------------------------------------------------------------------#
Edouard@766
   238
# libetpan
Edouard@766
   239
Edouard@766
   240
EXTERNAL_GIT_REPOS += libetpan|https://github.com/fdik/libetpan.git?HEAD
Edouard@766
   241
Edouard@766
   242
libetpan/configure: libetpan.src.stamp
Edouard@766
   243
	cd libetpan && ./autogen.sh
Edouard@766
   244
Edouard@766
   245
libetpan/Makefile: libetpan/configure
Edouard@766
   246
	cd libetpan && \
Edouard@766
   247
		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
Edouard@766
   248
			./configure \
Edouard@766
   249
				--prefix=$(PREFIX)
Edouard@766
   250
Edouard@766
   251
libetpan/src/.libs/libetpan.so: libetpan/Makefile
Edouard@766
   252
	$(MAKE) -C libetpan
Edouard@766
   253
Edouard@766
   254
$(PREFIX)/lib/libetpan.so: libetpan/src/.libs/libetpan.so
Edouard@766
   255
	$(MAKE) -C libetpan install
Edouard@766
   256
Edouard@766
   257
libetpan-build: libetpan/src/.libs/libetpan.so
Edouard@766
   258
Edouard@766
   259
libetpan-install: $(PREFIX)/lib/libetpan.so
Edouard@766
   260
Edouard@766
   261
#------------------------------------------------------------------------------#
Edouard@766
   262
# Clone update and archive external projects GIT repos
Edouard@766
   263
# Local clone is in external/$project.git while 
Edouard@766
   264
# selected commit is archived in external/$project
Edouard@766
   265
Edouard@766
   266
define per_repo_targets
Edouard@766
   267
$(1).git.stamp:
Edouard@766
   268
	git clone $(2) $(1).git
Edouard@766
   269
	touch $(1).git.stamp
Edouard@766
   270
Edouard@766
   271
$(1).git_update: $(1).git.stamp
Edouard@766
   272
	cd $(1).git; git pull
Edouard@766
   273
	touch $(1).git.stamp
Edouard@766
   274
Edouard@766
   275
$(1).src.stamp: $(1).git.stamp
Edouard@766
   276
	rm -rf $(1)
Edouard@766
   277
	mkdir $(1)
Edouard@766
   278
	(cd $(1).git; git archive --format=tar $(3)) | tar -C $(1) -x
Edouard@766
   279
	touch $(1).src.stamp
Edouard@766
   280
Edouard@766
   281
$(1)-src: $(1).src.stamp
Edouard@766
   282
Edouard@766
   283
$(1)-clean: 
Edouard@766
   284
	rm -rf $(1)
Edouard@766
   285
	rm -f $(1).src.stamp
Edouard@766
   286
Edouard@766
   287
EXTERNAL_LOCAL_GITS += $(1).git.stamp
Edouard@766
   288
EXTERNAL_LOCAL_GITS_UPDATE += $(1).git_update
Edouard@766
   289
EXTERNAL_SRCS += $(1)-src
Edouard@766
   290
EXTERNAL_SRCS_CLEAN += $(1)-clean
Edouard@766
   291
endef
Edouard@766
   292
Edouard@766
   293
define per_repo
Edouard@766
   294
$(call per_repo_targets,\
Edouard@766
   295
    $(1),\
Edouard@766
   296
    $(word 1,$(subst ?, ,$(2))),\
Edouard@766
   297
    $(word 2,$(subst ?, ,$(2))))
Edouard@766
   298
endef
Edouard@766
   299
Edouard@766
   300
$(foreach repo, $(EXTERNAL_GIT_REPOS), $(eval $(call per_repo,\
Edouard@766
   301
    $(word 1,$(subst |, ,$(repo))),\
Edouard@766
   302
    $(word 2,$(subst |, ,$(repo))))))
Edouard@766
   303
Edouard@766
   304
git_clones: $(EXTERNAL_LOCAL_GITS)
Edouard@766
   305
Edouard@766
   306
git_update: $(EXTERNAL_LOCAL_GITS_UPDATE)
Edouard@766
   307
Edouard@766
   308
#------------------------------------------------------------------------------#
Edouard@766
   309
# clean
Edouard@766
   310
Edouard@766
   311
clean: $(EXTERNAL_SRCS_CLEAN) clean-install libetpan-cleanzip
Edouard@766
   312
Edouard@766
   313
#------------------------------------------------------------------------------#
Edouard@766
   314
Edouard@766
   315
.PHONY = clean clean-install libetpan-cleanzip\
Edouard@766
   316
	libgpg-error-build libgpg-error-install \
Edouard@766
   317
	libgcrypt-build libgcrypt-install \
Edouard@766
   318
	libassuan-build libassuan-install \
Edouard@766
   319
	libksba-build libksba-install \
Edouard@766
   320
	gnupg-build  gnupg-install\
Edouard@766
   321
	gpgme-build  gpgme-install\
Edouard@766
   322
	curl-build curl-install \
Edouard@766
   323
	clean-install \
Edouard@766
   324
    $(EXTERNAL_LOCAL_GITS_UPDATE) $(EXTERNAL_SRCS) $(EXTERNAL_SRCS_CLEAN) \
Edouard@766
   325
	showsetup
Edouard@766
   326