Java Cube Reader Tool Developer Guide  (jCubeR 4.7, revision v4.7)
Intoduction in Cube tool development guide for Java
Makefile for provided examples

Quick info about makefile.

Here we provide a small example of a makefile, which is used to compile and build examples delivered with CUBE. Similar makefiles can be used by developers to compile and build own jCubeR tools.

Commented source

First we specify the installation path of CUBE and its "jcuber-config" script. This script delivers correct flags for compiling and linking, paths to the CUBE tools and GUI. (besides of another useful technical information)

CUBE_DIR = /path/CubeInstall
CUBE_CONFIG = $(CUBE_DIR)/bin/jcuber-config

Additionally we specify CLASSPATH and SYSTEM_CLASSPATH to compile and link examples.

CLASSPATH = $(shell $(CUBE_CONFIG) --classpath)
SYSTEM_CLASSPATH = $(shell echo $$CLASSPATH)

Here a compiler is selected to compile and build the example.

JAVAC = javac
JAVA= java

We define explicit suffixes for an executable file, created from C source, from c++ source and an MPI executable. If one develops a tool, which is using MPI, it is useful (sometimes) to define a special suffix for automatic compilation.

.SUFFIXES: .java .java.class
.PHONY: all clean

Object files of examples and their targets

# Object files
OBJS =
TARGET =jcuber_example.java.class

Automatic rule for the compilation of every single Java source into .o file and for building targets.

%.java.class : %.java
$(JAVAC) -d . -cp "$(SYSTEM_CLASSPATH):.:$(CLASSPATH)" $<

Automatic rule for the compilation of every single java source into .class file and for building targets.

#------------------------------------------------------------------------------
# Rules
#------------------------------------------------------------------------------
all: $(TARGET)
$(JAVA) -classpath "$(SYSTEM_CLASSPATH):.:$(CLASSPATH)" $$japp example.cube; \
$(JAVA) -classpath "$(SYSTEM_CLASSPATH):.:$(CLASSPATH)" $$japp example.cube dump; \

Cube Writer Library    Copyright © 1998–2022 Forschungszentrum Jülich GmbH, Jülich Supercomputing Centre
Copyright © 2009–2015 German Research School for Simulation Sciences GmbH, Laboratory for Parallel Programming