1 # Makefile for fixincludes.
3 # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2009, 2010, 2012
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 3, 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 COPYING3. If not see
20 #<http://www.gnu.org/licenses/>.
24 # Some versions of `touch' (such as the version on Solaris 2.8)
25 # do not correctly set the timestamp due to buggy versions of `utime'
26 # in the kernel. So, we use `echo' instead.
27 STAMP
= echo timestamp
>
31 WARN_CFLAGS
= @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@
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 @get_gcc_base_ver@
$(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
67 AUTOHEADER
= autoheader
69 ACLOCAL_AMFLAGS
= -I ..
-I ..
/config
73 # Now figure out from those variables how to compile and link.
76 $(CC
) -c
$(CFLAGS
) $(PICFLAG
) $(WARN_CFLAGS
) $(CPPFLAGS
) $(FIXINC_CFLAGS
) $<
78 # The only suffixes we want for implicit rules are .c and .o.
84 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
86 ## Makefile for constructing the "best" include fixer we can
88 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
91 LIBIBERTY
=..
/libiberty
/libiberty.a
93 LIBIBERTY
=..
/libiberty
/pic
/libiberty.a
96 ALLOBJ
= fixincl.o fixtests.o fixfixes.o server.o procopen.o \
99 TESTOBJ
= fixincl.o fixlib.o fixtests.o fixopts.o
100 FIXOBJ
= fixfixes.o fixlib.o fixopts.o
102 HDR
= server.h fixlib.h
104 AF
= applyfix@EXEEXT@
106 all : @TARGET@ fixinc.sh mkheaders
107 gen
: $(srcdir)/fixincl.x
110 oneprocess
: full-stamp
111 twoprocess
: test-stamp
$(AF
)
113 full-stamp
: $(ALLOBJ
) $(LIBIBERTY
)
114 $(CC
) $(CFLAGS
) $(PICFLAG
) $(LDFLAGS
) $(LD_PICFLAG
) -o
$(FI
) $(ALLOBJ
) $(LIBIBERTY
)
117 test-stamp
: $(TESTOBJ
) $(LIBIBERTY
)
118 $(CC
) $(CFLAGS
) $(PICFLAG
) $(LDFLAGS
) $(LD_PICFLAG
) -o
$(FI
) $(TESTOBJ
) $(LIBIBERTY
)
121 $(AF
): $(FIXOBJ
) $(LIBIBERTY
)
122 $(CC
) $(CFLAGS
) $(PICFLAG
) $(LDFLAGS
) $(LD_PICFLAG
) -o
$@
$(FIXOBJ
) $(LIBIBERTY
)
125 fixincl.o
: fixincl.c
$(srcdir)/fixincl.x
126 fixtests.o
: fixtests.c
127 fixfixes.o
: fixfixes.c
$(srcdir)/fixincl.x
129 procopen.o
: procopen.c
132 fixinc.sh
: fixinc.in mkfixinc.sh Makefile
133 srcdir="$(srcdir)" $(SHELL
) $(srcdir)/mkfixinc.sh
$(target
)
135 $(srcdir)/fixincl.x
: @MAINT@ fixincl.tpl inclhack.def
136 cd
$(srcdir) ; $(SHELL
) .
/genfixes
139 rm -f
*.o
*-stamp
$(AF
) $(FI
) *~ fixinc.sh
142 rm -f mkheaders mkheaders.almost
145 rm -f Makefile config.h config.log config.status stamp-h
147 maintainer-clean
: distclean
148 rm -f
$(srcdir)/fixincl.x
152 Makefile
: $(srcdir)/Makefile.in config.status
153 $(SHELL
) .
/config.status Makefile
155 mkheaders.almost
: $(srcdir)/mkheaders.in config.status
156 CONFIG_FILES
=mkheaders.almost
:mkheaders.in \
157 CONFIG_HEADERS
= .
/config.status
159 mkheaders
: mkheaders.almost
$(srcdir)/..
/gcc
/BASE-VER
160 sed
-e
's/@gcc_version@/$(gcc_version)/' < $< > $@T
164 stamp-h
: $(srcdir)/config.h.in config.status
165 $(SHELL
) .
/config.status config.h
167 config.status
: $(srcdir)/configure
168 $(SHELL
) .
/config.status
--recheck
170 $(srcdir)/configure
: @MAINT@
$(srcdir)/configure.ac
$(srcdir)/aclocal.m4
171 cd
$(srcdir) && $(AUTOCONF
)
173 $(srcdir)/config.h.in
: @MAINT@
$(srcdir)/configure.ac
174 cd
$(srcdir) && $(AUTOHEADER
)
176 $(srcdir)/aclocal.m4
: @MAINT@
$(srcdir)/configure.ac
177 cd
$(srcdir) && $(ACLOCAL
) $(ACLOCAL_AMFLAGS
)
180 autogen
-T
$(srcdir)/check.tpl
$(srcdir)/inclhack.def
181 $(SHELL
) .
/check.sh
$(srcdir)/tests
/base
185 -rm -rf
$(DESTDIR
)$(itoolsdir
)
186 $(mkinstalldirs
) $(DESTDIR
)$(itoolsdir
)
187 $(mkinstalldirs
) $(DESTDIR
)$(itoolsdatadir
)/include
188 $(INSTALL_DATA
) $(srcdir)/README-fixinc \
189 $(DESTDIR
)$(itoolsdatadir
)/include/README
190 $(INSTALL_SCRIPT
) fixinc.sh
$(DESTDIR
)$(itoolsdir
)/fixinc.sh
191 $(INSTALL_PROGRAM
) $(FI
) $(DESTDIR
)$(itoolsdir
)/$(FI
)
192 $(INSTALL_SCRIPT
) mkheaders
$(DESTDIR
)$(itoolsdir
)/mkheaders
194 install-strip
: install
195 test -z
'$(STRIP)' ||
$(STRIP
) $(DESTDIR
)$(itoolsdir
)/$(FI
)
197 .PHONY
: all check install install-strip
198 .PHONY
: dvi pdf
info html install-pdf install-info install-html