Make-lang.in   [plain text]


# APPLE LOCAL Objective-C++
# Top level makefile fragment for GNU Objective-C++
#   Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.

#This file is part of GNU CC.

#GNU CC 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, or (at your option)
#any later version.

#GNU CC is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with GNU CC; see the file COPYING.  If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA.

# This file provides the language dependent support in the main Makefile.
# Each language makefile fragment must provide the following targets:
#
# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
# foo.info, foo.dvi,
# foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
# foo.uninstall,
# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
#
# where `foo' is the name of the language.
#
# It should also provide rules for:
#
# - making any compiler driver (eg: g++)
# - the compiler proper (eg: cc1plus)
# - define the names for selecting the language in LANGUAGES.

#
# Define the names for selecting Objective-C++ in LANGUAGES.
OBJC++ objc++: cc1objplus$(exeext)
OBJECTIVE-C++ objective-c++: cc1objplus$(exeext)

# Tell GNU make to ignore these if they exist.
.PHONY: objective-c++ objc++ ObjC++

# Use maximal warnings for this front end (actually, this applies to the ObjC files,
# not the C++ files, which have been compiled elsewhere).
objc++-warn = $(STRICT_WARN)

# APPLE LOCAL begin order files  --ilr
ifeq ($(ORDER_FILES),yes)
CC1OBJPLUS_ORDER_FLAGS = `if [ -f $(srcdir)/../order-files/cc1objplus.order ]; then \
		           echo -sectorder __TEXT __text $(srcdir)/../order-files/cc1objplus.order -e start ; fi`
else
CC1OBJPLUS_ORDER_FLAGS =
endif
# APPLE LOCAL end order files  --ilr

# Language-specific object files for Objective C++.
# APPLE LOCAL new tree dump
# APPLE LOCAL debugging
# APPLE LOCAL separate outputdir
OBJCP_OBJS = $(CXX_AND_OBJCP_OBJS) $(CXX_C_OBJS) objcp/objcp-lang.o \
  objcp/objcp-parse.o objcp/objcp-decl.o objcp/objcp-act.o \
  objcp/objcp-idebug.o objcp/objcp-dmp-tree.o

# APPLE LOCAL order files  --ilr
cc1objplus$(exeext): $(OBJCP_OBJS) $(BACKEND) libcpp.a $(LIBDEPS)
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(OBJCP_OBJS) $(BACKEND) libcpp.a $(LIBS) \
	$(CC1OBJPLUS_ORDER_FLAGS)

# Objective C++ language specific files.

# APPLE LOCAL separate outputdir
objcp/objcp-decl.o : $(srcdir)/objcp/objcp-decl.c $(srcdir)/objcp/objcp-decl.h \
   $(CONFIG_H) $(TREE_H) $(srcdir)/toplev.h $(srcdir)/ggc.h \
   $(srcdir)/cp/lex.h $(srcdir)/cp/cp-tree.h $(srcdir)/c-common.h \
   $(srcdir)/input.h $(srcdir)/flags.h $(srcdir)/output.h \
   $(srcdir)/objc/objc-act.h $(SYSTEM_H) $(CPPLIB_H)
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/cp -I$(srcdir)/objc \
	-I$(srcdir)/objcp -DOBJCPLUS -c $(srcdir)/objcp/objcp-decl.c $(OUTPUT_OPTION)

# APPLE LOCAL separate outputdir
objcp/objcp-lang.o : $(srcdir)/cp/cp-lang.c \
   $(CONFIG_H) $(TREE_H) $(srcdir)/toplev.h $(srcdir)/ggc.h \
   $(srcdir)/cp/lex.h $(srcdir)/cp/cp-tree.h $(srcdir)/c-common.h \
   $(srcdir)/input.h $(srcdir)/flags.h $(srcdir)/output.h \
   $(srcdir)/objc/objc-act.h $(SYSTEM_H) $(CPPLIB_H)
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/cp -I$(srcdir)/objc \
	-I$(srcdir)/objcp -DOBJCPLUS -c $(srcdir)/cp/cp-lang.c $(OUTPUT_OPTION)

objcp/objcp-parse.o : $(parsedir)/objcp/objcp-parse.c $(CXX_TREE_H) flags.h cp/lex.h \
   except.h output.h \
   $(SYSTEM_H) toplev.h $(GGC_H) objc/objc-act.h objcp/objcp-decl.h
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/cp \
	-I$(srcdir)/objc $(BIG_SWITCHFLAG) \
	-DOBJCPLUS $(parsedir)/objcp/objcp-parse.c $(OUTPUT_OPTION)

# APPLE LOCAL parsedir
po-generated: $(parsedir)/objcp/objcp-parse.c

# APPLE LOCAL parsedir
# APPLE LOCAL Objective-C++
$(parsedir)/objcp/objcp-parse.c : $(parsedir)/objcp/objcp-parse.y
	cd $(parsedir)/objcp; \
	$(BISON) $(BISONFLAGS) -d -v -o p$$$$.c objcp-parse.y ; \
	mv -f p$$$$.c objcp-parse.c

