Skip to content

Commit 420eaa4

Browse files
authored
Refactor Makefile for improved readability and structure
1 parent 7536c0f commit 420eaa4

1 file changed

Lines changed: 51 additions & 42 deletions

File tree

app/Makefile

Lines changed: 51 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,65 +7,74 @@ VERSION := $(shell grep -o "MasterPDFEditor:.*" README.md | cut -d ' ' -f2)
77

88
all: clean init
99

10-
mkdir --parents $(PWD)/build/Boilerplate.AppDir/mpe
11-
$(PWD)/bin/Apprepo.AppImage --destination=$(PWD)/build appdir boilerplate libatk1.0-0 libpkcs11-helper1
10+
mkdir --parents $(PWD)/build/Boilerplate.AppDir/mpe
11+
$(PWD)/bin/Apprepo.AppImage --destination=$(PWD)/build appdir boilerplate libatk1.0-0 libpkcs11-helper1
1212

13-
# Check download links here:
14-
# https://code-industry.net/free-pdf-editor/
13+
# Check download links here:
14+
# https://code-industry.net/free-pdf-editor/
1515

16-
echo "MasterPDFEditor version: $(VERSION)"
16+
echo "MasterPDFEditor version: $(VERSION)"
1717

18-
#wget --output-document=$(PWD)/build/build.deb https://code-industry.net/public/master-pdf-editor-$(VERSION)-qt5_included.x86_64.deb
19-
#wget --output-document=$(PWD)/build/build.deb https://code-industry.net/public/master-pdf-editor-$(VERSION)-qt5.9.x86_64.deb
20-
wget --output-document=$(PWD)/build/build.deb https://code-industry.net/public/master-pdf-editor-$(VERSION)-qt5.x86_64.deb
18+
#wget --output-document=$(PWD)/build/build.deb https://code-industry.net/public/master-pdf-editor-$(VERSION)-qt5_included.x86_64.deb
19+
#wget --output-document=$(PWD)/build/build.deb https://code-industry.net/public/master-pdf-editor-$(VERSION)-qt5.9.x86_64.deb
20+
wget --output-document=$(PWD)/build/build.deb https://code-industry.net/public/master-pdf-editor-$(VERSION)-qt5.x86_64.deb
2121

22-
dpkg -x $(PWD)/build/build.deb $(PWD)/build
22+
dpkg -x $(PWD)/build/build.deb $(PWD)/build
2323

24-
cp --force --recursive $(PWD)/build/opt/master-pdf-editor*/* $(PWD)/build/Boilerplate.AppDir/mpe
24+
cp --force --recursive $(PWD)/build/opt/master-pdf-editor*/* $(PWD)/build/Boilerplate.AppDir/mpe
2525

