Support .mm files for ObjC++

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@21778 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2005-10-06 02:10:50 +00:00
parent d57cd8d4a3
commit fce27dc627
3 changed files with 36 additions and 2 deletions

View file

@ -1,3 +1,19 @@
2005-10-06 Nicola Pero <n.pero@mi.flashnet.it>
Added support for ObjC++. You should list the ObjC++ .mm files in
the xxx_OBJCC_FILES variable, and put extra ObjC++ flags in
xxx_OBJCCFLAGS or ADDITIONAL_OBJCCFLAGS.
* rules.make (.SUFFIXES): Added .mm for ObjC++.
($(GNUSTEP_OBJ_DIR)/%${OEXT}): Added rule to compile .mm files
into .o files.
(ALL_OBJCCFLAGS): New variable, set from ADDITIONAL_OBJCCFLAGS and
AUXILIARY_OBJCCFLAGS.
* Instance/rules.make (OBJCC_OBJS, OBJCC_OBJ_FILES): New variables
set from xxx_OBJCC_FILES.
(OBJ_FILES_TO_LINK): Added the new OBJCC_OBJ_FILES to the list of things
to link.
(ADDITIONAL_OBJCCFLAGS): New variable set from xxx_ADDITIONAL_OBJCCFLAGS.
2005-09-28 Adam Fedor <fedor@gnu.org>
* target.make (cygwin/SHARED_LIB_LINK_CMD): Correct lib file name

View file

@ -159,6 +159,9 @@ endif
# The list of C++ source files to be compiled
# are in the CC_FILES variable.
#
# The list of Objective-C++ source files to be compiled
# are in the OBJCC_FILES variable.
#
# The list of PSWRAP source files to be compiled
# are in the PSWRAP_FILES variable.
#
@ -191,6 +194,9 @@ endif
OBJC_OBJS = $(patsubst %.m,%$(OEXT),$($(GNUSTEP_INSTANCE)_OBJC_FILES))
OBJC_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(OBJC_OBJS))
OBJCC_OBJS = $(patsubst %.mm,%$(OEXT),$($(GNUSTEP_INSTANCE)_OBJCC_FILES))
OBJCC_OBJ_FILES = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(OBJCC_OBJS))
JAVA_OBJS = $(patsubst %.java,%.class,$($(GNUSTEP_INSTANCE)_JAVA_FILES))
JAVA_OBJ_FILES = $(JAVA_OBJS)
@ -229,7 +235,7 @@ OBJ_FILES = $($(GNUSTEP_INSTANCE)_OBJ_FILES)
# 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) $(OBJCC_OBJ_FILES) $(WINDRES_OBJ_FILES) $(SUBPROJECT_OBJ_FILES) $(OBJ_FILES))
ifeq ($(AUTO_DEPENDENCIES),yes)
ifneq ($(strip $(OBJ_FILES_TO_LINK)),)
@ -266,6 +272,8 @@ ADDITIONAL_OBJCFLAGS += $($(GNUSTEP_INSTANCE)_OBJCFLAGS)
ADDITIONAL_CCFLAGS += $($(GNUSTEP_INSTANCE)_CCFLAGS)
ADDITIONAL_OBJCCFLAGS += $($(GNUSTEP_INSTANCE)_OBJCCFLAGS)
ADDITIONAL_LDFLAGS += $($(GNUSTEP_INSTANCE)_LDFLAGS)
ADDITIONAL_CLASSPATH += $($(GNUSTEP_INSTANCE)_CLASSPATH)

View file

@ -249,6 +249,9 @@ ALL_CFLAGS = $(INTERNAL_CFLAGS) $(ADDITIONAL_CFLAGS) \
# if you need, you can define ADDITIONAL_CCFLAGS to add C++ specific flags
ALL_CCFLAGS = $(ADDITIONAL_CCFLAGS) $(AUXILIARY_CCFLAGS)
# if you need, you can define ADDITIONAL_OBJCCFLAGS to add ObjC++ specific flags
ALL_OBJCCFLAGS = $(ADDITIONAL_OBJCCFLAGS) $(AUXILIARY_OBJCCFLAGS)
INTERNAL_CLASSPATHFLAGS = -classpath ./$(subst ::,:,:$(strip $(ADDITIONAL_CLASSPATH)):)$(CLASSPATH)
ALL_JAVACFLAGS = $(INTERNAL_CLASSPATHFLAGS) $(INTERNAL_JAVACFLAGS) \
@ -327,7 +330,7 @@ VPATH = .
.SUFFIXES:
# Then define our own.
.SUFFIXES: .m .c .psw .java .h .cpp .cxx .C .cc .cp
.SUFFIXES: .m .c .psw .java .h .cpp .cxx .C .cc .cp .mm
.PRECIOUS: %.c %.h $(GNUSTEP_OBJ_DIR)/%${OEXT}
@ -432,6 +435,13 @@ $(GNUSTEP_OBJ_DIR)/%${OEXT} : %.cp
$(ALL_CCFLAGS)) \
$($<_FILE_FLAGS) -o $@$(END_ECHO)
$(GNUSTEP_OBJ_DIR)/%${OEXT} : %.mm
$(ECHO_COMPILING)$(CC) $< -c \
$(filter-out $($<_FILE_FILTER_OUT_FLAGS),$(ALL_CPPFLAGS) \
$(ALL_OBJCFLAGS) \
$(ALL_OBJCCFLAGS)) \
$($<_FILE_FLAGS) -o $@$(END_ECHO)
%.class : %.java
$(ECHO_COMPILING)$(JAVAC) \
$(filter-out $($<_FILE_FILTER_OUT_FLAGS),$(ALL_JAVACFLAGS)) \