forked from VolkanSah/WP-Claude-Interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
143 lines (112 loc) · 3.4 KB
/
Copy pathMakefile
File metadata and controls
143 lines (112 loc) · 3.4 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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Makefile for WP-Claude-Interface
# ----------
# Macros
SHELL := /bin/bash
mProj = WP-Claude-Interface
mProduct = dist/claude-chat-interface-VERSION.zip
mBuildList = \
dist/claude-chat-interface \
dist/claude-chat-interface/css \
dist/claude-chat-interface/js \
dist/claude-chat-interface/claude.php \
dist/claude-chat-interface/claude3.png \
dist/claude-chat-interface/claude_set.png \
dist/claude-chat-interface/readme.txt \
dist/claude-chat-interface/LICENSE
mServer = moria.whyayh.com
mPubDev = /rel/development/software/own/$(mProj)
mPubRel = /rel/released/software/own/$(mProj)
# ----------
# Main Targets
usage :
@echo "Usage:"
@echo "build - build dist/ with dirs and files to be installed"
@echo "incPatch, incMinor, or incMajor - before save or publish"
@echo " Update Changelog in readme.txt"
@echo "save - create plugin install zip file, and cp to development"
@echo "publish - copy zip files to release area"
@echo "clean - rm tmp files"
@echo "dist-clean - clean and remove dist dir"
update :
git co develop
git pull origin develop
build : clean update README.md $(mProduct)
@echo 'If OK, make save'
save development : check-dev
-git ci -am Updated
git push origin develop
-ssh $(mServer) mkdir -p $(mPubDev)
rsync -a README.org readme.txt dist/claude-chat-interface-$$(cat VERSION).zip $(mServer):$(mPubDev)
cp VERSION VERSION-dev
-git ci -am Updated
git push origin develop
@echo 'If OK, make publish'
publish release : check-rel
-git ci -am Updated
git tag -f "ver-$$(cat VERSION)"
git push --tags origin develop
git co main
git pull --tags origin main
git merge develop
git push --tags origin main
git co develop
-ssh $(mServer) mkdir -p $(mPubRel)
rsync -a README.org readme.txt dist/claude-chat-interface-$$(cat VERSION).zip $(mServer):$(mPubRel)
cp VERSION VERSION-rel
-git ci -am Updated
git push origin develop
@echo 'If done, make dist-clean'
clean :
-find . -type f -name '*~' -exec rm {} \;
-rm -rf dist
dist-clean : clean
-rm -rf dist tmp
# ----------
# Work Targets
$(mProduct) : $(mBuildList)
php -l claude.php
cd dist; zip -r claude-chat-interface-$$(cat ../VERSION).zip claude-chat-interface
-touch $@
README.md : README.org VERSION
pandoc -f org -t markdown <README.org >$@
sed -i "s/VERSION/$$(cat VERSION)/" $@
sed -i 's/^\[version]/![version]/' $@
sed -i 's/^\[WordPress]/![WordPress]/' $@
check-dev :
if diff -q VERSION VERSION-dev >/dev/null 2>&1; then \
echo "Development versions must be different."; \
echo "increment and rebuild."; \
exit 1; \
fi
check-rel :
if diff -q VERSION VERSION-rel >/dev/null 2>&1; then \
echo "Released versions must be different."; \
echo "increment and rebuild."; \
exit 1; \
fi
# ----------
# Single Targets
VERSION :
echo '0.0.0' >$@
incPatch : VERSION
incver.sh -p
incMinor : VERSION
incver.sh -m
incMajor : VERSION
incver.sh -M
dist/claude-chat-interface :
-mkdir -p $@
dist/claude-chat-interface/css : css
rsync -r $? dist/claude-chat-interface/
dist/claude-chat-interface/js : js
rsync -r $? dist/claude-chat-interface/
dist/claude-chat-interface/claude.php : claude.php
sed "s/VERSION/$$(cat VERSION)/" <$? >$@
dist/claude-chat-interface/readme.txt : readme.txt
sed "s/VERSION/$$(cat VERSION)/" <$? >$@
dist/claude-chat-interface/claude3.png : claude3.png
cp $? $@
dist/claude-chat-interface/claude_set.png : claude_set.png
cp $? $@
dist/claude-chat-interface/LICENSE : LICENSE
cp $? $@