26-
rm -f $(PWD)/build/Boilerplate.AppDir/mpe/*.desktop || true
27-
rm -f $(PWD)/build/Boilerplate.AppDir/mpe/*.png || true
28-
rm -f $(PWD)/build/Boilerplate.AppDir/mpe/*.svg || true
29-
rm -f $(PWD)/build/Boilerplate.AppDir/mpe/*.jpg || true
30-
rm -f $(PWD)/build/Boilerplate.AppDir/mpe/*.sh || true
26+
rm -f $(PWD)/build/Boilerplate.AppDir/mpe/*.desktop || true
27+
rm -f $(PWD)/build/Boilerplate.AppDir/mpe/*.png || true
28+
rm -f $(PWD)/build/Boilerplate.AppDir/mpe/*.svg || true
29+
rm -f $(PWD)/build/Boilerplate.AppDir/mpe/*.jpg || true
30+
rm -f $(PWD)/build/Boilerplate.AppDir/mpe/*.sh || true
3131

32-
mv $(PWD)/build/Boilerplate.AppDir/mpe/help/MasterPDFEditor-UserManual_EN.pdf $(PWD)/build/
32+
mv $(PWD)/build/Boilerplate.AppDir/mpe/help/MasterPDFEditor-UserManual_EN.pdf $(PWD)/build/
3333

34-
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
35-
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
36-
echo 'LD_LIBRARY_PATH=$${LD_LIBRARY_PATH}:$${APPDIR}/mpe' >> $(PWD)/build/Boilerplate.AppDir/AppRun
37-
echo 'export LD_LIBRARY_PATH=$${LD_LIBRARY_PATH}' >> $(PWD)/build/Boilerplate.AppDir/AppRun
38-
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
39-
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
40-
echo 'exec $${APPDIR}/mpe/masterpdfeditor* "$${@}"' >> $(PWD)/build/Boilerplate.AppDir/AppRun
34+
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
35+
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
36+
echo 'LD_LIBRARY_PATH=$${LD_LIBRARY_PATH}:$${APPDIR}/mpe' >> $(PWD)/build/Boilerplate.AppDir/AppRun
37+
echo 'export LD_LIBRARY_PATH=$${LD_LIBRARY_PATH}' >> $(PWD)/build/Boilerplate.AppDir/AppRun
38+
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
39+
echo '' >> $(PWD)/build/Boilerplate.AppDir/AppRun
40+
echo 'exec $${APPDIR}/mpe/masterpdfeditor* "$${@}"' >> $(PWD)/build/Boilerplate.AppDir/AppRun
4141

42-
rm -f $(PWD)/build/Boilerplate.AppDir/*.desktop || true
43-
rm -f $(PWD)/build/Boilerplate.AppDir/*.png || true
44-
rm -f $(PWD)/build/Boilerplate.AppDir/*.svg || true
45-
rm -f $(PWD)/build/Boilerplate.AppDir/*.jpg || true
42+
rm -f $(PWD)/build/Boilerplate.AppDir/*.desktop || true
43+
rm -f $(PWD)/build/Boilerplate.AppDir/*.png || true
44+
rm -f $(PWD)/build/Boilerplate.AppDir/*.svg || true
45+
rm -f $(PWD)/build/Boilerplate.AppDir/*.jpg || true
4646

47-
cp --force $(PWD)/AppDir/*.svg $(PWD)/build/Boilerplate.AppDir || true
48-
cp --force $(PWD)/AppDir/*.desktop $(PWD)/build/Boilerplate.AppDir || true
49-
cp --force $(PWD)/AppDir/*.png $(PWD)/build/Boilerplate.AppDir || true
47+
cp --force $(PWD)/AppDir/*.svg $(PWD)/build/Boilerplate.AppDir || true
48+
cp --force $(PWD)/AppDir/*.desktop $(PWD)/build/Boilerplate.AppDir || true
49+
cp --force $(PWD)/AppDir/*.png $(PWD)/build/Boilerplate.AppDir || true
5050

51-
chmod +x $(PWD)/build/Boilerplate.AppDir/AppRun
51+
chmod +x $(PWD)/build/Boilerplate.AppDir/AppRun
5252

53-
cp README.md $(PWD)/build/Boilerplate.AppDir/
53+
cp README.md $(PWD)/build/Boilerplate.AppDir/
5454

55-
export ARCH=x86_64 && $(PWD)/bin/appimagetool.AppImage $(PWD)/build/Boilerplate.AppDir $(PWD)/MasterPDFEditor.AppImage
56-
chmod +x $(PWD)/MasterPDFEditor.AppImage
57-
mv $(PWD)/MasterPDFEditor.AppImage $(PWD)/MasterPDFEditor-$(VERSION)-x86_64-1_JB.AppImage
58-
md5sum $(PWD)/MasterPDFEditor-$(VERSION)-x86_64-1_JB.AppImage > $(PWD)/MasterPDFEditor-$(VERSION)-x86_64-1_JB.AppImage.md5
59-
ls -lah
55+
export ARCH=x86_64 && $(PWD)/bin/appimagetool.AppImage $(PWD)/build/Boilerplate.AppDir $(PWD)/MasterPDFEditor.AppImage
56+
chmod +x $(PWD)/MasterPDFEditor.AppImage
57+
mv $(PWD)/MasterPDFEditor.AppImage $(PWD)/MasterPDFEditor-$(VERSION)-x86_64-1_JB.AppImage
58+
md5sum $(PWD)/MasterPDFEditor-$(VERSION)-x86_64-1_JB.AppImage > $(PWD)/MasterPDFEditor-$(VERSION)-x86_64-1_JB.AppImage.md5
59+
ls -lah
6060

6161
init:
62-
mkdir --parents $(PWD)/bin
62+
mkdir --parents $(PWD)/bin
6363

64-
#wget https://apprepo.de/appimage/download/apprepo --output-document=$(PWD)/bin/Apprepo.AppImage
65-
wget https://github.com/ryuuzaki42/MasterPDFEditor_AppImage_4/releases/download/Apprepo/apprepo-8891304-Mar.28.2023.AppImage --output-document=$(PWD)/bin/Apprepo.AppImage
66-
chmod +x $(PWD)/bin/Apprepo.AppImage
64+
#wget https://apprepo.de/appimage/download/apprepo --output-document=$(PWD)/bin/Apprepo.AppImage
65+
wget https://github.com/ryuuzaki42/MasterPDFEditor_AppImage_4/releases/download/Apprepo/apprepo-8891304-Mar.28.2023.AppImage --output-document=$(PWD)/bin/Apprepo.AppImage
66+
chmod +x $(PWD)/bin/Apprepo.AppImage
6767

68-
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \
68+
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \
69+
--output-document=$(PWD)/bin/appimagetool.AppImage
70+
71+
chmod +x $(PWD)/bin/appimagetool.AppImage
72+
73+
clean:
74+
rm -rf $(PWD)/*.AppImage
75+
rm -rf $(PWD)/bin/*
76+
rm -rf $(PWD)/build
77+
/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \
6978
--output-document=$(PWD)/bin/appimagetool.AppImage
7079

7180
chmod +x $(PWD)/bin/appimagetool.AppImage

0 commit comments

Comments
 (0)