# APPLE LOCAL parsedir
$(parsedir)/objcp/objcp-parse.y : $(srcdir)/cp/cp-parse.in
	echo '/*WARNING: This file is automatically generated!*/' >tmp-objcp-prs.y
	sed -e "/^ifcp$$/,/^end ifcp$$/d" \
	  -e "/^ifobjcp$$/d" -e "/^end ifobjcp$$/d" \
	  -e "/^...ifobjcp...$$/d" -e "/^...end ifobjcp...$$/d" \
	  $(srcdir)/cp/cp-parse.in >>tmp-objcp-prs.y
	$(SHELL) $(srcdir)/move-if-change tmp-objcp-prs.y $(parsedir)/objcp/objcp-parse.y

# APPLE LOCAL separate outputdir
objcp/objcp-act.o : $(srcdir)/objc/objc-act.c $(srcdir)/objcp/objcp-decl.h \
   $(CONFIG_H) $(TREE_H) $(RTL_H) $(SYSTEM_H) $(EXPR_H) $(TARGET_H) \
   $(srcdir)/c-tree.h $(srcdir)/c-common.h $(VARRAY_H) \
   $(srcdir)/toplev.h $(srcdir)/flags.h objc/objc-act.h objcp/objcp-decl.h \
   $(srcdir)/input.h $(srcdir)/function.h $(srcdir)/output.h $(srcdir)/debug.h \
   $(srcdir)/langhooks.h $(srcdir)/langhooks-def.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/cp -I$(srcdir)/objc \
	-I$(srcdir)/objcp -DOBJCPLUS -c $(srcdir)/objc/objc-act.c $(OUTPUT_OPTION)

# APPLE LOCAL debugging
# Suppress all warnings explicitly for the idebug builds since there can be
# many when, and if, -traditional-cpp is used.
# APPLE LOCAL separate outputdir
objcp/objcp-idebug.o : $(srcdir)/objc/objc-idebug.c $(CONFIG_H) $(TREE_H) $(C_TREE_H) \
   $(RTL_H) $(srcdir)/objc/objc-act.h flags.h c-idebug.c idebug.c
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/cp -I$(srcdir)/objc \
	-I$(srcdir)/objcp -DOBJCPLUS -c -w $(srcdir)/objc/objc-idebug.c $(OUTPUT_OPTION)

# APPLE LOCAL new tree dump
# APPLE LOCAL separate outputdir
objcp/objcp-dmp-tree.o: $(srcdir)/objc/objc-dmp-tree.c $(srcdir)/cp/cp-dmp-tree.c \
   $(srcdir)/c-dmp-tree.c $(CONFIG_H) $(TREE_H) $(SYSTEM_H) $(srcdir)/c-common.h \
   $(srcdir)/objc/objc-act.h \
   $(srcdir)/cp/cp-tree.h \
   $(srcdir)/dmp-tree.c $(srcdir)/dmp-tree.h
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/cp -I$(srcdir)/objc \
	-I$(srcdir)/objcp -DOBJCPLUS -c $(srcdir)/objc/objc-dmp-tree.c $(OUTPUT_OPTION)

# APPLE LOCAL separate outputdir
objcp/objcp-act.o : config.h

gtype-objcp.h : s-gtype ; @true

#
# Build hooks:

objc++.all.build:
objc++.all.cross:
objc++.start.encap:
objc++.rest.encap:

objc++.info:
objc++.dvi:
objc++.generated-manpages:

#
# Install hooks:
# cc1objplus is installed elsewhere as part of $(COMPILERS).

objc++.install-normal:

objc++.install-common:

objc++.install-info:

objc++.install-man:

objc++.uninstall:
#
# Clean hooks:
# A lot of the ancillary files are deleted by the main makefile.
# We just have to delete files specific to us.
objc++.mostlyclean:
	-rm -f objcp/*$(objext)
objc++.clean: objc++.mostlyclean
	-rm -rf objcp-headers
objc++.distclean:
	-rm -f objcp/config.status objcp/Makefile
	-rm -f $(parsedir)/objcp/objcp-parse.output
objc++.extraclean:
# APPLE LOCAL: parsedir
objc++.maintainer-clean:
	-rm -f $(parsedir)/objcp/objcp-parse.y
	-rm -f $(parsedir)/objcp/objcp-parse.c $(parsedir)/objcp/objcp-parse.output

#
# Stage hooks:

objc++.stage1: stage1-start
	-mv objcp/*$(objext) stage1/objcp
	-mv cc1objplus$(exeext) stage1
objc++.stage2: stage2-start
	-mv objcp/*$(objext) stage2/objcp
	-mv cc1objplus$(exeext) stage2
objc++.stage3: stage3-start
	-mv objcp/*$(objext) stage3/objcp
	-mv cc1objplus$(exeext) stage3
objc++.stage4: stage4-start
	-mv objcp/*$(objext) stage4/objcp
	-mv cc1objplus$(exeext) stage4
	
# These exist for maintenance purposes.

# APPLE LOCAL Objective-C++
# Update the tags table.
objcp/TAGS: force
	cd $(srcdir)/objcp ;			\
	etags --no-globals -l c `echo *.c | sed 's/objcp-parse.c//'` \
	  objcp-parse.y *.h ../*.c ../*.h;

.PHONY: objcp/TAGS