-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (55 loc) · 1.34 KB
/
Makefile
File metadata and controls
66 lines (55 loc) · 1.34 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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)
package_$(1): FORCE
@$(MAKE) package -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: