
# The following variables must be defined when using this Makefile
# to build GNATbench.
#
# ECLIPSE_HOME
#  This is the path to the Eclipse installation which performs the build.
#  This must be an Eclipse installation that contains the Plug-In
#  Development environment.
#
# HOST_OS_NAME
#  The name of the host OS.
#  For example "linux" or "win32".
#
# HOST_CPU
#  The host processor.
#
# CDT_HOME
#  The path to an Eclipse installation which contains CDT.
#
# WR_HOME
#  The path to a WorkBench installation (set when building GNATbench for
#  Wind River WorkBench).
#
# WS
#  The widget set to use ("gtk" under *nix, "win32" under Windows)
#
# INSTALL_DIR
#  The path in which to install the build output.
#  This can be an Eclipse installation or an empty directory.
#
# VERSION
#  The plugin version number. For example "2.3.0.20090224w" or "2.4.0.20090224"

# can be that, or
# com.adacore.gnatbench.feature.windriver
# 
# com.adacore.gnatbench.feature.cdt.tests
# com.adacore.gnatbench.
FEATURE=com.adacore.gnatbench.feature.cdt

javac_source:=1.5
javac_target:=1.5
main_class:=org.eclipse.equinox.launcher.Main
startup_jar:=`find $(ECLIPSE_HOME)/ -name "org.eclipse.equinox.launcher_*.jar" | sort | head -1`
install_startup_jar:=`find $(INSTALL_DIR)/ -name "org.eclipse.equinox.launcher_*.jar" | sort | head -1`

feature:
	cd ../$(FEATURE) ; \
    java -Xmx512m \
      -cp "$(startup_jar)" $(main_class) \
      -application org.eclipse.ant.core.antRunner -buildfile build.xml \
      -Dconfigs="*,*,*" -Dbaseos=$(HOST_OS_NAME) \
      -Dbasearch=$(HOST_CPU) -Djavacfailonerror=true \
      -Dpde.build.scripts="$(ECLIPSE_HOME)/plugins/org.eclipse.pde.build_*/scripts" \
      -Dbasews="$(WS)" \
      -DbaseEclipseLocation="$(ECLIPSE_HOME)" \
      -DbaseCDTLocation="$(CDT_HOME)" \
      -DbaseWRLocation="$(WR_HOME)" \
      -DjavacSource=$(javac_source) \
      -DjavacTarget=$(javac_target) \
      -Dversion=${VERSION} \
      -Dinstall_dir=${INSTALL_DIR}
