Makefile 2.9 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

18 19 20 21 22 23 24
.PHONY: all install clean distclean installcheck mapreduce gpcloud mkgphdfs mkorafce

#
# targets built via top_builddir/GNUmakefile
#

all: mapreduce gpcloud
25

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

32 33 34 35 36 37 38 39
gpcloud:
	@if [ "$(enable_gpcloud)" = "yes" ]; then \
		echo "gpcloud enabled"; \
		$(MAKE) -C gpcloud; \
		$(MAKE) -C gpcloud/bin/gpcheckcloud; \
	fi

install:
40
	@if [ "$(enable_mapreduce)" = "yes" ]; then \
41 42
		$(MAKE) -C gpmapreduce install; \
	fi
A
Adam Lee 已提交
43 44 45 46
	@if [ "$(enable_gpcloud)" = "yes" ]; then \
		$(MAKE) -C gpcloud install; \
		$(MAKE) -C gpcloud/bin/gpcheckcloud install; \
	fi
47

48
clean:
49
	if [ "$(enable_mapreduce)" = "yes" ]; then $(MAKE) -C gpmapreduce clean; fi
50
	if [ "$(enable_gpcloud)" = "yes" ]; then $(MAKE) -C gpcloud clean; fi
51 52

distclean:
53
	if [ "$(enable_mapreduce)" = "yes" ]; then $(MAKE) -C gpmapreduce distclean; fi
54 55 56 57 58 59 60 61 62 63 64 65 66 67
	if [ "$(enable_gpcloud)" = "yes" ]; then $(MAKE) -C gpcloud distclean; fi

installcheck:
	if [ -d "$(ext_dir)" ]; then \
		PATH=$(INSTLOC)/bin:$(PATH) $(MAKE) -C orafce installcheck USE_PGXS=1 && \
		PATH=$(INSTLOC)/bin:$(PATH) $(MAKE) -C gphdfs installcheck USE_PGXS=1 ; \
	fi; \
	if [ "$(enable_mapreduce)" = "yes" ]; then \
		$(MAKE) -C gpmapreduce installcheck; \
	fi

#
# below targets will be built via top_builddir/gpAux/Makefile
#
68 69 70 71 72 73

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}

74
# Only include these files when running enterprise build
75
ENTERPRISE_TARGETS="mkgphdfs mkorafce"
76 77 78 79 80
ifneq ($(findstring $(MAKECMDGOALS), $(ENTERPRISE_TARGETS)),)
include $(BLD_TOP)/Makefile.global
include $(BLD_TOP)/Makefile.thirdparty
endif

81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
# 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

D
Dave Cramer 已提交
104 105
mkorafce:
	PATH=$(INSTLOC)/bin:$(PATH) $(MAKE) -C orafce install USE_PGXS=1