1 #This file is part of The Open GApps script of @mfonville.
3 # The Open GApps scripts are free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
8 # These scripts are distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
14 BUILD_SYSTEM
:= $(TOPDIR
)/scripts
15 BUILD_GAPPS
:= $(BUILD_SYSTEM
)/build_gapps.sh
17 PLATFORMS
:= arm arm64 x86 x86_64
19 LOWEST_API_arm64
:= 21
21 LOWEST_API_x86_64
:= 21
22 VARIANTS
:= stock full mini micro nano pico aroma fornexus
23 BUILDDIR
:= $(TOPDIR
)/build
24 OUTDIR
:= $(TOPDIR
)/out
25 LOG_BUILD
:= /tmp
/gapps_log
28 #We first define 'all' so that this is the primary make target
31 #With this you can always call e.g. 'make arm-22' or 'make arm-22-stock'
32 #to make the arm (stock) package for 5.1
33 #It will execute the build script with the platform, api (and variant) as parameter,
34 #meanwhile ensuring the minimum api for the platform that is selected
36 $(platform
= $(firstword $(subst -, ,$1)))
37 $(api
= $(word 2, $(subst -, ,$1)))
38 $(variant
= $(word 3, $(subst -, ,$1)))
39 @if
[ "$(api)" -ge
"$(LOWEST_API_$(platform))" ] && [ ! -z
"$(variant)" ] ; then\
40 echo
"Generating Open GApps $(variant) package for $(platform) with API level $(api)...";\
41 $(BUILD_GAPPS
) $(platform
) $(api
) $(variant
) 2>&1 | tee
$(LOG_BUILD
);\
42 elif
[ "$(api)" -ge
"$(LOWEST_API_$(platform))" ] && [ -z
"$(variant)" ] ; then\
43 for variant in
$(VARIANTS
);do\
44 $(BUILD_GAPPS
) $(platform
) $(api
) $$$$variant 2>&1 | tee
$(LOG_BUILD
);\
47 echo
"Illegal combination of Platform and API";\
49 @echo
"--------------------------------------------------------------------";
52 $(foreach platform
,$(PLATFORMS
),\
53 $(foreach api
,$(APIS
),\
54 $(foreach variant
,$(VARIANTS
),\
55 $(eval
$(call make-gapps
,$(platform
)-$(api
)-$(variant
)))\
58 $(foreach platform
,$(PLATFORMS
),\
59 $(foreach api
,$(APIS
),\
60 $(eval
$(call make-gapps
,$(platform
)-$(api
)))\
65 @echo
"$(tput setaf 2)Build directory removed! Ready for a clean build$(tput sgr 0)"