2001-04-09 Andrew MacLeod <amacleod@redhat.com>
[official-gcc.git] / gcc / fixinc / Makefile.in
blob40406da81acc49f3d691dd2867d8426d6e6c0119
1 # Makefile for GNU compilers.
3 # Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
5 #This file is part of GNU CC.
7 #GNU CC is free software; you can redistribute it and/or modify
8 #it under the terms of the GNU General Public License as published by
9 #the Free Software Foundation; either version 2, or (at your option)
10 #any later version.
12 #GNU CC is distributed in the hope that it will be useful,
13 #but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 #GNU General Public License for more details.
17 #You should have received a copy of the GNU General Public License
18 #along with GNU CC; see the file COPYING. If not, write to
19 #the Free Software Foundation, 59 Temple Place - Suite 330,
20 #Boston, MA 02111-1307, USA.
22 # The makefile built from this file lives in the fixinc subdirectory.
23 # Its purpose is to build the any-platforms fixinc.sh script.
25 SHELL=/bin/sh
27 FL_LIST = $(CFLAGS) $(CPPFLAGS) $(WARN_CFLAGS)
28 FIXINC_DEFS = -DIN_GCC -DHAVE_CONFIG_H $(FL_LIST) $(INCLUDES)
30 # Directory where sources are, from where we are.
31 srcdir = @srcdir@
32 VPATH = $(srcdir)
33 subdir = fixinc
35 # End of variables for you to override.
37 default : all
39 # Now figure out from those variables how to compile and link.
41 # Specify the directories to be searched for header files.
42 # Both . and srcdir are used, in that order.
44 INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. \
45 -I$(srcdir)/../config -I$(srcdir)/../../include
47 # Always use -I$(srcdir)/config when compiling.
48 .c.o:
49 $(CC) -c $(FIXINC_DEFS) $<
51 # The only suffixes we want for implicit rules are .c and .o.
52 .SUFFIXES:
53 .SUFFIXES: .c .o
55 #\f
57 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
59 ## Makefile for constructing the "best" include fixer we can
61 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
63 LIBERTY = ../../libiberty/libiberty.a
65 ALLOBJ = fixincl.o fixtests.o fixfixes.o server.o procopen.o \
66 gnu-regex.o fixlib.o
68 TESTOBJ = fixincl.o fixlib.o fixtests.o gnu-regex.o
69 FIXOBJ = fixfixes.o fixlib.o gnu-regex.o
71 HDR = server.h gnu-regex.h fixlib.h machname.h
72 FI = fixincl@build_exeext@
73 AF = applyfix@build_exeext@
75 all : $(TARGETS)
76 gen : $(srcdir)/fixincl.x
78 oneprocess : full-stamp
79 twoprocess : test-stamp $(AF)
81 full-stamp : $(ALLOBJ) $(LIBERTY)
82 $(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $(FI) $(ALLOBJ) $(LIBERTY)
83 touch $@
85 test-stamp : $(TESTOBJ) $(LIBERTY)
86 $(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $(FI) $(TESTOBJ) $(LIBERTY)
87 touch $@
89 $(AF): $(FIXOBJ) $(LIBERTY)
90 $(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $@ $(FIXOBJ) $(LIBERTY)
92 $(ALLOBJ) : $(HDR)
93 fixincl.o : fixincl.c $(srcdir)/fixincl.x
94 fixtests.o : fixtests.c
95 fixfixes.o : fixfixes.c $(srcdir)/fixincl.x
96 server.o : server.c
97 procopen.o : procopen.c
98 gnu-regex.o : gnu-regex.c
99 fixlib.o : fixlib.c
101 # 'machname.h' is built in the build directory.
102 # 'fixincl.x' in the source dir.
104 machname.h: ../specs
105 $(SHELL) $(srcdir)/genfixes $@
107 $(srcdir)/fixincl.x: fixincl.tpl inclhack.def
108 cd $(srcdir) ; $(SHELL) ./genfixes $@
110 clean:
111 rm -f *.o *-stamp $(AF) $(FI) machname.h *~
113 maintainer-clean : clean
114 rm -f $(srcdir)/fixincl.x
116 # Build the executable and copy up into gcc dir.
117 # We still copy the script because we still have alternative scripts.
119 install-bin : $(TARGETS)
120 ./fixincl -v
121 @if [ -f ../fixinc.sh ] ; then rm -f ../fixinc.sh || \
122 mv -f ../fixinc.sh ../fixinc.sh.$$ || exit 1 ; else : ; fi
123 @cp $(srcdir)/fixincl.sh ../fixinc.sh
124 chmod 755 ../fixinc.sh
126 Makefile: Makefile.in ../config.status
127 cd .. \
128 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
129 $(SHELL) ./config.status
131 check : $(TARGETS)
132 autogen -T $(srcdir)/check.tpl $(srcdir)/inclhack.def
133 $(SHELL) ./check.sh $(srcdir)/tests/base
134 @rm -f ./check.sh