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.
25 FL_LIST
= $(CFLAGS
) $(CPPFLAGS
) $(WARN_CFLAGS
)
26 FIXINC_DEFS
= -DIN_GCC
$(FL_LIST
) $(INCLUDES
)
28 # Directory where sources are, from where we are.
33 # End of variables for you to override.
37 # Now figure out from those variables how to compile and link.
39 # Specify the directories to be searched for header files.
40 # Both . and srcdir are used, in that order.
42 INCLUDES
= -I.
-I..
-I
$(srcdir) -I
$(srcdir)/.. \
43 -I
$(srcdir)/..
/config
-I
$(srcdir)/..
/..
/include
45 # Always use -I$(srcdir)/config when compiling.
47 $(CC
) -c
$(FIXINC_DEFS
) $<
49 # The only suffixes we want for implicit rules are .c and .o.
55 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
57 ## Makefile for constructing the "best" include fixer we can
59 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
61 LIBERTY
= ..
/..
/libiberty
/libiberty.a
63 ALLOBJ
= fixincl.o fixtests.o fixfixes.o server.o procopen.o \
66 TESTOBJ
= fixincl.o fixlib.o fixtests.o gnu-regex.o
67 FIXOBJ
= fixfixes.o fixlib.o gnu-regex.o
69 HDR
= server.h gnu-regex.h fixlib.h machname.h
70 FI
= fixincl@build_exeext@
71 AF
= applyfix@build_exeext@
74 gen
: $(srcdir)/fixincl.x
76 oneprocess
: full-stamp
77 twoprocess
: test-stamp
$(AF
)
79 full-stamp
: $(ALLOBJ
) $(LIBERTY
)
80 $(CC
) $(FIXINC_DEFS
) $(LDFLAGS
) -o
$(FI
) $(ALLOBJ
) $(LIBERTY
)
83 test-stamp
: $(TESTOBJ
) $(LIBERTY
)
84 $(CC
) $(FIXINC_DEFS
) $(LDFLAGS
) -o
$(FI
) $(TESTOBJ
) $(LIBERTY
)
87 $(AF
): $(FIXOBJ
) $(LIBERTY
)
88 $(CC
) $(FIXINC_DEFS
) $(LDFLAGS
) -o
$@
$(FIXOBJ
) $(LIBERTY
)
91 fixincl.o
: fixincl.c
$(srcdir)/fixincl.x
92 fixtests.o
: fixtests.c
93 fixfixes.o
: fixfixes.c
$(srcdir)/fixincl.x
95 procopen.o
: procopen.c
96 gnu-regex.o
: gnu-regex.c
99 # 'machname.h' is built in the build directory.
100 # 'fixincl.x' in the source dir.
103 $(SHELL
) $(srcdir)/genfixes
$@
105 $(srcdir)/fixincl.x
: fixincl.tpl inclhack.def
106 cd
$(srcdir) ; $(SHELL
) .
/genfixes
$@
109 rm -f
*.o
*-stamp
$(AF
) $(FI
) machname.h
*~
111 maintainer-clean
: clean
112 rm -f
$(srcdir)/fixincl.x
114 # Build the executable and copy up into gcc dir.
115 # We still copy the script because we still have alternative scripts.
117 install-bin
: $(TARGETS
)
119 @if
[ -f ..
/fixinc.sh
] ; then
rm -f ..
/fixinc.sh || \
120 mv
-f ..
/fixinc.sh ..
/fixinc.sh.
$$ || exit
1 ; else : ; fi
121 @cp
$(srcdir)/fixincl.sh ..
/fixinc.sh
122 chmod
755 ..
/fixinc.sh
124 Makefile
: Makefile.in ..
/config.status
126 && CONFIG_FILES
=$(subdir
)/$@ CONFIG_HEADERS
= \
127 $(SHELL
) .
/config.status
130 autogen
-T
$(srcdir)/check.tpl
$(srcdir)/inclhack.def
131 $(SHELL
) .
/check.sh
$(srcdir)/tests
/base