-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile.in
75 lines (65 loc) · 2.65 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
sysconfdir = @sysconfdir@
srcdir = @srcdir@
VPATH = @srcdir@
BASEPATH=github.com/nci/gsky
VERSION=$(shell git rev-parse HEAD)
LDFLAGS="-X=$(BASEPATH)/utils.LibexecDir=${libexecdir} -X=$(BASEPATH)/worker/gdalservice.LibexecDir=${libexecdir} \
-X=$(BASEPATH)/utils.EtcDir=$(sysconfdir) -X=$(BASEPATH)/utils.DataDir=${datarootdir}/gsky \
-X=$(BASEPATH)/utils.GSKYVersion=${VERSION}"
GOBIN=$(shell go env GOBIN)
ifeq ($(strip $(GOBIN)),)
GOBIN=$(shell go env GOPATH)/bin
endif
GDALCFLAGS=$(shell pkg-config gdal --cflags)
GDALLDLAGS=$(shell pkg-config gdal --libs)
NCCFLAGS=-DNETCDF_HAS_NC4 -DNETCDF_HAS_NC2 -DHAVE_HDF4 -DHAVE_HDF5 -DENABLE_UFFD -I$(shell nc-config --includedir)
NCLDFLAGS=$(shell nc-config --libs)
all: pkg-config concurrent gdal_GSKY_netCDF.so
go get ./...
go install -ldflags=$(LDFLAGS) ./...
check test: pkg-config
go test ./...
bats testsuite
gdal_GSKY_netCDF.so: $(wildcard libs/gdal/frmts/gsky_netcdf/*.cpp)
$(CXX) -std=c++11 -Wall -shared -fPIC -fvisibility=hidden -Ofast $(NCCFLAGS) $(GDALCFLAGS) $(NCLDFLAGS) $(GDALLDFLAGS) $^ -o $@
concurrent: src/concurrent.c
$(CC) -std=c99 -Wall -O2 $< -o $@
src/concurrent.c:
mkdir -p $(dir $@)
wget --quiet https://github.com/edisonguo/concurrent/raw/e6ff2d98fb7f4cebf297b1725fee9a9e3d1cc164/concurrent.c -O $@
# Note: install(1) can't deal with directories as source, so use cp -r.
install:
install -d $(bindir) $(sbindir) $(libexecdir) $(sysconfdir)
install -d $(datarootdir)/gsky/templates
install -d $(datarootdir)/gsky/static
install -d $(datarootdir)/mas
install concurrent $(bindir)
install gdal_GSKY_netCDF.so $(sbindir)
install $(GOBIN)/gsky $(sbindir)/gsky-ows
install $(GOBIN)/gdal-process $(sbindir)/gsky-gdal-process
install $(GOBIN)/grpc-server $(sbindir)/gsky-rpc
install $(GOBIN)/crawl $(sbindir)/gsky-crawl
install $(GOBIN)/api $(sbindir)/masapi
install -m 644 $(srcdir)/zoom.png $(datarootdir)/gsky
install -m 644 $(srcdir)/data_unavailable.png $(datarootdir)/gsky
cp -rp $(srcdir)/templates/* $(datarootdir)/gsky/templates
cp -rp $(srcdir)/static/* $(datarootdir)/gsky/static
for f in $(srcdir)/mas/db/*.sql $(srcdir)/mas/api/*.sql ; do install -m 644 $$f $(datarootdir)/mas ; done
for f in $(srcdir)/mas/db/*.sh ; do install -m 755 $$f $(datarootdir)/mas ; done
install -m 755 $(srcdir)/crawl/crawl_pipeline.sh $(sbindir)/gsky-crawl_pipeline.sh
clean: pkg-config
go clean -i ./...
rm -f concurrent
distclean: clean
-rm -f Makefile config.log config.status
-rm -r src
.PHONY: pkg-config
pkg-config:
pkg-config --exists gdal
nc-config --version