1 # Makefile for GCC fixincludes.
3 # Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
5 #This file is part of GCC.
7 #GCC is free software; you can redistribute it and/or modify
8 #it under the terms of the GNU General Public License as published by
9 #the Free Software Foundation; either version 2, or (at your option)
12 #GCC is distributed in the hope that it will be useful,
13 #but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 #GNU General Public License for more details.
17 #You should have received a copy of the GNU General Public License
18 #along with GCC; see the file COPYING. If not, write to
19 #the Free Software Foundation, 59 Temple Place - Suite 330,
20 #Boston, MA 02111-1307, USA.
22 # The makefile built from this file lives in the fixinc subdirectory.
23 # Its purpose is to build the any-platforms fixinc.sh script.
27 # Some versions of `touch' (such as the version on Solaris 2.8)
28 # do not correctly set the timestamp due to buggy versions of `utime'
29 # in the kernel. So, we use `echo' instead.
30 STAMP
= echo timestamp
>
32 FL_LIST
= $(CFLAGS
) $(CPPFLAGS
) $(WARN_CFLAGS
)
33 FIXINC_DEFS
= -DIN_GCC
-DHAVE_CONFIG_H
$(FL_LIST
) $(INCLUDES
)
35 # Directory where sources are, from where we are.
40 # End of variables for you to override.
44 # Now figure out from those variables how to compile and link.
46 # Specify the directories to be searched for header files.
47 # Both . and srcdir are used, in that order.
49 INCLUDES
= -I.
-I..
-I
$(srcdir) -I
$(srcdir)/.. \
50 -I
$(srcdir)/..
/config
-I
$(srcdir)/..
/..
/include
52 # Always use -I$(srcdir)/config when compiling.
54 $(CC
) -c
$(FIXINC_DEFS
) $<
56 # The only suffixes we want for implicit rules are .c and .o.
62 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
64 ## Makefile for constructing the "best" include fixer we can
66 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
68 LIBERTY
= ..
/..
/libiberty
/libiberty.a
70 ALLOBJ
= fixincl.o fixtests.o fixfixes.o server.o procopen.o \
73 TESTOBJ
= fixincl.o fixlib.o fixtests.o gnu-regex.o
74 FIXOBJ
= fixfixes.o fixlib.o gnu-regex.o
76 HDR
= server.h gnu-regex.h fixlib.h machname.h
77 FI
= fixincl@build_exeext@
78 AF
= applyfix@build_exeext@
81 gen
: $(srcdir)/fixincl.x
83 oneprocess
: full-stamp
84 twoprocess
: test-stamp
$(AF
)
86 full-stamp
: $(ALLOBJ
) $(LIBERTY
)
87 $(CC
) $(FIXINC_DEFS
) $(LDFLAGS
) -o
$(FI
) $(ALLOBJ
) $(LIBERTY
)
90 test-stamp
: $(TESTOBJ
) $(LIBERTY
)
91 $(CC
) $(FIXINC_DEFS
) $(LDFLAGS
) -o
$(FI
) $(TESTOBJ
) $(LIBERTY
)
94 $(AF
): $(FIXOBJ
) $(LIBERTY
)
95 $(CC
) $(FIXINC_DEFS
) $(LDFLAGS
) -o
$@
$(FIXOBJ
) $(LIBERTY
)
97 # String length warnings
98 fixincl.o-warn
= -Wno-error
99 # Signed/Unsigned warnings, but in code pulled from upstream.
100 gnu-regex.o-warn
= -Wno-error
103 fixincl.o
: fixincl.c
$(srcdir)/fixincl.x
104 fixtests.o
: fixtests.c
105 fixfixes.o
: fixfixes.c
$(srcdir)/fixincl.x
107 procopen.o
: procopen.c
108 gnu-regex.o
: gnu-regex.c
111 # 'machname.h' is built in the build directory.
112 # 'fixincl.x' in the source dir.
115 $(SHELL
) $(srcdir)/genfixes
$@
117 $(srcdir)/fixincl.x
: @MAINT@ fixincl.tpl inclhack.def
118 cd
$(srcdir) ; $(SHELL
) .
/genfixes
$@
121 rm -f
*.o
*-stamp
$(AF
) $(FI
) machname.h
*~
123 maintainer-clean
: clean
124 rm -f
$(srcdir)/fixincl.x
126 # Build the executable and copy up into gcc dir.
127 # We still copy the script because we still have alternative scripts.
129 install-bin
: $(TARGETS
)
130 .
/fixincl
-v
< /dev
/null
131 @if
[ -f ..
/fixinc.sh
] ; then
rm -f ..
/fixinc.sh || \
132 mv
-f ..
/fixinc.sh ..
/fixinc.sh.
$$ || exit
1 ; else : ; fi
133 @cp
$(srcdir)/fixincl.sh ..
/fixinc.sh
134 chmod
755 ..
/fixinc.sh
136 Makefile
: Makefile.in ..
/config.status
138 && CONFIG_FILES
=$(subdir
)/$@ CONFIG_HEADERS
= \
139 $(SHELL
) .
/config.status
142 autogen
-T
$(srcdir)/check.tpl
$(srcdir)/inclhack.def
143 $(SHELL
) .
/check.sh
$(srcdir)/tests
/base