Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
234 lines (182 sloc) 7.34 KB
# -*- makefile -*-
# Top level makefile fragment for GNU g95, the GNU Fortran 95 compiler.
# Copyright (C) 2002 Free Software Foundation, Inc.
# Contributed by Paul Brook and Steven Bosscher
#This file is part of G95.
#G95 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.
#G95 is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with G95; 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.cross, foo.start.encap,,
#, foo.dvi,
# foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
# foo.uninstall, foo.distdir,
# 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: g95)
# - the compiler proper (eg: f951)
# - define the names for selecting the language in LANGUAGES.
# $(srcdir) must be set to the gcc/ source directory (*not* gcc/f95/).
# Actual name to use when installing a native compiler.
G95_INSTALL_NAME = `echo g95|sed '$(program_transform_name)'`
# Actual name to use when installing a cross-compiler.
G95_CROSS_NAME = `echo g95|sed '$(program_transform_cross_name)'`
# Some versions of `touch' (such as the version on Solaris 2.8)
# do not correctly set the timestamp due to buggy versions of `utime'
# in the kernel. So, we use `echo' instead.
STAMP = echo timestamp >
# this is in addition to th warning flags defined by default
f95-warn = -Wno-write-strings
F95_PARSER_OBJS = f95/arith.o f95/array.o f95/assign.o f95/bbt.o \
f95/check.o f95/data.o f95/decl.o f95/error.o f95/expr.o \
f95/format.o f95/interface.o f95/intrinsic.o f95/io.o \
f95/iresolve.o f95/match.o f95/matchexp.o f95/misc.o f95/module.o \
f95/parse.o f95/primary.o f95/options.o f95/resolve.o \
f95/scalarize.o f95/scanner.o f95/select.o f95/simplify.o f95/st.o \
f95/f95-lang.o f95/support.o f95/convert.o f95/trans.o \
f95/trans-common.o f95/trans-decl.o f95/trans-types.o \
f95/trans-const.o f95/trans-expr.o f95/trans-stmt.o f95/trans-io.o \
f95/trans-array.o f95/trans-intrinsic.o f95/f95-tree.o
F95_ADDITIONAL_OBJS = c-semantics.o c-pretty-print.o c-dump.o \
tree-cfg.o tree-dfa.o tree-optimize.o tree-simple.o \
tree-ssa.o tree-ssa-pre.o tree-ssa-ccp.o tree-ssa-dce.o \
disjoint-set.o tree-alias-common.o tree-alias-ecr.o \
tree-alias-type.o tree-alias-steen.o gimplify.o
# Define the names for selecting g95 in LANGUAGES.
# Tell GNU make to ignore files by these names if they exist.
.PHONY: f95 f95.clean f95.mostlyclean f95.distclean f95.extraclean f95.maintainer-clean
F95 f95: f951$(exeext)
g95spec.o: $(srcdir)/f95/g95spec.c $(SYSTEM_H) $(GCC_H) $(CONFIG_H)
$(INCLUDES) $(srcdir)/f95/g95spec.c)
G95_D_OBJS = gcc.o g95spec.o version.o prefix.o intl.o
g95$(exeext): $(G95_D_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
g95-cross$(exeext): g95$(exeext)
-rm -f g95-cross$(exeext)
cp g95$(exeext) g95-cross$(exeext)
# The actual 'compiler' is called f951
f951$(exeext): $(F95_OBJS) $(F95_ADDITIONAL_OBJS) \
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
gt-f95-f95-lang.h gtype-f95.h gt-f95-trans-decl.h gt-f95-trans.h gt-f95-trans-io.h: s-gtype; @true
# Generated files
# The files from lex and yacc are put into the source directory
# in case someone wants to build but does not have lex/yacc.
# We have a hand-crafted scanner/parser, so we don't generate
# any files.
# Build hooks: g95$(exeext)
f95.all.cross: g95-cross$(exeext)
f95.start.encap: g95$(exeext)
# Install hooks:
# Nothing to do here.
f95.install-common: installdirs
-if [ -f f951$(exeext) ] ; then \
if [ -f g95-cross$(exeext) ] ; then \
rm -f $(bindir)/$(G95_CROSS_NAME)$(exeext); \
$(INSTALL_PROGRAM) g95-cross$(exeext) $(bindir)/$(G95_CROSS_NAME)$(exeext); \
chmod a+x $(bindir)/$(G95_CROSS_NAME)$(exeext); \
if [ -d $(gcc_tooldir)/bin/. ] ; then \
rm -f $(gcc_tooldir)/bin/g95$(exeext); \
$(INSTALL_PROGRAM) g95-cross$(exeext) $(gcc_tooldir)/bin/g95$(exeext); \
else true; fi; \
else \
rm -f $(bindir)/$(G95_INSTALL_NAME)$(exeext); \
$(INSTALL_PROGRAM) g95$(exeext) $(bindir)/$(G95_INSTALL_NAME)$(exeext); \
chmod a+x $(bindir)/$(G95_INSTALL_NAME)$(exeext); \
rm -f $(bindir)/$(G95_TARGET_INSTALL_NAME)$(exeext); \
$(LN) $(bindir)/$(G95_INSTALL_NAME)$(exeext) $(bindir)/$(G95_TARGET_INSTALL_NAME)$(exeext); \
fi ; \
f95.install-man: installdirs
#TODO: write the g95 man pages
-rm -rf $(bindir)/$(G95_INSTALL_NAME)$(exeext)
-rm -rf $(bindir)/$(G95_CROSS_NAME)$(exeext)
# Clean hooks:
# A lot of the ancillary files are deleted by the main makefile.
# We just have to delete files specific to us.
-rm -f f951$(exeext)
-rm -f f95/*.o
-rm -f f95/config.status f95/Makefile
# Stage hooks:
# The toplevel makefile has already created stage?/f95 at this point.
f95.stage1: stage1-start
-mv f95/*$(objext) stage1/f95
f95.stage2: stage2-start
-mv f95/*$(objext) stage2/f95
f95.stage3: stage3-start
-mv f95/*$(objext) stage3/f95
f95.stage4: stage4-start
-mv f95/*$(objext) stage4/f95
# Maintenance hooks:
# This target creates the files that can be rebuilt, but go in the
# distribution anyway. It then copies the files to the distdir directory.
not here yet
check: check-f95
# copy the output files from the current test to source ie say the new results are OK
check-f95-fix: force
# Dependencies for source files.
# Everything depends on g95.h
$(F95_PARSER_OBJS): f95/g95.h f95/intrinsic.h
G95_TRANS_DEPS = f95/g95.h f95/intrinsic.h f95/trans.h
f95/f95-lang.o: $(G95_TRANS_DEPS) f95/g95-support.h gtype-f95.h
f95/f95-tree.c: f95/g95.h f95/trans.h
f95/support.o: $(G95_TRANS_DEPS) f95/g95-support.h
f95/convert.o: $(G95_TRANS_DEPS) f95/g95-support.h
f95/trans.o: $(G95_TRANS_DEPS)
f95/trans-decl.o: $(G95_TRANS_DEPS) gt-f95-trans-decl.h
f95/trans-types.o: $(G95_TRANS_DEPS)
f95/trans-const.o: $(G95_TRANS_DEPS)
f95/trans-expr.o: $(G95_TRANS_DEPS)
f95/trans-stmt.o: $(G95_TRANS_DEPS)
f95/trans-io.o: $(G95_TRANS_DEPS) gt-f95-trans-io.h
f95/trans-array.o: $(G95_TRANS_DEPS)
f95/trans-intrinsic.o: $(G95_TRANS_DEPS)
f95/dependency.o: f95/g95.h f95/dependency.h
Something went wrong with that request. Please try again.