-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
88 lines (54 loc) · 1.53 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
LOCAL_SERVER_DIR = '/srv/http/'
R := '\033[31m'
ifneq (, $(shell command -v lolcat))
R := | lolcat
endif
RED='\033[0;31m'
GREEN='\033[0;32m'
RESET='\033[0m'
WARNING := "[${RED}!${RESET}]"
SUCCESS := "[${GREEN}+${RESET}]"
all: header install clean
header:
@ echo -e '\nXi-Tech - By Sigmanificient\n' $(R)
distclean: clean header
@ rm -f server/.env server/.env.local
@ rm -f client/package-lock.json
clean: header
@ # Remove old build
@ rm -rf dist
@ # Remove client build & node_modules
@ rm -rf server/build
server/composer.lock:
@ composer update -d server
server/vendor: server/composer.lock server/composer.json
@ composer install -d server
server/build: server/vendor
@ mkdir -p server/build
@ cp -r server/api server/build
@ cp -r server/core server/build
@ cp -r server/public server/build
@ cp -r server/composer.json server/build
@ echo '*' > server/build/.gitignore
client/dist: client/node_modules
@ npm run build --prefix client
client/node_modules: client/package-lock.json
@ npm install --prefix client
dist: header server/build client/dist
@ # Build server
@ mkdir -p dist
@ cp -r server/build/* dist
@ cp -r client/dist/* dist/public
$(LOCAL_SERVER_DIR): header dist
@ # Copy server files
@ cp -r dist/* $(LOCAL_SERVER_DIR)
@ echo "Server files copied to $(LOCAL_SERVER_DIR)"
install: header $(LOCAL_SERVER_DIR)
reinstall:
make clean
make install
cd /srv/http/ && composer update
make clean
uninstall: header
@ rm -rf $(LOCAL_SERVER_DIR)/*
.PHONY: header clean distclean install uninstall