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@
34 LD_PICFLAG
= @LD_PICFLAG@
35 INCLUDES
= -I.
-I
$(srcdir) -I..
/include -I
$(srcdir)/..
/include
36 FIXINC_CFLAGS
= -DHAVE_CONFIG_H
$(INCLUDES
)
38 # Directory where sources are, from where we are.
42 # Directory in which to put the directories used by the compiler.
44 # Directory in which GCC puts its executables.
45 libexecdir
= @libexecdir@
47 # End of variables for you to override.
49 # The target that we're configured for.
51 target_noncanonical
:=@target_noncanonical@
53 # The version of GCC in this tree
54 gcc_version
:= $(shell @get_gcc_base_ver@
$(srcdir)/..
/gcc
/BASE-VER
)
56 # Directory in which the compiler finds libraries etc.
57 libsubdir
= $(libdir)/gcc
/$(target_noncanonical
)/$(gcc_version
)
58 # Directory in which the compiler finds executables
59 libexecsubdir
= $(libexecdir
)/gcc
/$(target_noncanonical
)/$(gcc_version
)
60 # Where our executable files go
61 itoolsdir
= $(libexecsubdir
)/install-tools
62 # Where our data files go
63 itoolsdatadir
= $(libsubdir
)/install-tools
65 # Locate mkinstalldirs.
66 mkinstalldirs
=$(SHELL
) $(srcdir)/..
/mkinstalldirs
69 AUTOHEADER
= autoheader
71 ACLOCAL_AMFLAGS
= -I ..
-I ..
/config
75 # Now figure out from those variables how to compile and link.
78 $(CC
) -c
$(CFLAGS
) $(PICFLAG
) $(WARN_CFLAGS
) $(CPPFLAGS
) $(FIXINC_CFLAGS
) $<
80 # The only suffixes we want for implicit rules are .c and .o.
86 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
88 ## Makefile for constructing the "best" include fixer we can
90 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
93 LIBIBERTY
=..
/libiberty
/libiberty.a
95 LIBIBERTY
=..
/libiberty
/pic
/libiberty.a
98 ALLOBJ
= fixincl.o fixtests.o fixfixes.o server.o procopen.o \
101 TESTOBJ
= fixincl.o fixlib.o fixtests.o fixopts.o
102 FIXOBJ
= fixfixes.o fixlib.o fixopts.o
104 HDR
= server.h fixlib.h
106 AF
= applyfix@EXEEXT@
108 all : @TARGET@ fixinc.sh mkheaders
109 gen
: $(srcdir)/fixincl.x
112 oneprocess
: full-stamp
113 twoprocess
: test-stamp
$(AF
)
115 full-stamp
: $(ALLOBJ
) $(LIBIBERTY
)
116 $(CC
) $(CFLAGS
) $(PICFLAG
) $(LDFLAGS
) $(LD_PICFLAG
) -o
$(FI
) $(ALLOBJ
) $(LIBIBERTY
)
119 test-stamp
: $(TESTOBJ
) $(LIBIBERTY
)
120 $(CC
) $(CFLAGS
) $(PICFLAG
) $(LDFLAGS
) $(LD_PICFLAG
) -o
$(FI
) $(TESTOBJ
) $(LIBIBERTY
)
123 $(AF
): $(FIXOBJ
) $(LIBIBERTY
)
124 $(CC
) $(CFLAGS
) $(PICFLAG
) $(LDFLAGS
) $(LD_PICFLAG
) -o
$@
$(FIXOBJ
) $(LIBIBERTY
)
127 fixincl.o
: fixincl.c
$(srcdir)/fixincl.x
128 fixtests.o
: fixtests.c
129 fixfixes.o
: fixfixes.c
$(srcdir)/fixincl.x
131 procopen.o
: procopen.c
134 fixinc.sh
: fixinc.in mkfixinc.sh Makefile
135 srcdir="$(srcdir)" $(SHELL
) $(srcdir)/mkfixinc.sh
$(target
)
137 $(srcdir)/fixincl.x
: @MAINT@ fixincl.tpl inclhack.def
138 cd
$(srcdir) ; $(SHELL
) .
/genfixes
141 rm -f
*.o
*-stamp
$(AF
) $(FI
) *~ fixinc.sh
144 rm -f mkheaders mkheaders.almost
147 rm -f Makefile config.h config.log config.status stamp-h
149 maintainer-clean
: distclean
150 rm -f
$(srcdir)/fixincl.x
154 Makefile
: $(srcdir)/Makefile.in config.status
155 $(SHELL
) .
/config.status Makefile
157 mkheaders.almost
: $(srcdir)/mkheaders.in config.status
158 CONFIG_FILES
=mkheaders.almost
:mkheaders.in \
159 CONFIG_HEADERS
= .
/config.status
161 mkheaders
: mkheaders.almost
$(srcdir)/..
/gcc
/BASE-VER
162 sed
-e
's/@gcc_version@/$(gcc_version)/' < $< > $@T
166 stamp-h
: $(srcdir)/config.h.in config.status
167 $(SHELL
) .
/config.status config.h
169 config.status
: $(srcdir)/configure
170 $(SHELL
) .
/config.status
--recheck
172 $(srcdir)/configure
: @MAINT@
$(srcdir)/configure.ac
$(srcdir)/aclocal.m4
173 cd
$(srcdir) && $(AUTOCONF
)
175 $(srcdir)/config.h.in
: @MAINT@
$(srcdir)/configure.ac
176 cd
$(srcdir) && $(AUTOHEADER
)
178 $(srcdir)/aclocal.m4
: @MAINT@
$(srcdir)/configure.ac
179 cd
$(srcdir) && $(ACLOCAL
) $(ACLOCAL_AMFLAGS
)
182 autogen
-T
$(srcdir)/check.tpl
$(srcdir)/inclhack.def
183 $(SHELL
) .
/check.sh
$(srcdir)/tests
/base
187 -rm -rf
$(DESTDIR
)$(itoolsdir
)
188 $(mkinstalldirs
) $(DESTDIR
)$(itoolsdir
)
189 $(mkinstalldirs
) $(DESTDIR
)$(itoolsdatadir
)/include
190 $(INSTALL_DATA
) $(srcdir)/README-fixinc \
191 $(DESTDIR
)$(itoolsdatadir
)/include/README
192 $(INSTALL_SCRIPT
) fixinc.sh
$(DESTDIR
)$(itoolsdir
)/fixinc.sh
193 $(INSTALL_PROGRAM
) $(FI
) $(DESTDIR
)$(itoolsdir
)/$(FI
)
194 $(INSTALL_SCRIPT
) mkheaders
$(DESTDIR
)$(itoolsdir
)/mkheaders
196 install-strip
: install
197 test -z
'$(STRIP)' ||
$(STRIP
) $(DESTDIR
)$(itoolsdir
)/$(FI
)
199 .PHONY
: all check install install-strip
200 .PHONY
: dvi pdf
info html install-pdf install-info install-html