xref: /openbsd-src/gnu/usr.bin/gcc/gcc/configure.frag (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1*c87b03e5Sespie# configure.frag for GCC
2*c87b03e5Sespie# Process the host/target/language Makefile fragments.
3*c87b03e5Sespie
4*c87b03e5Sespie# Copyright (C) 1997 Free Software Foundation, Inc.
5*c87b03e5Sespie
6*c87b03e5Sespie#This file is part of GCC.
7*c87b03e5Sespie
8*c87b03e5Sespie#GCC is free software; you can redistribute it and/or modify it under
9*c87b03e5Sespie#the terms of the GNU General Public License as published by the Free
10*c87b03e5Sespie#Software Foundation; either version 2, or (at your option) any later
11*c87b03e5Sespie#version.
12*c87b03e5Sespie
13*c87b03e5Sespie#GCC is distributed in the hope that it will be useful, but WITHOUT
14*c87b03e5Sespie#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15*c87b03e5Sespie#FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16*c87b03e5Sespie#for more details.
17*c87b03e5Sespie
18*c87b03e5Sespie#You should have received a copy of the GNU General Public License
19*c87b03e5Sespie#along with GCC; see the file COPYING.  If not, write to the Free
20*c87b03e5Sespie#Software Foundation, 59 Temple Place - Suite 330, Boston, MA
21*c87b03e5Sespie#02111-1307, USA.
22*c87b03e5Sespie
23*c87b03e5Sespie# First parameter is the source directory, second is list of subdirectories,
24*c87b03e5Sespie# third is list of host makefile fragments, fourth is list of target makefile
25*c87b03e5Sespie# fragments.
26*c87b03e5Sespie
27*c87b03e5Sespiesrcdir=$1
28*c87b03e5Sespiesubdirs=$2
29*c87b03e5Sespiexmake_files=$3
30*c87b03e5Sespietmake_files=$4
31*c87b03e5Sespie
32*c87b03e5Sespie# Copy all the host makefile fragments into Make-host.
33*c87b03e5Sespie
34*c87b03e5Sespierm -f Make-host
35*c87b03e5Sespietouch Make-host
36*c87b03e5Sespiefor f in .. $xmake_files
37*c87b03e5Sespiedo
38*c87b03e5Sespie	if [ -f $f ]
39*c87b03e5Sespie	then
40*c87b03e5Sespie		cat $f >> Make-host
41*c87b03e5Sespie	fi
42*c87b03e5Sespiedone
43*c87b03e5Sespie
44*c87b03e5Sespie# Copy all the target makefile fragments into Make-target.
45*c87b03e5Sespie
46*c87b03e5Sespierm -f Make-target
47*c87b03e5Sespietouch Make-target
48*c87b03e5Sespiefor f in .. $tmake_files
49*c87b03e5Sespiedo
50*c87b03e5Sespie	if [ -f $f ]
51*c87b03e5Sespie	then
52*c87b03e5Sespie		cat $f >> Make-target
53*c87b03e5Sespie	fi
54*c87b03e5Sespiedone
55*c87b03e5Sespie
56*c87b03e5Sespie# Ensure the language build subdirectories exist.
57*c87b03e5Sespie
58*c87b03e5Sespiefor subdir in . $subdirs
59*c87b03e5Sespiedo
60*c87b03e5Sespie	if [ $subdir != . ]
61*c87b03e5Sespie	then
62*c87b03e5Sespie		test -d $subdir || mkdir $subdir
63*c87b03e5Sespie	fi
64*c87b03e5Sespiedone
65*c87b03e5Sespie
66*c87b03e5Sespie# Now copy each language's Make-lang.in file to Make-lang.
67*c87b03e5Sespie
68*c87b03e5Sespierm -f Make-lang
69*c87b03e5Sespietouch Make-lang
70*c87b03e5Sespie
71*c87b03e5Sespiefor subdir in . $subdirs
72*c87b03e5Sespiedo
73*c87b03e5Sespie	if [ $subdir != . ]
74*c87b03e5Sespie	then
75*c87b03e5Sespie		cat $srcdir/$subdir/Make-lang.in >> Make-lang
76*c87b03e5Sespie	fi
77*c87b03e5Sespiedone
78