github.com/unigraph-dev/dgraph@v1.1.1-0.20200923154953-8b52b426f765/Makefile (about) 1 # 2 # Copyright 2018 Dgraph Labs, Inc. and Contributors 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 # 16 17 BUILD ?= $(shell git rev-parse --short HEAD) 18 BUILD_DATE ?= $(shell git log -1 --format=%ci) 19 BUILD_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD) 20 BUILD_VERSION ?= $(shell git describe --always --tags) 21 22 SUBDIRS = dgraph 23 24 ############### 25 26 .PHONY: $(SUBDIRS) all oss version install install_oss oss_install uninstall test help 27 all: $(SUBDIRS) 28 29 $(SUBDIRS): 30 $(MAKE) -w -C $@ all 31 32 oss: 33 $(MAKE) BUILD_TAGS=oss 34 35 version: 36 @echo Dgraph ${BUILD_VERSION} 37 @echo Build: ${BUILD} 38 @echo Build date: ${BUILD_DATE} 39 @echo Branch: ${BUILD_BRANCH} 40 @echo Go version: $(shell go version) 41 42 install: 43 @(set -e;for i in $(SUBDIRS); do \ 44 echo Installing $$i ...; \ 45 $(MAKE) -C $$i install; \ 46 done) 47 48 install_oss oss_install: 49 $(MAKE) BUILD_TAGS=oss install 50 51 uninstall: 52 @(set -e;for i in $(SUBDIRS); do \ 53 echo Uninstalling $$i ...; \ 54 $(MAKE) -C $$i uninstall; \ 55 done) 56 57 test: 58 @echo Running ./test.sh 59 ./test.sh 60 61 help: 62 @echo 63 @echo Build commands: 64 @echo " make [all] - Build all targets [EE]" 65 @echo " make oss - Build all targets [OSS]" 66 @echo " make dgraph - Build dgraph binary" 67 @echo " make install - Install all targets" 68 @echo " make uninstall - Uninstall known targets" 69 @echo " make version - Show current build info" 70 @echo " make help - This help" 71 @echo