2013-04-14 04:59:55 +00:00
|
|
|
# Copyright 2013 Prometheus Team
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
include ../Makefile.INCLUDE
|
|
|
|
|
|
|
|
all: dependencies-stamp
|
|
|
|
|
|
|
|
bison-stamp: bison-implementation-$(UNAME)-stamp
|
|
|
|
[ -x "$$(which bison)" ] || { echo "bison not found." ; false ; }
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
bison-implementation-Darwin-stamp:
|
|
|
|
[ -x "$$(which bison)" ] || $(BREW_INSTALL) bison
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
bison-implementation-Linux-stamp:
|
|
|
|
[ -x "$$(which bison)" ] || $(APT_GET_INSTALL) bison
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
cache-stamp:
|
|
|
|
$(MAKE) -C cache
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
cc-stamp: cc-implementation-$(UNAME)-stamp
|
|
|
|
[ -x "$$(which cc)" ] || { echo "cc not found." ; false ; }
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
cc-implementation-Darwin-stamp:
|
|
|
|
[ -x "$$(which cc)" ] || { echo "Install XCode?" ; false ; }
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
cc-implementation-Linux-stamp:
|
|
|
|
[ -x "$$(which cc)" ] || $(APT_GET_INSTALL) build-essential
|
|
|
|
touch $@
|
|
|
|
|
2014-08-21 20:06:11 +00:00
|
|
|
dependencies-stamp: cache-stamp cc-stamp leveldb-stamp snappy-stamp godns-stamp goleveldb-stamp
|
2013-04-14 04:59:55 +00:00
|
|
|
touch $@
|
|
|
|
|
2013-06-12 16:45:39 +00:00
|
|
|
goprotobuf-protoc-gen-go-stamp: protoc-stamp goprotobuf-stamp
|
2013-04-14 04:59:55 +00:00
|
|
|
$(GO_GET) code.google.com/p/goprotobuf/protoc-gen-go $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
touch $@
|
|
|
|
|
2013-06-13 13:17:03 +00:00
|
|
|
goprotobuf-stamp: protoc-stamp
|
2013-05-08 19:15:47 +00:00
|
|
|
$(GO_GET) code.google.com/p/goprotobuf/proto $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
touch $@
|
|
|
|
|
2013-09-10 15:48:05 +00:00
|
|
|
godns-stamp:
|
|
|
|
$(GO_GET) github.com/miekg/dns $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
touch $@
|
|
|
|
|
2014-08-21 20:06:11 +00:00
|
|
|
goleveldb-stamp:
|
|
|
|
$(GO_GET) github.com/syndtr/goleveldb/leveldb $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
touch $@
|
|
|
|
|
2013-04-14 04:59:55 +00:00
|
|
|
leveldb-stamp: cache-stamp cache/leveldb-$(LEVELDB_VERSION).tar.gz cc-stamp rsync-stamp snappy-stamp
|
|
|
|
tar xzvf cache/leveldb-$(LEVELDB_VERSION).tar.gz -C dirty $(THIRD_PARTY_BUILD_OUTPUT)
|
2013-04-17 09:43:35 +00:00
|
|
|
cd dirty/leveldb-$(LEVELDB_VERSION) && CFLAGS="$(CFLAGS) -lsnappy" CXXFLAGS="$(CXXFLAGS) -lsnappy $(LDFLAGS)" LDFLAGS="-lsnappy $(LDFLAGS)" bash -x ./build_detect_platform build_config.mk ./
|
2013-04-14 04:59:55 +00:00
|
|
|
# The test that LevelDB uses to test for Snappy is naive and
|
|
|
|
# does not respect LDFLAGS. :-(
|
2013-04-17 09:43:35 +00:00
|
|
|
CFLAGS="$(CFLAGS) -lsnappy" CXXFLAGS="$(CXXFLAGS) -lsnappy $(LDFLAGS)" LDFLAGS="-lsnappy $(LDFLAGS)" $(MAKE) -C dirty/leveldb-$(LEVELDB_VERSION) $(THIRD_PARTY_BUILD_OUTPUT)
|
2013-04-14 04:59:55 +00:00
|
|
|
rsync -av "dirty/leveldb-$(LEVELDB_VERSION)/include/" "$(PREFIX)/include/" $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
-[ "$(UNAME)" = "Linux" ] && { rsync -av "dirty/leveldb-$(LEVELDB_VERSION)/"*.*so* "$(PREFIX)/lib/" ; } $(THIRD_PARTY_BUILD_OUTPUT) $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
-[ "$(UNAME)" = "Darwin" ] && { rsync -av "dirty/leveldb-$(LEVELDB_VERSION)/"*.*dylib* "$(PREFIX)/lib/" ; } $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
rsync -av "dirty/leveldb-$(LEVELDB_VERSION)/"*.a "$(PREFIX)/lib/" $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
libunwind-stamp:
|
|
|
|
$(APT_GET_INSTALL) libunwind7
|
|
|
|
$(APT_GET_INSTALL) libunwind7-dev
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
noop-target-stamp:
|
|
|
|
echo "Not doing anything."
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
protoc-stamp: cache-stamp cache/protobuf-$(PROTOCOL_BUFFERS_VERSION).tar.bz2 cc-stamp
|
|
|
|
tar xjvf cache/protobuf-$(PROTOCOL_BUFFERS_VERSION).tar.bz2 -C dirty $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
cd dirty/protobuf-$(PROTOCOL_BUFFERS_VERSION) && ./configure --prefix="$(PREFIX)" $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
$(MAKE) -C dirty/protobuf-$(PROTOCOL_BUFFERS_VERSION) $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
$(MAKE) -C dirty/protobuf-$(PROTOCOL_BUFFERS_VERSION) install $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
[ -x "$$(which protoc)" ] || { echo "protoc not found." ; false ; }
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
rsync-implementation-Darwin-stamp:
|
|
|
|
[ -x "$$(which rsync)" ] || $(BREW_INSTALL) rsync
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
rsync-implementation-Linux-stamp:
|
|
|
|
[ -x "$$(which rsync)" ] || $(APT_GET_INSTALL) rsync
|
|
|
|
|
|
|
|
rsync-stamp: rsync-implementation-$(UNAME)-stamp
|
|
|
|
[ -x "$$(which rsync)" ] || { echo "rsync not found." ; false ; }
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
snappy-stamp: cache-stamp cache/snappy-$(SNAPPY_VERSION).tar.gz cc-stamp
|
|
|
|
tar xzvf cache/snappy-$(SNAPPY_VERSION).tar.gz -C dirty $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
cd dirty/snappy-$(SNAPPY_VERSION) && ./configure --prefix="$(PREFIX)" $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
$(MAKE) -C dirty/snappy-$(SNAPPY_VERSION) $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
$(MAKE) -C dirty/snappy-$(SNAPPY_VERSION) install $(THIRD_PARTY_BUILD_OUTPUT)
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
ifeq ($(UNAME), Linux)
|
|
|
|
stack-unwind-support-stamp: libunwind-stamp
|
|
|
|
touch $@
|
|
|
|
else
|
|
|
|
stack-unwind-support-stamp: noop-target-stamp
|
|
|
|
touch $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
vim-implementation-Darwin-stamp:
|
|
|
|
[ -x "$$(which vim)" ] || $(BREW_INSTALL) vim
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
vim-implementation-Linux-stamp:
|
|
|
|
[ -x "$$(which vim)" ] || $(APT_GET_INSTALL) vim
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
vim-stamp: vim-implementation-$(UNAME)-stamp
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(MAKE) -C cache clean
|
|
|
|
$(MAKE) -C dirty clean
|
|
|
|
$(MAKE) -C root clean
|
2013-06-12 16:45:39 +00:00
|
|
|
$(MAKE) -C package clean
|
2013-04-14 04:59:55 +00:00
|
|
|
rm -rf *-stamp
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: clean
|