2016-11-04 19:46:06 +00:00
|
|
|
|
TRICK_HOME := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../..)
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
|
|
# Get JAVAC definition
|
2015-06-01 15:28:29 +00:00
|
|
|
|
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
|
|
JAVAC ?= javac
|
2018-02-02 14:42:45 +00:00
|
|
|
|
JAVAC_FLAGS = -g -Xlint:unchecked -Xlint:deprecation --add-modules java.se.ee,java.desktop
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
|
|
SRC_DIR = src
|
|
|
|
|
SRC_FILES = $(shell find ${SRC_DIR} -type f -name \*.java)
|
|
|
|
|
BUILD_DIR = build
|
|
|
|
|
DEST_DIR = ${BUILD_DIR}/classes
|
2015-06-12 20:24:36 +00:00
|
|
|
|
LIB_DIR = ${TRICK_HOME}/$(LIBEXEC)/trick/java/lib
|
|
|
|
|
DIST_DIR = ${TRICK_HOME}/$(LIBEXEC)/trick/java/dist
|
|
|
|
|
RESOURCES_DIR = ${TRICK_HOME}/$(LIBEXEC)/trick/java/resources
|
2016-01-12 22:39:47 +00:00
|
|
|
|
DOCS_API_DIR = ${TRICK_HOME}/share/doc/trick/java
|
2015-02-26 15:02:31 +00:00
|
|
|
|
TEST_REPORTS_DIR = test/reports
|
|
|
|
|
|
|
|
|
|
empty :=
|
|
|
|
|
space := $(empty) $(empty)
|
|
|
|
|
CLASS_PATH = $(subst $(space),:,$(wildcard ${LIB_DIR}/*.jar))
|
|
|
|
|
|
|
|
|
|
RESOURCES = $(subst src/,,$(shell find src/trick -name resources))
|
2015-03-10 20:49:24 +00:00
|
|
|
|
RESOURCES += $(subst src/,,$(shell find src/trick -name jaxb.index))
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
|
|
all: ${DIST_DIR}/trick.jar resources
|
2018-03-02 14:59:26 +00:00
|
|
|
|
@echo "[32mJava build successful[0m"
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
|
|
${DEST_DIR} ${DIST_DIR} ${RESOURCES_DIR} ${DOCS_API_DIR}:
|
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
|
|
${DIST_DIR}/trick.jar: compile ${DIST_DIR}
|
2018-03-02 14:59:26 +00:00
|
|
|
|
@echo "[36mCreating jar file...[0m"
|
2015-02-26 15:02:31 +00:00
|
|
|
|
@jar cf ${DIST_DIR}/trick.jar -C ${DEST_DIR} .
|
|
|
|
|
@cd ${SRC_DIR} && jar uf ${DIST_DIR}/trick.jar ${RESOURCES}
|
|
|
|
|
|
|
|
|
|
external_jars:
|
|
|
|
|
@ $(MAKE) -C $(LIB_DIR)
|
|
|
|
|
|
|
|
|
|
compile: ${DEST_DIR} external_jars
|
2018-03-02 14:59:26 +00:00
|
|
|
|
@echo "[36mBuilding Trick GUIs...[0m"
|
2015-02-26 15:02:31 +00:00
|
|
|
|
@${JAVAC} ${JAVAC_FLAGS} -classpath ${CLASS_PATH} -d ${DEST_DIR} -sourcepath ${SRC_DIR} ${SRC_FILES}
|
|
|
|
|
|
|
|
|
|
resources: ${RESOURCES_DIR}/trick_icon.png
|
|
|
|
|
|
|
|
|
|
${RESOURCES_DIR}/trick_icon.png: ${SRC_DIR}/trick/common/resources/trick_icon.png ${RESOURCES_DIR}
|
|
|
|
|
@cp $< $@
|
|
|
|
|
|
|
|
|
|
JAVA_DOC_LINKS = \
|
|
|
|
|
-link "http://docs.oracle.com/javase/6/docs/api/" \
|
|
|
|
|
-link "http://www.jfree.org/jfreechart/api/javadoc/" \
|
|
|
|
|
-link "http://junit.sourceforge.net/javadoc/"
|
|
|
|
|
|
2016-01-12 22:39:47 +00:00
|
|
|
|
javadoc: ${DOCS_API_DIR}
|
2015-02-26 15:02:31 +00:00
|
|
|
|
javadoc -d ${DOCS_API_DIR} -classpath ${CLASS_PATH} -sourcepath ${SRC_DIR} -windowtitle "Trick GUI API" ${JAVA_DOC_LINKS} trick ${SRC_FILES}
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
rm -rf ${BUILD_DIR}
|
|
|
|
|
rm -rf ${DIST_DIR}
|
|
|
|
|
rm -rf ${RESOURCES_DIR}
|
|
|
|
|
rm -rf ${TEST_REPORTS_DIR}
|
|
|
|
|
|
2015-05-21 21:57:20 +00:00
|
|
|
|
clean_obj:
|
|
|
|
|
rm -rf ${BUILD_DIR}
|
|
|
|
|
|
2015-02-26 15:02:31 +00:00
|
|
|
|
clean_docs:
|
|
|
|
|
rm -rf ${DOCS_API_DIR}
|