| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
LIB_NAME = GeoExt |
|---|
| 4 |
ZIP_NAME = $(LIB_NAME).zip |
|---|
| 5 |
|
|---|
| 6 |
CSS_DIR = $(LIB_NAME)/resources/css |
|---|
| 7 |
CSS_IMPORTS = $(shell cat ../resources/css/geoext-all-debug.css | grep '@import' | sed 's/^@import "\(.*\)";/\1/') |
|---|
| 8 |
ALL_CSS = $(CSS_DIR)/geoext-all.css |
|---|
| 9 |
|
|---|
| 10 |
.PHONEY: help clean ext examples lib zip dist |
|---|
| 11 |
|
|---|
| 12 |
help: |
|---|
| 13 |
@echo "Please use 'make <target>' where <target> is one or more of" |
|---|
| 14 |
@echo " clean to clean up after building" |
|---|
| 15 |
@echo " ext to make a custom Ext JS build. See readme.txt for requirements" |
|---|
| 16 |
@echo " examples to make the examples dir" |
|---|
| 17 |
@echo " lib to make a standalone dir of lib resources" |
|---|
| 18 |
@echo " zip to make a zip archive of a standalone lib" |
|---|
| 19 |
@echo " dist to make a zip archive of a standalone lib with examples" |
|---|
| 20 |
@echo |
|---|
| 21 |
@echo "Example use:" |
|---|
| 22 |
@echo " make lib" |
|---|
| 23 |
@echo " make lib LIB_NAME=MyLib" |
|---|
| 24 |
@echo " make zip" |
|---|
| 25 |
@echo " make zip ZIP_NAME=MyZip.zip" |
|---|
| 26 |
|
|---|
| 27 |
clean: |
|---|
| 28 |
-rm -rf $(LIB_NAME) |
|---|
| 29 |
-rm -f $(ZIP_NAME) |
|---|
| 30 |
|
|---|
| 31 |
ext: |
|---|
| 32 |
@echo "Building ext.js." |
|---|
| 33 |
mkdir -p $(LIB_NAME)/script |
|---|
| 34 |
jsbuild full.cfg -v -o $(LIB_NAME)/script/ -s ext.js |
|---|
| 35 |
|
|---|
| 36 |
examples: |
|---|
| 37 |
mkdir -p $(LIB_NAME)/examples |
|---|
| 38 |
svn export --force ../examples $(LIB_NAME)/examples |
|---|
| 39 |
for file in `find $(LIB_NAME)/examples/ -name "*.html"`; do \ |
|---|
| 40 |
sed -i "s/\.\.\/lib\/GeoExt\.js/\.\.\/script\/GeoExt\.js/g" $${file} ; \ |
|---|
| 41 |
sed -i "s/geoext-all-debug\.css/geoext-all\.css/g" $${file} ; \ |
|---|
| 42 |
done ; |
|---|
| 43 |
|
|---|
| 44 |
lib: |
|---|
| 45 |
@echo "Building the library." |
|---|
| 46 |
mkdir -p $(LIB_NAME)/script $(LIB_NAME)/resources/css |
|---|
| 47 |
|
|---|
| 48 |
jsbuild full.cfg -v -o $(LIB_NAME)/script/ -s GeoExt.js |
|---|
| 49 |
|
|---|
| 50 |
svn export --force ../resources $(LIB_NAME)/resources |
|---|
| 51 |
|
|---|
| 52 |
for file in `find $(CSS_DIR) -name "*.css"`; do \ |
|---|
| 53 |
csstidy $${file} --template=highest $${file} ; \ |
|---|
| 54 |
done ; |
|---|
| 55 |
echo "" > $(ALL_CSS) |
|---|
| 56 |
for filename in $(CSS_IMPORTS); do \ |
|---|
| 57 |
cat $(CSS_DIR)/$${filename} >> $(ALL_CSS) ; \ |
|---|
| 58 |
done ; |
|---|
| 59 |
-rm $(CSS_DIR)/geoext-all-debug.css |
|---|
| 60 |
|
|---|
| 61 |
cp ../license.txt $(LIB_NAME) |
|---|
| 62 |
|
|---|
| 63 |
zip: lib |
|---|
| 64 |
@echo "Archiving the library." |
|---|
| 65 |
-rm -f $(ZIP_NAME) |
|---|
| 66 |
zip $(ZIP_NAME) -r $(LIB_NAME) |
|---|
| 67 |
|
|---|
| 68 |
dist: examples zip |
|---|