Lines 39-46
tmpDir:=$(CURDIR)/tmp
Link Here
|
39 |
themesDir:=$(tmpDir)/dijit/themes |
39 |
themesDir:=$(tmpDir)/dijit/themes |
40 |
jsFiles:=$(shell find umc -name "*.js") |
40 |
jsFiles:=$(shell find umc -name "*.js") |
41 |
|
41 |
|
42 |
.PHONY: build build-dev build-common install clean jslint i18n umc/package.json $(tmpDir)/umc/login.html $(buildDir)/index.html $(buildDir)/debug.html |
42 |
.PHONY: build |
43 |
|
|
|
44 |
build: build-common $(tmpDir) $(buildDir)/js/dojo/dojo.js.uncompressed.js $(themesDir)/umc |
43 |
build: build-common $(tmpDir) $(buildDir)/js/dojo/dojo.js.uncompressed.js $(themesDir)/umc |
45 |
|
44 |
|
46 |
# the automatically generated module umc/widgets contains a require to all umc widgets |
45 |
# the automatically generated module umc/widgets contains a require to all umc widgets |
Lines 51-58
umc/widgets.js:
Link Here
|
51 |
done; \ |
50 |
done; \ |
52 |
echo "define([$${deplist%, }], function() { })" > $@ |
51 |
echo "define([$${deplist%, }], function() { })" > $@ |
53 |
|
52 |
|
54 |
umc/package.json: |
53 |
umc/package.json: package.json |
55 |
sed 's/%VERSION%/$(version)/' package.json > $@ |
54 |
sed 's/%VERSION%/$(version)/' $< > $@ |
56 |
|
55 |
|
57 |
# temp directory |
56 |
# temp directory |
58 |
$(tmpDir): |
57 |
$(tmpDir): |
Lines 63-68
$(tmpDir):
Link Here
|
63 |
cp -rfs "$(CURDIR)/umc" $@ |
62 |
cp -rfs "$(CURDIR)/umc" $@ |
64 |
|
63 |
|
65 |
# convert .po to .json files |
64 |
# convert .po to .json files |
|
|
65 |
.PHONY: i18n |
66 |
i18n: |
66 |
i18n: |
67 |
/usr/bin/dh-umc-translate -p univention-management-console-frontend -l en -l de -o umc $(jsFiles) |
67 |
/usr/bin/dh-umc-translate -p univention-management-console-frontend -l en -l de -o umc $(jsFiles) |
68 |
|
68 |
|
Lines 70-85
$(buildDir):
Link Here
|
70 |
mkdir -p $@ |
70 |
mkdir -p $@ |
71 |
|
71 |
|
72 |
# rule for the main dojo build process |
72 |
# rule for the main dojo build process |
73 |
$(buildDir)/js/dojo/dojo.js.uncompressed.js: $(jsFiles) $(buildDir) |
73 |
$(buildDir)/js/dojo/dojo.js.uncompressed.js: build_profile.js $(jsFiles) $(buildDir) |
74 |
/usr/share/univention-dojo/util/buildscripts/build.sh profile=build_profile.js version="$(version)" |
74 |
/usr/share/univention-dojo/util/buildscripts/build.sh profile=$< version="$(version)" |
75 |
|
75 |
|
76 |
# index page |
76 |
# index page |
77 |
$(buildDir)/index.html: $(buildDir) index.html |
77 |
$(buildDir)/index.html: index.html $(buildDir) |
78 |
sed 's/%HASH%/_$(timestamp)/; s/%JSSUFFIX%//; s/%VERSION%/$(version)/;' index.html > $@ |
78 |
sed 's/%HASH%/_$(timestamp)/; s/%JSSUFFIX%//; s/%VERSION%/$(version)/;' $< > $@ |
79 |
|
79 |
|
80 |
# index page for debug mode |
80 |
# index page for debug mode |
81 |
$(buildDir)/debug.html: $(buildDir) index.html |
81 |
$(buildDir)/debug.html: index.html $(buildDir) |
82 |
sed 's/%HASH%/_$(timestamp)/; s/%JSSUFFIX%/.uncompressed.js/; s/%VERSION%/$(version)/;' index.html > $@ |
82 |
sed 's/%HASH%/_$(timestamp)/; s/%JSSUFFIX%/.uncompressed.js/; s/%VERSION%/$(version)/;' $< > $@ |
83 |
|
83 |
|
84 |
# login page |
84 |
# login page |
85 |
$(tmpDir)/umc/login.html: login.html |
85 |
$(tmpDir)/umc/login.html: login.html |
Lines 120-125
$(themesDir)/umc/icons: $(themesDir)/umc
Link Here
|
120 |
done; \ |
120 |
done; \ |
121 |
done |
121 |
done |
122 |
|
122 |
|
|
|
123 |
.PHONY: build-dev |
123 |
build-dev: build-common |
124 |
build-dev: build-common |
124 |
@# symlink javascript code |
125 |
@# symlink javascript code |
125 |
[ -e $(buildDir)/js ] || ln -s $(tmpDir) $(buildDir)/js |
126 |
[ -e $(buildDir)/js ] || ln -s $(tmpDir) $(buildDir)/js |
Lines 128-133
build-dev: build-common
Link Here
|
128 |
cp -frs /usr/share/univention-management-console-frontend/js/umc/modules/* $(tmpDir)/umc/modules |
129 |
cp -frs /usr/share/univention-management-console-frontend/js/umc/modules/* $(tmpDir)/umc/modules |
129 |
cp -frs /usr/share/univention-management-console-frontend/js/dijit/themes/umc/icons/* $(themesDir)/umc/icons/ |
130 |
cp -frs /usr/share/univention-management-console-frontend/js/dijit/themes/umc/icons/* $(themesDir)/umc/icons/ |
130 |
|
131 |
|
|
|
132 |
.PHONY: build-common |
131 |
build-common: i18n umc/widgets.js umc/package.json $(themesDir)/umc $(themesDir)/umc/icons $(tmpDir)/umc/login.html $(buildDir) $(buildDir)/index.html $(buildDir)/debug.html |
133 |
build-common: i18n umc/widgets.js umc/package.json $(themesDir)/umc $(themesDir)/umc/icons $(tmpDir)/umc/login.html $(buildDir) $(buildDir)/index.html $(buildDir)/debug.html |
132 |
@# symlink to javascript dir with timestamp |
134 |
@# symlink to javascript dir with timestamp |
133 |
rm -f "$(buildDir)/js_"* |
135 |
rm -f "$(buildDir)/js_"* |
Lines 142-152
build-common: i18n umc/widgets.js umc/package.json $(themesDir)/umc $(themesDir)
Link Here
|
142 |
@# create empty branding localisation files to not cause 404 errors |
144 |
@# create empty branding localisation files to not cause 404 errors |
143 |
touch "$(tmpDir)/umc/i18n/en/branding.json" "$(tmpDir)/umc/i18n/de/branding.json" |
145 |
touch "$(tmpDir)/umc/i18n/en/branding.json" "$(tmpDir)/umc/i18n/de/branding.json" |
144 |
|
146 |
|
|
|
147 |
.PHONY: install |
145 |
install: build |
148 |
install: build |
146 |
@# copy all files from the build directory .. exclude file of the tmp directory |
149 |
@# copy all files from the build directory .. exclude file of the tmp directory |
147 |
mkdir -p "$(DESTDIR)$(pkgDir)" |
150 |
mkdir -p "$(DESTDIR)$(pkgDir)" |
148 |
rsync -rpl --exclude ".svn" "$(buildDir)/" "$(DESTDIR)$(pkgDir)" |
151 |
rsync -rpl --exclude ".svn" "$(buildDir)/" "$(DESTDIR)$(pkgDir)" |
149 |
|
152 |
|
|
|
153 |
.PHONY: clean |
150 |
clean: |
154 |
clean: |
151 |
rm -rf $(tmpDir) $(buildDir) umc.xml umc/widgets.js umc/{en,de}.json umc/package.json |
155 |
rm -rf $(tmpDir) $(buildDir) umc.xml umc/widgets.js umc/{en,de}.json umc/package.json |
152 |
|
|
|