forked from opengapps/opengapps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (43 loc) · 1.8 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#This file is part of The Open GApps script of @mfonville.
#
# The Open GApps scripts are free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# These scripts are distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
TOPDIR := .
BUILD_SYSTEM := $(TOPDIR)/scripts
BUILD_GAPPS := $(BUILD_SYSTEM)/build_gapps.sh
API_LEVELS := 19 21 22
PLATFORMS := arm arm64 x86 x86_64
LOWESTAPI_arm := 19
LOWESTAPI_arm64 := 21
LOWESTAPI_x86 := 19
LOWESTAPI_x86_64 := 21
BUILDDIR := $(TOPDIR)/build
OUTDIR := $(TOPDIR)/out
LOG_BUILD := /tmp/gapps_log
define make-gapps
#We first define 'all' so that this is the primary make target
all:: $1
#With this you can always call e.g. 'make arm-22' just to make only the arm packages for 5.1
#It will execute the build script with the platform and api as parameter,
#meanwhile ensuring the minimum api for the platform that is selected
$1:
$(platform = $(firstword $(subst -, ,$1)))
$(api = $(word 2, $(subst -, ,$1)))
@if [ "$(api)" -ge "$(LOWESTAPI_$(platform))" ] ; then\
echo "Generating Open GApps package for $(platform) with API level $(api)...";\
$(BUILD_GAPPS) $(platform) $(api) 2>&1 | tee $(LOG_BUILD);\
echo "--------------------------------------------------------------------";\
fi
endef
$(foreach platform,$(PLATFORMS),$(foreach api,$(API_LEVELS),$(eval $(call make-gapps,$(platform)-$(api)))))
distclean:
@rm -fr $(BUILDDIR)
@echo "$(tput setaf 2)Build directory removed! Ready for a clean build$(tput sgr 0)"