2007-03-01 Paul Brook <paul@codesourcery.com>
[official-gcc.git] / fixincludes / Makefile.in
blob4e91098754183a753baa31031561362f4e7a165d
1 # Makefile for fixincludes.
3 # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004
4 # Free Software Foundation, Inc.
6 #This file is part of fixincludes.
8 #fixincludes is free software; you can redistribute it and/or modify
9 #it under the terms of the GNU General Public License as published by
10 #the Free Software Foundation; either version 2, or (at your option)
11 #any later version.
13 #fixincludes is distributed in the hope that it will be useful,
14 #but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 #GNU General Public License for more details.
18 #You should have received a copy of the GNU General Public License
19 #along with fixincludes; see the file COPYING. If not, write to
20 #the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21 #Boston, MA 02110-1301, USA.
23 SHELL=@SHELL@
25 # Some versions of `touch' (such as the version on Solaris 2.8)
26 # do not correctly set the timestamp due to buggy versions of `utime'
27 # in the kernel. So, we use `echo' instead.
28 STAMP = echo timestamp >
30 CC = @CC@
31 CFLAGS = @CFLAGS@
32 WARN_CFLAGS = @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@
33 LDFLAGS = @LDFLAGS@
34 INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include
35 FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES)
37 # Directory where sources are, from where we are.
38 srcdir = @srcdir@
39 VPATH = $(srcdir)
41 # Directory in which to put the directories used by the compiler.
42 libdir = @libdir@
43 # Directory in which GCC puts its executables.
44 libexecdir = @libexecdir@
46 # End of variables for you to override.
48 # The target that we're configured for.
49 target = @target@
50 target_noncanonical:=@target_noncanonical@
52 # The version of GCC in this tree
53 gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
55 # Directory in which the compiler finds libraries etc.
56 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
57 # Directory in which the compiler finds executables
58 libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
59 # Where our executable files go
60 itoolsdir = $(libexecsubdir)/install-tools
61 # Where our data files go
62 itoolsdatadir = $(libsubdir)/install-tools
64 # Locate mkinstalldirs.
65 mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs
67 default : all
69 # Now figure out from those variables how to compile and link.
71 .c.o:
72 $(CC) -c $(CFLAGS) $(WARN_CFLAGS) $(CPPFLAGS) $(FIXINC_CFLAGS) $<
74 # The only suffixes we want for implicit rules are .c and .o.
75 .SUFFIXES:
76 .SUFFIXES: .c .o
78 #\f
80 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
82 ## Makefile for constructing the "best" include fixer we can
84 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
86 LIBIBERTY=../libiberty/libiberty.a
88 ALLOBJ = fixincl.o fixtests.o fixfixes.o server.o procopen.o \
89 fixlib.o fixopts.o
91 TESTOBJ = fixincl.o fixlib.o fixtests.o fixopts.o
92 FIXOBJ = fixfixes.o fixlib.o fixopts.o
94 HDR = server.h fixlib.h
95 FI = fixincl@EXEEXT@
96 AF = applyfix@EXEEXT@
98 all : @TARGET@ fixinc.sh mkheaders
99 gen : $(srcdir)/fixincl.x
102 oneprocess : full-stamp
103 twoprocess : test-stamp $(AF)
105 full-stamp : $(ALLOBJ) $(LIBIBERTY)
106 $(CC) $(CFLAGS) $(LDFLAGS) -o $(FI) $(ALLOBJ) $(LIBIBERTY)
107 $(STAMP) $@
109 test-stamp : $(TESTOBJ) $(LIBIBERTY)
110 $(CC) $(CFLAGS) $(LDFLAGS) -o $(FI) $(TESTOBJ) $(LIBIBERTY)
111 $(STAMP) $@
113 $(AF): $(FIXOBJ) $(LIBIBERTY)
114 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(FIXOBJ) $(LIBIBERTY)
116 $(ALLOBJ) : $(HDR)
117 fixincl.o : fixincl.c $(srcdir)/fixincl.x
118 fixtests.o : fixtests.c
119 fixfixes.o : fixfixes.c $(srcdir)/fixincl.x
120 server.o : server.c
121 procopen.o : procopen.c
122 fixlib.o : fixlib.c
124 fixinc.sh : fixinc.in mkfixinc.sh Makefile
125 srcdir="$(srcdir)" $(SHELL) $(srcdir)/mkfixinc.sh $(target)
127 $(srcdir)/fixincl.x: @MAINT@ fixincl.tpl inclhack.def
128 cd $(srcdir) ; $(SHELL) ./genfixes
130 mostlyclean :
131 rm -f *.o *-stamp $(AF) $(FI) *~ fixinc.sh
133 clean: mostlyclean
134 rm -f mkheaders mkheaders.almost
136 distclean: clean
137 rm -f Makefile config.h config.log config.status stamp-h
139 maintainer-clean: distclean
140 rm -f $(srcdir)/fixincl.x
142 distclean : clean
144 Makefile: $(srcdir)/Makefile.in config.status
145 $(SHELL) ./config.status Makefile
147 mkheaders.almost: $(srcdir)/mkheaders.in config.status
148 CONFIG_FILES=mkheaders.almost:mkheaders.in \
149 CONFIG_HEADERS= ./config.status
151 mkheaders: mkheaders.almost $(srcdir)/../gcc/BASE-VER
152 sed -e 's/@gcc_version@/$(gcc_version)/' < $< > $@T
153 mv -f $@T $@
155 config.h: stamp-h
156 stamp-h: $(srcdir)/config.h.in config.status
157 $(SHELL) ./config.status config.h
159 config.status: $(srcdir)/configure
160 $(SHELL) ./config.status --recheck
162 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac
163 cd $(srcdir) && autoconf
165 $(srcdir)/config.h.in: @MAINT@ $(srcdir)/configure.ac
166 cd $(srcdir) && autoheader
168 $(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/../gcc/aclocal.m4
169 cp $(srcdir)/../gcc/aclocal.m4 .
171 check : all
172 autogen -T $(srcdir)/check.tpl $(srcdir)/inclhack.def
173 $(SHELL) ./check.sh $(srcdir)/tests/base
174 @rm -f ./check.sh
176 install : all
177 -rm -rf $(DESTDIR)$(itoolsdir)
178 $(mkinstalldirs) $(DESTDIR)$(itoolsdir)
179 $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include
180 $(INSTALL_DATA) $(srcdir)/README-fixinc \
181 $(DESTDIR)$(itoolsdatadir)/include/README
182 $(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh
183 $(INSTALL_PROGRAM) fixincl@EXEEXT@ \
184 $(DESTDIR)$(itoolsdir)/fixincl@EXEEXT@
185 $(INSTALL_SCRIPT) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders
187 .PHONY: dvi pdf info html install-html
189 dvi :
190 pdf :
191 info :
192 html :
193 install-html :
194 installcheck :