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)
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.
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
>
32 WARN_CFLAGS
= @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@
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.
41 # Directory in which to put the directories used by the compiler.
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.
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
69 # Now figure out from those variables how to compile and link.
72 $(CC
) -c
$(CFLAGS
) $(WARN_CFLAGS
) $(CPPFLAGS
) $(FIXINC_CFLAGS
) $<
74 # The only suffixes we want for implicit rules are .c and .o.
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 \
91 TESTOBJ
= fixincl.o fixlib.o fixtests.o fixopts.o
92 FIXOBJ
= fixfixes.o fixlib.o fixopts.o
94 HDR
= server.h fixlib.h
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
)
109 test-stamp
: $(TESTOBJ
) $(LIBIBERTY
)
110 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$(FI
) $(TESTOBJ
) $(LIBIBERTY
)
113 $(AF
): $(FIXOBJ
) $(LIBIBERTY
)
114 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(FIXOBJ
) $(LIBIBERTY
)
117 fixincl.o
: fixincl.c
$(srcdir)/fixincl.x
118 fixtests.o
: fixtests.c
119 fixfixes.o
: fixfixes.c
$(srcdir)/fixincl.x
121 procopen.o
: procopen.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
131 rm -f
*.o
*-stamp
$(AF
) $(FI
) *~ fixinc.sh
134 rm -f mkheaders mkheaders.almost
137 rm -f Makefile config.h config.log config.status stamp-h
139 maintainer-clean
: distclean
140 rm -f
$(srcdir)/fixincl.x
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
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 .
172 autogen
-T
$(srcdir)/check.tpl
$(srcdir)/inclhack.def
173 $(SHELL
) .
/check.sh
$(srcdir)/tests
/base
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-pdf install-info install-html