Dotclear

source: Makefile @ 3717:a047e0d3d327

Revision 3717:a047e0d3d327, 4.0 KB checked in by franck <carnet.franck.paul@…>, 7 years ago (diff)

Update makefile

RevLine 
[2558]1.PHONY: config-stamp
2
[0]3SHELL=/bin/sh
4DIST=_dist
5DC=$(DIST)/dotclear
6
7default:
8     @echo "make config or make dist"
9
[2558]10config: clean config-stamp
[0]11     mkdir -p ./$(DC)
[2537]12
[0]13     ## Copy needed folders and files
[2558]14     cp -pRf ./admin ./inc ./index.php ./CHANGELOG ./CREDITS ./LICENSE ./README.md ./CONTRIBUTING.md ./$(DC)/
[2537]15
[0]16     ## Locales directory
17     mkdir -p ./$(DC)/locales
18     cp -pRf ./locales/README ./locales/en ./locales/fr ./$(DC)/locales/
[2537]19
[3717]20     ## Remove tests directories and test stuff, idem for doxygen documentation
[2931]21     rm -fr ./$(DC)/inc/libs/clearbricks/tests ./$(DC)/inc/libs/clearbricks/composer.*    \
22            ./$(DC)/inc/libs/clearbricks/.atoum.* ./$(DC)/inc/libs/clearbricks/vendor     \
23            ./$(DC)/inc/libs/clearbricks/bin ./$(DC)/inc/libs/clearbricks/_dist      \
[3717]24            ./$(DC)/.atoum.* ./$(DC)/tests ./$(DC)/travis                       \
25            ./$(DC)/features ./$(DC)/travis ./$(DC)/behat.yml.dist ./$(DC)/composer.* \
26         ./$(DC)/doxygen ./$(DC)/clearbricks/doxygen
[2558]27
[3260]28     ## Create cache, var, db, plugins, themes and public folders
29     mkdir ./$(DC)/cache ./$(DC)/var ./$(DC)/db ./$(DC)/plugins ./$(DC)/themes ./$(DC)/public
[2558]30     cp -p inc/.htaccess ./$(DC)/cache/
[3260]31     cp -p inc/.htaccess ./$(DC)/var/
[2558]32     cp -p inc/.htaccess ./$(DC)/db/
33     cp -p inc/.htaccess ./$(DC)/plugins/
[2537]34
[0]35     ## Remove config file if any
36     rm -f ./$(DC)/inc/config.php
[2537]37
[2558]38     ## Copy built-in themes
39     cp -pRf \
40     ./themes/default \
41     ./themes/blueSilence \
42     ./themes/customCSS \
43     ./themes/ductile \
[2642]44     ./themes/berlin \
[2558]45     ./$(DC)/themes/
46
[2615]47     ## Copy built-in plugins based on DC_DISTRIB_PLUGINS constant
48     cp -pRf $$(grep DC_DISTRIB_PLUGINS inc/prepend.php | \
[3714]49          sed -e "s/.*, *'//" -e "s/'.*//" | \
[2615]50          sed -e  's/\(^\|,\)/ .\/plugins\//g') \
[0]51     ./$(DC)/plugins/
[2537]52
[0]53     ## "Compile" .po files
54     ./build-tools/make-l10n.php ./$(DC)/
[2537]55
[0]56     ## Pack javascript files
57     find $(DC)/admin/js/*.js -exec ./build-tools/min-js.php \{\} \;
[3305]58     find $(DC)/admin/js/codemirror -name '*.js' -exec ./build-tools/min-js.php \{\} \;
[0]59     find $(DC)/admin/js/jquery/*.js -exec ./build-tools/min-js.php \{\} \;
[1451]60     find $(DC)/admin/js/jsUpload/*.js -exec ./build-tools/min-js.php \{\} \;
[0]61     find $(DC)/plugins -name '*.js' -exec ./build-tools/min-js.php \{\} \;
62     find $(DC)/themes/default/js/*.js -exec ./build-tools/min-js.php \{\} \;
[2801]63     find $(DC)/inc/js -name '*.js' -exec ./build-tools/min-js.php \{\} \;
[2537]64
[0]65     ## Debug off
66     perl -pi -e "s|^//\*== DC_DEBUG|/*== DC_DEBUG|sgi;" $(DC)/inc/prepend.php $(DC)/inc/prepend.php
[2537]67
[2558]68     ## Remove scm files and folders from DC and CB
69     find ./$(DIST)/ -type d -name '.svn' | xargs -r rm -rf
70     find ./$(DIST)/ -type d -name '.hg'  | xargs -r rm -rf
71     find ./$(DIST)/ -type d -name '.git' | xargs -r rm -rf
72     find ./$(DIST)/ -type f -name '.*ignore' | xargs -r rm -rf
[2896]73     find ./$(DIST)/ -type f -name '.flow' | xargs -r rm -rf
[2558]74
[0]75     ## Create digest
76     cd $(DC) && ( \
[3260]77          md5sum `find . -type f -not -path "./inc/digest" -not -path "./cache/*" -not -path "./var/*" -not -path "./db/*" -not -path ./CHANGELOG` \
[0]78          > inc/digests \
79     )
[2537]80
[0]81     touch config-stamp
82
83dist: config dist-tgz dist-zip dist-l10n
84
85deb:
[1581]86     cp ./README.md debian/README
[0]87     dpkg-buildpackage -rfakeroot
88
89dist-tgz:
90     [ -f config-stamp ]
91     cd $(DIST) && tar cfz dotclear-$$(grep DC_VERSION dotclear/inc/prepend.php | cut -d"'" -f4).tar.gz ./dotclear
92
93dist-zip:
94     [ -f config-stamp ]
95     cd $(DIST) && zip -r9 dotclear-$$(grep DC_VERSION dotclear/inc/prepend.php | cut -d"'" -f4).zip ./dotclear
96
97dist-l10n:
98     [ -f config-stamp ]
[2537]99
[0]100     rm -rf ./$(DIST)/l10n
101     mkdir -p ./$(DIST)/l10n
[2537]102
[0]103     find ./locales/ -maxdepth 1 -mindepth 1 -type d -not -name '.svn' -not -name '_pot' -not -name 'en' \
104     -exec cp -pRf \{\} ./$(DIST)/l10n/ \;
[2537]105
[0]106     find ./$(DIST)/l10n -type d -name '.svn' | xargs rm -rf
107     ./build-tools/make-l10n.php ./$(DIST)/l10n/
[2537]108
[0]109     cd ./$(DIST)/l10n && for i in *; do \
110          zip -r9 "$$i-$$(grep DC_VERSION ../dotclear/inc/prepend.php | cut -d"'" -f4).zip" "$$i"; \
111          rm -rf "$$i"; \
112     done
[2537]113
[0]114
115clean:
[2558]116     rm -rf $(DIST) config-stamp
[0]117
118
119## Modules (Themes and Plugins) ###############################################
120pack-tool:
121     [ "$(ipath)" != '' ]
122     [ "$(iname)" != '' ]
123     [ "$(iname)" != '' ]
124     [ -d $(ipath)/$(iname) ]
[2537]125
126
[2615]127copy-plugins: clean
Note: See TracBrowser for help on using the repository browser.

Sites map