1 # Makefile for GNU compilers.
3 # Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
5 #This file is part of GNU CC.
7 #GNU CC 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 #GNU CC 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 GNU CC; 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 FL_LIST
= $(CFLAGS
) $(CPPFLAGS
) $(WARN_CFLAGS
)
28 FIXINC_DEFS
= -DIN_GCC
-DHAVE_CONFIG_H
$(FL_LIST
) $(INCLUDES
)
30 # Directory where sources are, from where we are.
35 # End of variables for you to override.
39 # Now figure out from those variables how to compile and link.
41 # Specify the directories to be searched for header files.
42 # Both . and srcdir are used, in that order.
44 INCLUDES
= -I.
-I..
-I
$(srcdir) -I
$(srcdir)/.. \
45 -I
$(srcdir)/..
/config
-I
$(srcdir)/..
/..
/include
47 # Always use -I$(srcdir)/config when compiling.
49 $(CC
) -c
$(FIXINC_DEFS
) $<
51 # The only suffixes we want for implicit rules are .c and .o.
57 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
59 ## Makefile for constructing the "best" include fixer we can
61 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
63 LIBERTY
= ..
/..
/libiberty
/libiberty.a
65 ALLOBJ
= fixincl.o fixtests.o fixfixes.o server.o procopen.o \
68 TESTOBJ
= fixincl.o fixlib.o fixtests.o gnu-regex.o
69 FIXOBJ
= fixfixes.o fixlib.o gnu-regex.o
71 HDR
= server.h gnu-regex.h fixlib.h machname.h
72 FI
= fixincl@build_exeext@
73 AF
= applyfix@build_exeext@
76 gen
: $(srcdir)/fixincl.x
78 oneprocess
: full-stamp
79 twoprocess
: test-stamp
$(AF
)
81 full-stamp
: $(ALLOBJ
) $(LIBERTY
)
82 $(CC
) $(FIXINC_DEFS
) $(LDFLAGS
) -o
$(FI
) $(ALLOBJ
) $(LIBERTY
)
85 test-stamp
: $(TESTOBJ
) $(LIBERTY
)
86 $(CC
) $(FIXINC_DEFS
) $(LDFLAGS
) -o
$(FI
) $(TESTOBJ
) $(LIBERTY
)
89 $(AF
): $(FIXOBJ
) $(LIBERTY
)
90 $(CC
) $(FIXINC_DEFS
) $(LDFLAGS
) -o
$@
$(FIXOBJ
) $(LIBERTY
)
93 fixincl.o
: fixincl.c
$(srcdir)/fixincl.x
94 fixtests.o
: fixtests.c
95 fixfixes.o
: fixfixes.c
$(srcdir)/fixincl.x
97 procopen.o
: procopen.c
98 gnu-regex.o
: gnu-regex.c
101 # 'machname.h' is built in the build directory.
102 # 'fixincl.x' in the source dir.
105 $(SHELL
) $(srcdir)/genfixes
$@
107 $(srcdir)/fixincl.x
: fixincl.tpl inclhack.def
108 cd
$(srcdir) ; $(SHELL
) .
/genfixes
$@
111 rm -f
*.o
*-stamp
$(AF
) $(FI
) machname.h
*~
113 maintainer-clean
: clean
114 rm -f
$(srcdir)/fixincl.x
116 # Build the executable and copy up into gcc dir.
117 # We still copy the script because we still have alternative scripts.
119 install-bin
: $(TARGETS
)
121 @if
[ -f ..
/fixinc.sh
] ; then
rm -f ..
/fixinc.sh || \
122 mv
-f ..
/fixinc.sh ..
/fixinc.sh.
$$ || exit
1 ; else : ; fi
123 @cp
$(srcdir)/fixincl.sh ..
/fixinc.sh
124 chmod
755 ..
/fixinc.sh
126 Makefile
: Makefile.in ..
/config.status
128 && CONFIG_FILES
=$(subdir
)/$@ CONFIG_HEADERS
= \
129 $(SHELL
) .
/config.status
132 autogen
-T
$(srcdir)/check.tpl
$(srcdir)/inclhack.def
133 $(SHELL
) .
/check.sh
$(srcdir)/tests
/base