Makefile 2.2 KB
Newer Older
1 2 3 4 5
# protect the default target for this file from the targets in Makefile.global
# and Makefile.thirdparty
default: all

BLD_TOP=..
6 7 8 9 10 11 12 13 14 15 16 17
include $(BLD_TOP)/Makefile.windows

ext_dir=../ext

top_builddir = ../..
include $(top_builddir)/src/Makefile.global

ENV_JAVA_HOME:=$(shell echo $$JAVA_HOME)
ifneq (${ENV_JAVA_HOME},)
	JAVA_HOME=${ENV_JAVA_HOME}
endif

A
Adam Lee 已提交
18
all: mkgphdfs mkgpcloud
19 20

.PHONY:
21
mapreduce:
22
	@if [ "$(enable_mapreduce)" = "yes" ]; then \
23 24 25 26 27
		echo "gpmapreduce enabled"; \
		$(MAKE) -C gpmapreduce; \
	fi

install: mapreduce
28
	@if [ "$(enable_mapreduce)" = "yes" ]; then \
29 30 31
		$(MAKE) -C gpmapreduce install; \
	fi

32
clean:
33 34
	if [ "$(enable_mapreduce)" = "yes" ]; then $(MAKE) -C gpmapreduce clean; fi

35 36

distclean:
37
	if [ "$(enable_mapreduce)" = "yes" ]; then $(MAKE) -C gpmapreduce distclean; fi
38 39 40 41 42 43 44

.PHONY:
mkgphdfs:
	PATH=$(INSTLOC)/bin:$(PATH) $(MAKE) -C gphdfs USE_PGXS=1 docdir=$(INSTLOC)/docs install \
		ANT=/opt/releng/apache-ant/bin/ant \
		JAVA_HOME=${JAVA_HOME}

45
.PHONY:
A
Adam Lee 已提交
46
mkgpcloud:
A
Adam Lee 已提交
47 48
	PATH=$(INSTLOC)/bin:$(PATH) $(MAKE) -C gpcloud USE_PGXS=1 install
	PATH=$(INSTLOC)/bin:$(PATH) $(MAKE) -C gpcloud/bin/gpcheckcloud USE_PGXS=1 install
49 50

# Only include include these files when running enterprise build
51
ENTERPRISE_TARGETS="mkgphdfs mkorafce"
52 53 54 55 56
ifneq ($(findstring $(MAKECMDGOALS), $(ENTERPRISE_TARGETS)),)
include $(BLD_TOP)/Makefile.global
include $(BLD_TOP)/Makefile.thirdparty
endif

57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
# Use $JAVA_HOME if specified, otherwise look for java in the likely places.
# Note that Darwin's JVM layout is pretty weird.  JDK 1.6 apears to be the
# default for Snow Leopard, but JDK 1.5 is for Leopard.
# See http://developer.apple.com/qa/qa2001/qa1170.html
ifeq ($(wildcard "${JAVA_HOME}/bin/java"),)
  JDK="${JAVA_HOME}"
else
  ifeq ($(wildcard "/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java"),)
    JDK="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home"
  else
    ifeq ($(wildcard "/usr/java/bin/java"),)
      JDK="/usr/java"
    else
      echo JAVA_HOME not found
    endif
  endif
endif
JAVA=${JAVA_HOME}/bin/java
JAVAC=${JAVA_HOME}/bin/javac
JAVAH=${JAVA_HOME}/bin/javah
JAR=${JAVA_HOME}/bin/jar
JAVADOC=${JAVA_HOME}/bin/javadoc



82
installcheck:
83 84 85
	if [ -d "$(ext_dir)" ]; then \
		PATH=$(INSTLOC)/bin:$(PATH) $(MAKE) -C gphdfs installcheck USE_PGXS=1 ; \
	fi