1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- # -*- coding: utf-8; tab-width: 4 -*-
- # vim: ts=4 noet ai
- # Part of Rainbow Persona
- # Copyright © 2016 Desktopd Project
- #
- # This program is 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.
- #
- # This program is 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.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
- # Basic options
- addon_ext = .xpi
- git_command = git
- net_access_delay = 5
- # Silent rules resembling Automake
- default_verbosity = 0
- V_at = $(v_at_$(V))
- v_at_ = $(v_at_$(default_verbosity))
- v_at_0 = @
- v_at_1 =
- V_XPI = $(v_xpi_$(V))
- v_xpi_ = $(v_xpi_$(default_verbosity))
- v_xpi_0 = @echo ' XPI ' $@;
- v_xpi_1 =
- # Important paths
- builds_dir = ./builds
- src_dir = ./src
- version_info_path = ./version_info
- git_submodule_jpm_sh = ./tools/jpm.sh
- addon_path = $(builds_dir)/latest
- all: addon
- .PHONY: all addon git-submodule git-submodule-check deps deps-check \
- $(addon_path) clean distclean
- addon: deps-check $(addon_path)
- $(addon_path):
- $(V_at)$(V_XPI)( \
- [ "$(V_at)" ] && export JPM_SILENT=1 ;\
- buildDir=$(builds_dir)/`date +%s` ;\
- rmdir $(builds_dir)/* >/dev/null 2>&1 ;\
- mkdir -p "$$buildDir" ;\
- addonName=`$(git_submodule_jpm_sh)/bin/jpm-build.sh printPkgName 3>&1 > "$$buildDir/build.zip"` ;\
- mv "$$buildDir/build.zip" "$$buildDir/$$addonName$(addon_ext)" ;\
- cd $(builds_dir)/ ;\
- rm -f ./latest ;\
- ln -fs "`basename "$$buildDir"`" ./latest ;\
- )
- deps: git-submodule
- deps-check: git-submodule-check
- git-submodule-check:
- @[ -d $(git_submodule_jpm_sh)/bin ] || { echo "Run 'make deps' first!" ; false ;}
- git-submodule:
- @echo "Git will access online repositories!!!"
- @echo "Interrupt within $(net_access_delay) seconds if you are not ready..."
- sleep $(net_access_delay)
- @echo "Now invoking Git!"
- $(git_command) submodule update --init --recursive
|