-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.in
64 lines (55 loc) · 2.06 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
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
LDFLAGS="-X=$(BASEPATH)/utils.LibexecDir=${libexecdir} -X=$(BASEPATH)/worker/gdalservice.LibexecDir=${libexecdir} \
-X=$(BASEPATH)/utils.EtcDir=$(sysconfdir) -X=$(BASEPATH)/utils.DataDir=${datarootdir}/gsky"
GOBIN=$(shell go env GOBIN)
ifeq ($(strip $(GOBIN)),)
GOBIN=$(shell go env GOPATH)/bin
endif
all: concurrent pkg-config
go get ./...
go install -ldflags=$(LDFLAGS) ./...
check test: pkg-config
go test ./...
bats testsuite
concurrent: src/concurrent.c
$(CC) -std=c99 -Wall -O2 $< -o $@
src/concurrent.c:
mkdir -p $(dir $@)
wget --quiet https://github.com/seanpringle/concurrent/raw/634330a119f16916e5ad24da32172fa9312ab5a3/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 $(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