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, 59 Temple Place - Suite 330,
21 #Boston, MA 02111-1307, 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
>
33 INCLUDES
= -I.
-I
$(srcdir) -I..
/include -I
$(srcdir)/..
/include
34 FIXINC_CFLAGS
= -DHAVE_CONFIG_H
$(INCLUDES
)
36 # Directory where sources are, from where we are.
40 # Directory in which to put the directories used by the compiler.
42 # Directory in which GCC puts its executables.
43 libexecdir
= @libexecdir@
45 # End of variables for you to override.
47 # The target that we're configured for.
49 target_noncanonical
:=@target_noncanonical@
51 # The version of GCC in this tree
52 gcc_version
:= $(shell cat
$(srcdir)/..
/gcc
/BASE-VER
)
54 # Directory in which the compiler finds libraries etc.
55 libsubdir
= $(libdir)/gcc
/$(target_noncanonical
)/$(gcc_version
)
56 # Directory in which the compiler finds executables
57 libexecsubdir
= $(libexecdir
)/gcc
/$(target_noncanonical
)/$(gcc_version
)
58 # Where our executable files go
59 itoolsdir
= $(libexecsubdir
)/install-tools
60 # Where our data files go
61 itoolsdatadir
= $(libsubdir
)/install-tools
63 # Locate mkinstalldirs.
64 mkinstalldirs
=$(SHELL
) $(srcdir)/..
/mkinstalldirs
68 # Now figure out from those variables how to compile and link.
71 $(CC
) -c
$(CFLAGS
) $(CPPFLAGS
) $(FIXINC_CFLAGS
) $<
73 # The only suffixes we want for implicit rules are .c and .o.
79 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
81 ## Makefile for constructing the "best" include fixer we can
83 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
85 LIBIBERTY
=..
/libiberty
/libiberty.a
87 ALLOBJ
= fixincl.o fixtests.o fixfixes.o server.o procopen.o \
90 TESTOBJ
= fixincl.o fixlib.o fixtests.o fixopts.o
91 FIXOBJ
= fixfixes.o fixlib.o fixopts.o
93 HDR
= server.h fixlib.h
97 all : @TARGET@ fixinc.sh mkheaders
98 gen
: $(srcdir)/fixincl.x
101 oneprocess
: full-stamp
102 twoprocess
: test-stamp
$(AF
)
104 full-stamp
: $(ALLOBJ
) $(LIBIBERTY
)
105 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$(FI
) $(ALLOBJ
) $(LIBIBERTY
)
108 test-stamp
: $(TESTOBJ
) $(LIBIBERTY
)
109 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$(FI
) $(TESTOBJ
) $(LIBIBERTY
)
112 $(AF
): $(FIXOBJ
) $(LIBIBERTY
)
113 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(FIXOBJ
) $(LIBIBERTY
)
116 fixincl.o
: fixincl.c
$(srcdir)/fixincl.x
117 fixtests.o
: fixtests.c
118 fixfixes.o
: fixfixes.c
$(srcdir)/fixincl.x
120 procopen.o
: procopen.c
123 fixinc.sh
: fixinc.in mkfixinc.sh Makefile
124 srcdir="$(srcdir)" $(SHELL
) $(srcdir)/mkfixinc.sh
$(target
)
126 $(srcdir)/fixincl.x
: @MAINT@ fixincl.tpl inclhack.def
127 cd
$(srcdir) ; $(SHELL
) .
/genfixes
130 rm -f
*.o
*-stamp
$(AF
) $(FI
) *~ fixinc.sh
133 rm -f mkheaders mkheaders.almost
136 rm -f Makefile config.h config.log config.status stamp-h
138 maintainer-clean
: distclean
139 rm -f
$(srcdir)/fixincl.x
143 Makefile
: $(srcdir)/Makefile.in config.status
144 $(SHELL
) .
/config.status Makefile
146 mkheaders.almost
: $(srcdir)/mkheaders.in config.status
147 CONFIG_FILES
=mkheaders.almost
:mkheaders.in \
148 CONFIG_HEADERS
= .
/config.status
150 mkheaders
: mkheaders.almost
$(srcdir)/..
/gcc
/BASE-VER
151 sed
-e
's/@gcc_version@/$(gcc_version)/' < $< > $@T
155 stamp-h
: $(srcdir)/config.h.in config.status
156 $(SHELL
) .
/config.status config.h
158 config.status
: $(srcdir)/configure
159 $(SHELL
) .
/config.status
--recheck
161 $(srcdir)/configure
: @MAINT@
$(srcdir)/configure.ac
164 $(srcdir)/config.h.in
: @MAINT@
$(srcdir)/configure.ac
167 $(srcdir)/aclocal.m4
: @MAINT@
$(srcdir)/..
/gcc
/aclocal.m4
168 cp
$(srcdir)/..
/gcc
/aclocal.m4 .
171 autogen
-T
$(srcdir)/check.tpl
$(srcdir)/inclhack.def
172 $(SHELL
) .
/check.sh
$(srcdir)/tests
/base
176 -rm -rf
$(DESTDIR
)$(itoolsdir
)
177 $(mkinstalldirs
) $(DESTDIR
)$(itoolsdir
)
178 $(mkinstalldirs
) $(DESTDIR
)$(itoolsdatadir
)/include
179 $(INSTALL_DATA
) $(srcdir)/README-fixinc \
180 $(DESTDIR
)$(itoolsdatadir
)/include/README
181 $(INSTALL_SCRIPT
) fixinc.sh
$(DESTDIR
)$(itoolsdir
)/fixinc.sh
182 $(INSTALL_PROGRAM
) fixincl@EXEEXT@ \
183 $(DESTDIR
)$(itoolsdir
)/fixincl@EXEEXT@
184 $(INSTALL_SCRIPT
) mkheaders
$(DESTDIR
)$(itoolsdir
)/mkheaders