+2006-03-31 Helge Hess <helge.hess@opengroupware.org>
+
+ * gcj-tool.make, Instance/gcj-tool.make, Master/gcj-tool.make,
+ GNUmakefile.in: added special AOT tool makefile
+
+ * Instance/rules.make, common.make, rules.make: added support for
+ ahead-of-time Java compilation (AOT_JAVA_FILES), aka GCJ compilation
+
2005-08-29 Helge Hess <helge.hess@opengroupware.org>
* Instance/subproject.make: moved include of Shared/pch.make up (to
tool.make ctool.make test-library.make \
objc.make test-application.make test-tool.make subproject.make \
palette.make gswapp.make gswbundle.make clibrary.make \
- documentation.make \
+ documentation.make gcj-tool.make \
java-executable.template java-tool.make framework.make \
native-library.make spec-rules.template spec-debug-rules.template \
spec-debug-alone-rules.template \
documentation.make framework.make gswapp.make gswbundle.make \
library.make objc.make java.make java-tool.make palette.make \
resource-set.make service.make subproject.make test-application.make \
- test-library.make test-tool.make tool.make
+ test-library.make test-tool.make tool.make gcj-tool.make
INSTANCE_MAKE_FILES = \
rules.make \
documentation.make framework.make gswapp.make gswbundle.make \
library.make objc.make java.make java-tool.make palette.make \
resource-set.make service.make subproject.make test-application.make \
- test-library.make test-tool.make tool.make
+ test-library.make test-tool.make tool.make gcj-tool.make
INSTANCE_SHARED_MAKE_FILES = bundle.make headers.make java.make \
stamp-string.make strings.make pch.make
--- /dev/null
+#
+# Instance/gcj-java-tool.make
+#
+# Instance Makefile rules to build GNUstep-based command line ctools.
+#
+# Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
+#
+# Author: Scott Christley <scottc@net-community.com>
+# Author: Nicola Pero <nicola@brainstorm.co.uk>
+# Author: Helge Hess <helge.hess@opengroupware.org>
+#
+# This file is part of the GNUstep Makefile Package.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; see the file COPYING.LIB.
+# If not, write to the Free Software Foundation,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+#
+# The name of the GCJ compiled tools is in the AOT_JAVA_TOOL_NAME variable.
+# The name of the app class is xxx_MAIN_CLASS (defaults to tool name).
+#
+# xxx We need to prefix the target name when cross-compiling
+#
+
+ifeq ($(RULES_MAKE_LOADED),)
+include $(GNUSTEP_MAKEFILES)/rules.make
+endif
+
+MAIN_CLASS = $(strip $($(GNUSTEP_INSTANCE)_MAIN_CLASS))
+
+ifeq ($(MAIN_CLASS),)
+ MAIN_CLASS = $(AOT_JAVA_TOOL_NAME)
+endif
+
+CC:=gcj # TODO: make configurable
+LD:=gcj # TODO: make configurable
+ALL_LDFLAGS += --main=$(MAIN_CLASS)
+
+# This is the directory where the aotjavatools get installed. If you don't
+# specify a directory they will get installed in the GNUstep Local
+# root.
+ifneq ($($(GNUSTEP_INSTANCE)_INSTALL_DIR),)
+ AOT_JAVA_TOOL_INSTALL_DIR = $($(GNUSTEP_INSTANCE)_INSTALL_DIR)
+endif
+
+ifeq ($(AOT_JAVA_TOOL_INSTALL_DIR),)
+ AOT_JAVA_TOOL_INSTALL_DIR = $(GNUSTEP_TOOLS)
+endif
+
+.PHONY: internal-aotjavatool-all_ \
+ internal-aotjavatool-install_ \
+ internal-aotjavatool-uninstall_
+
+ALL_TOOL_LIBS = \
+ $(shell $(WHICH_LIB_SCRIPT) \
+ $(ALL_LIB_DIRS) \
+ $(ADDITIONAL_TOOL_LIBS) $(AUXILIARY_TOOL_LIBS) \
+ $(TARGET_SYSTEM_LIBS) \
+ debug=$(debug) profile=$(profile) shared=$(shared) \
+ libext=$(LIBEXT) shared_libext=$(SHARED_LIBEXT))
+
+#
+# Compilation targets
+#
+internal-aotjavatool-all_:: $(GNUSTEP_OBJ_DIR) \
+ $(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)
+
+$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT): $(OBJ_FILES_TO_LINK)
+ $(ECHO_LINKING)$(LD) $(ALL_LDFLAGS) -o $(LDOUT)$@ \
+ $(OBJ_FILES_TO_LINK) \
+ $(ALL_TOOL_LIBS)$(END_ECHO)
+
+internal-aotjavatool-install_:: $(AOT_JAVA_TOOL_INSTALL_DIR)/$(GNUSTEP_TARGET_DIR)
+ $(ECHO_INSTALLING)$(INSTALL_PROGRAM) -m 0755 \
+ $(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT) \
+ $(AOT_JAVA_TOOL_INSTALL_DIR)/$(GNUSTEP_TARGET_DIR)$(END_ECHO)
+
+$(AOT_JAVA_TOOL_INSTALL_DIR)/$(GNUSTEP_TARGET_DIR):
+ $(ECHO_CREATING)$(MKINSTALLDIRS) $@$(END_ECHO)
+
+internal-aotjavatool-uninstall_::
+ $(ECHO_UNINSTALLING)rm -f $(AOT_JAVA_TOOL_INSTALL_DIR)/$(GNUSTEP_TARGET_DIR)/$(GNUSTEP_INSTANCE)$(EXEEXT)$(END_ECHO)
+
+include $(GNUSTEP_MAKEFILES)/Instance/Shared/strings.make
+
# The list of JAVA source files from which to generate jni headers
# are in the JAVA_JNI_FILES variable.
#
+# The list of ahead-of-time JAVA source files to be compiled
+# are in the AOT_JAVA_FILES variable.
+#
# This list of WINDRES source files to be compiled
# are in the WINDRES_FILES variable.
#
OBJC_OBJS = $(patsubst %.m,%$(OEXT),$($(GNUSTEP_INSTANCE)_OBJC_FILES))
OBJC_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(OBJC_OBJS))
+AOT_JAVA_OBJS = $(patsubst %.java,%$(OEXT),$($(GNUSTEP_INSTANCE)_AOT_JAVA_FILES))
+AOT_JAVA_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(AOT_JAVA_OBJS))
+
JAVA_OBJS = $(patsubst %.java,%.class,$($(GNUSTEP_INSTANCE)_JAVA_FILES))
JAVA_OBJ_FILES = $(JAVA_OBJS)
# OBJ_FILES_TO_LINK to '' we know if there is a link stage to be
# performed at all (useful for example in bundles which can contain an
# object file, or not).
-OBJ_FILES_TO_LINK = $(strip $(C_OBJ_FILES) $(OBJC_OBJ_FILES) $(CC_OBJ_FILES) $(WINDRES_OBJ_FILES) $(SUBPROJECT_OBJ_FILES) $(OBJ_FILES))
+OBJ_FILES_TO_LINK = $(strip $(C_OBJ_FILES) $(OBJC_OBJ_FILES) $(CC_OBJ_FILES) $(AOT_JAVA_OBJ_FILES) $(WINDRES_OBJ_FILES) $(SUBPROJECT_OBJ_FILES) $(OBJ_FILES))
ifeq ($(AUTO_DEPENDENCIES),yes)
ifneq ($(strip $(OBJ_FILES_TO_LINK)),)
ADDITIONAL_OBJC_LIBS += $($(GNUSTEP_INSTANCE)_OBJC_LIBS)
+ADDITIONAL_AOT_JAVA_LIBS += $($(GNUSTEP_INSTANCE)_AOT_JAVA_LIBS)
+
ADDITIONAL_LIBRARY_LIBS += $($(GNUSTEP_INSTANCE)_LIBS) \
$($(GNUSTEP_INSTANCE)_LIBRARY_LIBS)
ADDITIONAL_OBJCFLAGS += $($(GNUSTEP_INSTANCE)_OBJCFLAGS)
+ADDITIONAL_AOT_JAVAFLAGS += $($(GNUSTEP_INSTANCE)_AOT_JAVAFLAGS)
+
ADDITIONAL_CCFLAGS += $($(GNUSTEP_INSTANCE)_CCFLAGS)
ADDITIONAL_LDFLAGS += $($(GNUSTEP_INSTANCE)_LDFLAGS)
--- /dev/null
+#
+# Master/gcj-java-tool.make
+#
+# Master Makefile rules to build GNUstep-based command line ctools.
+#
+# Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
+#
+# Author: Scott Christley <scottc@net-community.com>
+# Author: Nicola Pero <nicola@brainstorm.co.uk>
+# Author: Helge Hess <helge.hess@opengroupware.org>
+#
+# This file is part of the GNUstep Makefile Package.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; see the file COPYING.LIB.
+# If not, write to the Free Software Foundation,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ifeq ($(RULES_MAKE_LOADED),)
+include $(GNUSTEP_MAKEFILES)/rules.make
+endif
+
+AOT_JAVA_TOOL_NAME := $(strip $(AOT_JAVA_TOOL_NAME))
+
+internal-all:: $(AOT_JAVA_TOOL_NAME:=.all.aotjavatool.variables)
+
+internal-install:: $(AOT_JAVA_TOOL_NAME:=.install.aotjavatool.variables)
+
+internal-uninstall:: $(AOT_JAVA_TOOL_NAME:=.uninstall.aotjavatool.variables)
+
+internal-clean::
+ rm -rf $(GNUSTEP_OBJ_DIR)
+
+internal-distclean::
+ (cd $(GNUSTEP_BUILD_DIR); \
+ rm -rf shared_obj static_obj shared_debug_obj shared_profile_obj \
+ static_debug_obj static_profile_obj shared_profile_debug_obj \
+ static_profile_debug_obj)
+
+AOT_JAVA_TOOLS_WITH_SUBPROJECTS = $(strip $(foreach aotjavatool,$(AOT_JAVA_TOOL_NAME),$(patsubst %,$(aotjavatool),$($(aotjavatool)_SUBPROJECTS))))
+ifneq ($(AOT_JAVA_TOOLS_WITH_SUBPROJECTS),)
+internal-clean:: $(AOT_JAVA_TOOLS_WITH_SUBPROJECTS:=.clean.aotjavatool.subprojects)
+internal-distclean:: $(AOT_JAVA_TOOLS_WITH_SUBPROJECTS:=.distclean.aotjavatool.subprojects)
+endif
+
+internal-strings:: $(AOT_JAVA_TOOL_NAME:=.strings.aotjavatool.variables)
+
+$(AOT_JAVA_TOOL_NAME):
+ @$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory \
+ $@.all.aotjavatool.variables
#
# The name of the tools is in the JAVA_TOOL_NAME variable.
# The main class (the one implementing main) is in the
-# xxx_PRINCIPAL_CLASS variable.
+# xxx_MAIN_CLASS variable.
#
JAVA_TOOL_NAME := $(strip $(JAVA_TOOL_NAME))
JAVAH = $(JAVA_HOME)/bin/javah
endif
+#
+# Some GCJ Java Options
+#
+
+INTERNAL_AOT_JAVAFLAGS += -fjni -findirect-dispatch
+
+ifeq ($(shared), yes)
+ INTERNAL_AOT_JAVAFLAGS += $(SHARED_CFLAGS)
+endif
+
+INTERNAL_AOT_JAVAFLAGS += $(ADDITIONAL_FLAGS) $(OPTFLAG)
+
#
# Common variables - default values
#
--- /dev/null
+#
+# gcj-tool.make
+#
+# Makefile rules to build GNUstep-based command line ctools.
+#
+# Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+#
+# Author: Nicola Pero <nicola@brainstorm.co.uk>
+# Author: Helge Hess <helge.hess@opengroupware.org>
+#
+# This file is part of the GNUstep Makefile Package.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; see the file COPYING.LIB.
+# If not, write to the Free Software Foundation,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ifeq ($(GNUSTEP_INSTANCE),)
+include $(GNUSTEP_MAKEFILES)/Master/gcj-tool.make
+else
+
+ifeq ($(GNUSTEP_TYPE),aotjavatool)
+include $(GNUSTEP_MAKEFILES)/Instance/gcj-tool.make
+endif
+
+endif
$(GNUSTEP_HEADERS_FLAGS) \
$(GNUSTEP_FRAMEWORKS_FLAGS)
+ALL_AOT_JAVAFLAGS = $(INTERNAL_AOT_JAVAFLAGS) $(ADDITIONAL_AOT_JAVAFLAGS) \
+ $(AUXILIARY_AOT_JAVAFLAGS) $(ADDITIONAL_INCLUDE_DIRS) \
+ $(AUXILIARY_INCLUDE_DIRS) \
+ $(DERIVED_SOURCES_HEADERS_FLAG) \
+ -I. $(SYSTEM_INCLUDES) \
+ $(GNUSTEP_HEADERS_FLAGS) \
+ $(GNUSTEP_FRAMEWORKS_FLAGS)
+
# if you need, you can define ADDITIONAL_CCFLAGS to add C++ specific flags
ALL_CCFLAGS = $(ADDITIONAL_CCFLAGS) $(AUXILIARY_CCFLAGS)
$(PCH_INCLUDE_FLAG) \
$($<_FILE_FLAGS) -o $@$(END_ECHO)
+$(GNUSTEP_OBJ_DIR)/%${OEXT} : %.java
+ $(ECHO_COMPILING)$(CC) $< -c \
+ $(filter-out -D%,$(ALL_CPPFLAGS) $(ALL_AOT_JAVAFLAGS)) \
+ $(PCH_INCLUDE_FLAG) \
+ $($<_FILE_FLAGS) -o $@$(END_ECHO)
+
$(GNUSTEP_OBJ_DIR)/%${OEXT} : %.C
$(ECHO_COMPILING)$(CC) $< -c \
$(filter-out $($<_FILE_FILTER_OUT_FLAGS),$(ALL_CPPFLAGS) \