-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
121 lines (111 loc) · 4.39 KB
/
Makefile
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
.PHONY: Download_Library Download_Basic_Libraries Update_Basic_Libraries _NOTICE
.DEFAULT_GOAL=help
LibraryURL=https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/base.zip
LibraryName=base
COM_COLOR = \033[0;34m
OBJ_COLOR = \033[0;36m
OK_COLOR = \033[0;32m
PRIMARY_COLOR = $(OK_COLOR)
ERROR_COLOR = \033[0;31m
WARN_COLOR = \033[0;33m
NO_COLOR = \033[m
help:
@echo "\n"
@awk 'BEGIN {FS = ":.*##"; } /^[a-zA-Z_-]+:.*?##/ { printf "$(PRIMARY_COLOR)%-10s$(NO_COLOR) %s\n", $$1, $$2 }' $(MAKEFILE_LIST) | sort
@echo "\n"
_NOTICE: ## Downloading a library that is allready in your lib directory will cause overwritting
_NOTICEBIS: ## WARNING, ON WINDOWS YOU NEED ZIP : http://stahlworks.com/dev/index.php?tool=zipunzip
Download_Library: ## download a library with a URL - call this with the correct parametters according to your library
ifeq ($(OS),Windows_NT)
@echo "$(OK_COLOR)"
curl -o libraries/$(LibraryName).zip '$(LibraryURL)'
@echo "$(WARN_COLOR)"
unzip libraries/$(LibraryName).zip -d libraries/
del libraries/$(LibraryName).zip
@echo "$(OK_COLOR)"
@echo "Download Successful$(NO_COLOR)"
else
@echo "$(OK_COLOR)"
curl -o libraries/$(LibraryName).zip '$(LibraryURL)'
@echo "$(WARN_COLOR)"
unzip libraries/$(LibraryName).zip -d libraries/
rm libraries/$(LibraryName).zip
@echo "$(OK_COLOR)"
@echo "Download Successful$(NO_COLOR)"
endif
Download_Basic_Libraries: ## download required - or not - basic libraries
ifeq ($(OS),Windows_NT)
@echo "$(NO_COLOR)"
curl -o libraries/base.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/base.zip'
@echo "$(WARN_COLOR)"
unzip libraries/base.zip -d libraries/
@echo "$(NO_COLOR)"
del libraries/base.zip
curl -o libraries/stdio.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/stdio.zip'
@echo "$(WARN_COLOR)"
unzip libraries/stdio.zip -d libraries/
del libraries/stdio.zip
@echo "$(OK_COLOR)"
@echo "Download Successful$(NO_COLOR)"
else
@echo "$(NO_COLOR)"
curl -o libraries/base.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/base.zip'
@echo "$(WARN_COLOR)"
unzip libraries/base.zip -d libraries/
@echo "$(NO_COLOR)"
rm libraries/base.zip
curl -o libraries/stdio.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/stdio.zip'
@echo "$(WARN_COLOR)"
unzip libraries/stdio.zip -d libraries/
rm libraries/stdio.zip
@echo "$(OK_COLOR)"
@echo "Download Successful$(NO_COLOR)"
endif
Update_Basic_Libraries: ## update required - or not - basic libraries WARNING: YOUR PREVIOUS VERSION WILL BE OVERWRITTEN
ifeq ($(OS),Windows_NT)
@echo "$(NO_COLOR)"
curl -o libraries/base.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/base.zip'
@echo "$(WARN_COLOR)"
del -r libraries/base/
unzip libraries/base.zip -d libraries/
del libraries/base.zip
@echo "$(NO_COLOR)"
curl -o libraries/stdio.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/stdio.zip'
@echo "$(WARN_COLOR)"
del -r libraries/stdio/
unzip libraries/stdio.zip -d libraries/
del libraries/stdio.zip
@echo "$(NO_COLOR)"
@echo "Updation Successful!!$(NO_COLOR)"
else
@echo "$(NO_COLOR)"
curl -o libraries/base.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/base.zip'
@echo "$(WARN_COLOR)"
rm -r libraries/base/
unzip libraries/base.zip -d libraries/
rm libraries/base.zip
@echo "$(NO_COLOR)"
curl -o libraries/stdio.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/stdio.zip'
@echo "$(WARN_COLOR)"
rm -r libraries/stdio/
unzip libraries/stdio.zip -d libraries/
rm libraries/stdio.zip
@echo "$(NO_COLOR)"
@echo "Updation Successful!!$(NO_COLOR)"
endif
KeyPHP_Download_Library_FROM_REPO: ## download a library by name from the official repo (WARNING!!! the repo is not made yet)
ifeq ($(OS),Windows_NT)
@echo "$(NO_COLOR)"
curl -o libraries/$(LibraryName).zip 'https://keyphp.pylott.yt/librepo/download?n=$(LibraryName)&v=latest'
@echo "$(WARN_COLOR)"
unzip libraries/$(LibraryName).zip -d libraries/
del libraries/$(LibraryName).zip
@echo "$(NO_COLOR)"
@echo "Download Successful$(NO_COLOR)"
else
endif
GET_Libraries_FROM_REPO: ## return a list of every libraries on the repo (WARNING!!! the repo is not made yet)
@echo "$(NO_COLOR)"
curl -o libraries/list.txt 'https://keyphp.pylott.yt/librepo/list.txt'
StartApp: ## Starts the application
php ENV.php > logs/latest.log;