Makefile 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. # *****************************************************************************
  2. # ηMatrix - a browser extension to black/white list requests.
  3. # Copyright (C) 2019-2020 Alessio Vanni
  4. # Modified 2022 by Jesus E.
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see {http://www.gnu.org/licenses/}.
  15. # Home: https://c.hgit.ga/software/ematrix.git
  16. # uMatrix Home: https://github.com/gorhill/uMatrix
  17. # To build the XPI we explicitly list every file for these reasons:
  18. # 1) Some editors (like mine) automatically generate a backup file,
  19. # and always removing it before building the archive is bothersome
  20. # (and I don't trust my scripting skills to make it automatic)
  21. # 2) It gives some flexibility in that files can be created or deleted
  22. # freely as long as they are not part of any of these lists
  23. VERSION := 3.1.4
  24. help:
  25. @echo 'Makefile for generate eMatrix '
  26. @echo ' '
  27. @echo 'Usage: '
  28. @echo ' make all generate eMatrix.xpi '
  29. @echo ' make clean remove eMatrix.xpi '
  30. @echo ' '
  31. DIST := dist/
  32. ROOTMETA := bootstrap.js install.rdf chrome.manifest icon.png \
  33. LICENSE.txt options.xul
  34. ROOTHTML := about.html asset-viewer.html background.html \
  35. cloud-ui.html dashboard.html hosts-files.html \
  36. logger-ui.html main-blocked.html popup.html \
  37. raw-settings.html settings.html user-rules.html
  38. ROOTOTHER := frameScript.js
  39. ROOT := $(ROOTMETA) $(ROOTHTML) $(ROOTOTHER)
  40. ASSETS := assets/assets.json
  41. CSSSHEET := css/cloud-ui.css css/common.css css/dashboard-common.css \
  42. css/dashboard.css css/hosts-files.css \
  43. css/legacy-toolbar-button.css css/logger-ui.css \
  44. css/popup.css css/raw-settings.css css/user-rules.css
  45. CSSFONTS := css/fonts/fontawesome-webfont.ttf \
  46. css/fonts/Roboto_Condensed/LICENSE.txt \
  47. css/fonts/Roboto_Condensed/RobotoCondensed-Bold.ttf \
  48. css/fonts/Roboto_Condensed/RobotoCondensed-Light.ttf \
  49. css/fonts/Roboto_Condensed/RobotoCondensed-Regular.ttf
  50. CSS := $(CSSSHEET) $(CSSFONTS)
  51. IMGICON := img/browsericons/icon19-0.png \
  52. img/browsericons/icon19-1.png \
  53. img/browsericons/icon19-2.png \
  54. img/browsericons/icon19-3.png \
  55. img/browsericons/icon19-4.png \
  56. img/browsericons/icon19-5.png \
  57. img/browsericons/icon19-6.png \
  58. img/browsericons/icon19-7.png \
  59. img/browsericons/icon19-8.png \
  60. img/browsericons/icon19-9.png \
  61. img/browsericons/icon19-10.png \
  62. img/browsericons/icon19-11.png \
  63. img/browsericons/icon19-12.png \
  64. img/browsericons/icon19-13.png \
  65. img/browsericons/icon19-14.png \
  66. img/browsericons/icon19-15.png \
  67. img/browsericons/icon19-16.png \
  68. img/browsericons/icon19-17.png \
  69. img/browsericons/icon19-18.png \
  70. img/browsericons/icon19-19.png \
  71. img/browsericons/icon38-off.png \
  72. img/browsericons/icon19-off.png
  73. IMGOTHER := img/cloud.png img/icon_16.png img/icon_64.png \
  74. img/matrix-group-hide.png img/matrix-group-hline.png \
  75. img/matrix-group-show.png img/permanent-black-small.png \
  76. img/permanent-black-small-cb.png \
  77. img/permanent-white-small.png \
  78. img/permanent-black-small-cb.png
  79. IMG := $(IMGICON) $(IMGOTHER)
  80. LIB := lib/PublicSuffixList.jsm lib/Punycode.jsm lib/FrameModule.jsm \
  81. lib/CallbackWrapper.jsm lib/HttpRequestHeaders.jsm \
  82. lib/PendingRequests.jsm lib/CookieCache.jsm lib/UriTools.jsm \
  83. lib/LiquidDict.jsm lib/HostMap.jsm lib/Tools.jsm \
  84. lib/RowSnapshot.jsm
  85. # The locale folder is split into parts because it's a long list
  86. # and it's somewhat easier to read this way
  87. LOC1 := locale/en/messages.properties locale/bg/messages.properties \
  88. locale/cs/messages.properties locale/de/messages.properties \
  89. locale/el/messages.properties
  90. LOC2 := locale/es/messages.properties locale/fr/messages.properties \
  91. locale/hu/messages.properties locale/it/messages.properties \
  92. locale/ko/messages.properties locale/nl/messages.properties \
  93. locale/pl/messages.properties
  94. LOC3 := locale/pt-BR/messages.properties \
  95. locale/pt-PT/messages.properties \
  96. locale/ru/messages.properties locale/sv/messages.properties \
  97. locale/tr/messages.properties locale/uk/messages.properties \
  98. locale/zh-CN/messages.properties
  99. LOCALE := $(LOC1) $(LOC2) $(LOC3)
  100. # The js folder is split into parts because it's a long list
  101. # and it's somewhat easier to read this way
  102. JS1 := js/about.js js/assets.js js/asset-viewer.js js/background.js \
  103. js/browsercache.js js/cloud-ui.js js/contentscript.js \
  104. js/contentscript-start.js js/cookies.js js/dashboard-common.js \
  105. js/dashboard.js js/hosts-files.js
  106. JS2 := js/httpsb.js js/i18n.js js/logger.js js/logger-ui.js \
  107. js/main-blocked.js js/matrix.js js/messaging.js \
  108. js/pagestats.js js/popup.js js/profiler.js js/raw-settings.js \
  109. js/settings.js js/start.js js/storage.js
  110. JS3 := js/tab.js js/traffic.js js/udom.js js/user-rules.js \
  111. js/usersettings.js js/xal.js
  112. JS4 := js/vapi-client.js js/vapi-common.js js/vapi-background.js \
  113. js/vapi-tabs.js js/vapi-window.js js/vapi-core.js \
  114. js/vapi-browser.js js/vapi-storage.js js/vapi-messaging.js \
  115. js/vapi-net.js js/vapi-cookies.js js/vapi-cloud.js
  116. JS := $(JS1) $(JS2) $(JS3) $(JS4)
  117. all: eMatrix.xpi
  118. eMatrix.xpi: $(ROOT) $(ASSETS) $(CSS) $(IMG) $(LIB) $(LOCALE) $(JS)
  119. @install -d -m755 $(DIST)/$(VERSION)
  120. @zip -r $(DIST)/$(VERSION)/eMatrix-$(VERSION).xpi $^
  121. .PHONY: clean
  122. clean:
  123. @rm -fr $(DIST)