Created
November 18, 2015 09:11
-
-
Save stanislaw/1bfa9b283890b1d57668 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME=AFNetworking | |
VERSION=2.5.4 | |
GH_REPO=AFNetworking/AFNetworking | |
### Paths | |
COMPONENTS_CACHE_PATH ?= $HOME/Library/Caches/Ports | |
COMPONENT_CACHE_PATH=$(COMPONENTS_CACHE_PATH)/$(NAME) | |
COMPONENT_SOURCE_PATH=$(COMPONENT_CACHE_PATH)/$(NAME)-${VERSION} | |
ZIPBALL_PATH=$(COMPONENT_CACHE_PATH)/$(NAME)-$(VERSION).zip | |
COMPONENTS_INSTALL_PATH ?= ./Components | |
COMPONENT_INSTALL_DIR=$(COMPONENTS_INSTALL_PATH)/$(NAME)/ | |
COMPONENT_INSTALL_PATH=$(COMPONENTS_INSTALL_PATH)/$(NAME)/$(NAME) | |
### URLs | |
GH_URL=https://github.com | |
ZIPBALL_URL=${GH_URL}/${GH_REPO}/archive/${VERSION}.zip | |
### Targets | |
.PHONY: install update uninstall clean prepare purge | |
install: prepare $(ZIPBALL_PATH) $(COMPONENT_SOURCE_PATH) $(COMPONENT_INSTALL_PATH) | |
uninstall: | |
rm -rf $(COMPONENT_INSTALL_PATH) | |
update: uninstall install | |
clean: | |
rm -rf $(COMPONENT_SOURCE_PATH) | |
rm -rf $(ZIPBALL_PATH) | |
prepare: $(COMPONENT_CACHE_PATH) $(COMPONENT_INSTALL_PATH) | |
purge: uninstall clean | |
### Artefacts | |
$(COMPONENT_INSTALL_PATH): | |
cp $(COMPONENT_SOURCE_PATH)/${NAME}/* $(COMPONENT_INSTALL_PATH) | |
cp $(COMPONENT_SOURCE_PATH)/UIKit+${NAME}/* $(COMPONENT_INSTALL_PATH) | |
$(COMPONENT_SOURCE_PATH): | |
unzip $(ZIPBALL_PATH) -d ${COMPONENT_CACHE_PATH} | |
$(ZIPBALL_PATH): | |
wget ${ZIPBALL_URL} -O $@ | |
rm -rf $(COMPONENT_INSTALL_PATH) | |
$(COMPONENT_CACHE_PATH): | |
mkdir ${COMPONENT_CACHE_PATH} | |
$(COMPONENT_INSTALL_DIR): | |
mkdir $@ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment