Created
February 12, 2016 11:09
-
-
Save caad1229/8b501cf214b62dd415fa to your computer and use it in GitHub Desktop.
Makefile for cocos2d-x
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
REPO_ROOT := $(shell pwd) | |
USERPLATFORM = $(shell uname) | |
DEPLOY_DIR = $(REPO_ROOT)/deploy | |
# | |
# set platforms | |
# | |
PLATFORMS = android | |
ifeq ($(USERPLATFORM), Linux) | |
PLATFORMS += linux | |
endif | |
ifeq ($(USERPLATFORM), Darwin) | |
PLATFORMS += ios | |
endif | |
# common | |
REMOVE=rm -fr | |
JOB=-j 8 | |
MAKE=cocos | |
default: all | |
all: $(PLATFORMS) | |
define PLATFORM_RULES | |
.PHONY: $(1) | |
$(1): | |
@$(MAKE) run -p $(1) $(JOB) | |
deploy_$(1): FORCE | |
@$(MAKE) deploy -p $(1) $(JOB) | |
build_$(1): FORCE | |
@$(MAKE) compile -p $(1) $(JOB) | |
endef | |
$(foreach a,$(PLATFORMS),$(eval $(call PLATFORM_RULES,$(a)))) | |
distclean: | |
@echo "##### clean cocos ####" | |
$(REMOVE) bin | |
$(REMOVE) cocos2d/build/build | |
$(REMOVE) cocos2d/cocos/platform/android/java/bin | |
$(REMOVE) cocos2d/cocos/platform/android/java/gen | |
$(REMOVE) cocos2d/cocos/platform/android/java/local.properties | |
clean_android: | |
@echo "##### clean android ####" | |
$(REMOVE) proj.android/assets | |
$(REMOVE) proj.android/bin | |
$(REMOVE) proj.android/gen | |
$(REMOVE) proj.android/libs/armeabi | |
$(REMOVE) proj.android/libs/x86 | |
$(REMOVE) proj.android/local.properties | |
$(REMOVE) proj.android/obj | |
clean_ios: | |
@echo "##### clean ios ####" | |
$(REMOVE) proj.ios_mac/build | |
clean_linux: | |
@echo "##### clean linux ####" | |
$(REMOVE) linux-build | |
.PHONY: all android clean clean_android clean_ios clean_linux distclean | |
FORCE: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment