Skip to content

Commit

Permalink
Add release target
Browse files Browse the repository at this point in the history
Also fixes issues with Makefile and ./scripts/make
  • Loading branch information
ddohler committed Jan 24, 2018
1 parent 5c9f556 commit 1516a8d
Show file tree
Hide file tree
Showing 7 changed files with 408 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ gdal.js
*js.mem
*.data
*.wasm
dist
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ RUN apt-get update && apt-get -y install \
default-jre \
libtool \
curl \
git-core
git-core \
zip

WORKDIR /tmp
RUN curl -O https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz && \
Expand Down
24 changes: 17 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ export EMCONFIGURE_JS

include gdal-configure.opt

.PHONY: clean
.PHONY: clean release gdal proj4

########
# GDAL #
########
gdal: gdal.js
# Alias to easily remake PROJ.4
proj4: $(PROJ4)/src/.libs/libproj.a

gdal.js: $(GDAL)/libgdal.a
EMCC_CFLAGS="$(GDAL_EMCC_CFLAGS)" $(EMCC) $(GDAL)/libgdal.a $(PROJ4)/src/.libs/libproj.a -o gdal.js \
Expand All @@ -82,11 +84,9 @@ gdal.js: $(GDAL)/libgdal.a



$(GDAL)/libgdal.a: proj4 gdalconfig
$(GDAL)/libgdal.a: $(PROJ4)/src/.libs/libproj.a $(GDAL)/config.status
cd $(GDAL) && EMCC_CFLAGS="$(GDAL_EMCC_CFLAGS)" $(EMMAKE) make lib-target

gdalconfig: $(GDAL)/config.status

# TODO: Pass the configure params more elegantly so that this uses the
# EMCONFIGURE variable
$(GDAL)/config.status: $(GDAL)/configure
Expand All @@ -108,11 +108,9 @@ $(GDAL)/config.status: $(GDAL)/configure
##########
proj4: $(PROJ4)/src/.libs/libproj.a

$(PROJ4)/src/.libs/libproj.a: proj4config
$(PROJ4)/src/.libs/libproj.a: $(PROJ4)/config.status
cd $(PROJ4) && EMCC_CFLAGS="$(PROJ_EMCC_CFLAGS)" $(EMMAKE) make

proj4config: $(PROJ4)/config.status

$(PROJ4)/config.status: $(PROJ4)/configure
cd $(PROJ4) && $(EMCONFIGURE) ./configure --enable-shared=no --enable-static --without-mutex

Expand All @@ -129,3 +127,15 @@ clean:
rm -f gdal.js
rm -f gdal.js.mem
rm -f gdal.data

##############
# Release #
##############
release: $(VERSION).tar.gz $(VERSION).zip

$(VERSION).tar.gz $(VERSION).zip: dist/README dist/LICENSE.TXT dist/gdal.js dist/gdal.wasm dist/gdal.data
tar czf $(VERSION).tar.gz dist
zip -r $(VERSION).zip dist

dist/gdal.js dist/gdal.wasm dist/gdal.data: gdal.js
cp gdal.js gdal.wasm gdal.data dist
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Developing
1. Install Docker
2. Run `./scripts/setup`, which will build the Docker container.
3. Run `./scripts/make gdal`. The make script just calls `make` from inside the Docker container.
4. If you need to run `make clean`, first run `./scripts/console` and then `make clean`. In the
future, the goal is for all make targets to run correctly from `./scripts/make`.
4. `./scripts/make clean` works as expected.
5. To package up a release, run `./scripts/make VERSION=<number> release`

Usage
---------------
Expand Down Expand Up @@ -50,5 +50,6 @@ To see full-fledged examples using all of these functions from within a WebWorke
2. `map_extent`
3. `thumbnail`
4. `thumbnail_map`
5. `tile_tiff`

In order to limit Javascript build size, GDAL is currently built with support for GeoTIFFs and PNGs only.
Loading

0 comments on commit 1516a8d

Please sign in to comment.