1999-03-03 08:41:52 +01:00
|
|
|
|
# Makefile for GNU compilers.
|
2000-12-05 15:54:02 +01:00
|
|
|
|
#
|
2000-02-02 00:51:38 +01:00
|
|
|
|
# Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
|
|
|
|
#This file is part of GNU CC.
|
|
|
|
|
|
|
|
|
|
#GNU CC is free software; you can redistribute it and/or modify
|
|
|
|
|
#it under the terms of the GNU General Public License as published by
|
|
|
|
|
#the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
#any later version.
|
|
|
|
|
|
|
|
|
|
#GNU CC is distributed in the hope that it will be useful,
|
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
#GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
#You should have received a copy of the GNU General Public License
|
|
|
|
|
#along with GNU CC; see the file COPYING. If not, write to
|
|
|
|
|
#the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
|
#Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
|
|
# The makefile built from this file lives in the fixinc subdirectory.
|
|
|
|
|
# Its purpose is to build the any-platforms fixinc.sh script.
|
|
|
|
|
|
2000-12-07 02:32:11 +01:00
|
|
|
|
FL_LIST = $(CFLAGS) $(CPPFLAGS) $(WARN_CFLAGS)
|
2001-03-07 05:00:53 +01:00
|
|
|
|
FIXINC_DEFS = -DIN_GCC -DHAVE_CONFIG_H $(FL_LIST) $(INCLUDES)
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
|
|
|
|
# Directory where sources are, from where we are.
|
|
|
|
|
srcdir = @srcdir@
|
2000-12-05 15:54:02 +01:00
|
|
|
|
VPATH = $(srcdir)
|
1999-08-30 21:27:15 +02:00
|
|
|
|
subdir = fixinc
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
|
|
|
|
# End of variables for you to override.
|
|
|
|
|
|
2000-05-11 15:41:12 +02:00
|
|
|
|
default : all
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
|
|
|
|
# Now figure out from those variables how to compile and link.
|
|
|
|
|
|
|
|
|
|
# Specify the directories to be searched for header files.
|
|
|
|
|
# Both . and srcdir are used, in that order.
|
2000-05-11 15:41:12 +02:00
|
|
|
|
#
|
|
|
|
|
INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. \
|
|
|
|
|
-I$(srcdir)/../config -I$(srcdir)/../../include
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
|
|
|
|
# Always use -I$(srcdir)/config when compiling.
|
|
|
|
|
.c.o:
|
1999-10-12 16:44:18 +02:00
|
|
|
|
$(CC) -c $(FIXINC_DEFS) $<
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
|
|
|
|
# The only suffixes we want for implicit rules are .c and .o.
|
|
|
|
|
.SUFFIXES:
|
|
|
|
|
.SUFFIXES: .c .o
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
|
|
|
##
|
|
|
|
|
## Makefile for constructing the "best" include fixer we can
|
|
|
|
|
##
|
|
|
|
|
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
|
|
|
|
1999-03-03 08:41:52 +01:00
|
|
|
|
LIBERTY = ../../libiberty/libiberty.a
|
2000-12-13 21:07:46 +01:00
|
|
|
|
|
|
|
|
|
ALLOBJ = fixincl.o fixtests.o fixfixes.o server.o procopen.o \
|
2000-05-11 15:41:12 +02:00
|
|
|
|
gnu-regex.o fixlib.o
|
1999-10-12 16:44:18 +02:00
|
|
|
|
|
2000-12-13 21:07:46 +01:00
|
|
|
|
TESTOBJ = fixincl.o fixlib.o fixtests.o gnu-regex.o
|
|
|
|
|
FIXOBJ = fixfixes.o fixlib.o gnu-regex.o
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
2000-12-13 21:07:46 +01:00
|
|
|
|
HDR = server.h gnu-regex.h fixlib.h machname.h
|
|
|
|
|
FI = fixincl@build_exeext@
|
|
|
|
|
AF = applyfix@build_exeext@
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
|
|
|
|
all : $(TARGETS)
|
2000-11-30 17:30:05 +01:00
|
|
|
|
gen : $(srcdir)/fixincl.x
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
2000-12-13 21:07:46 +01:00
|
|
|
|
oneprocess : full-stamp
|
|
|
|
|
twoprocess : test-stamp $(AF)
|
|
|
|
|
|
|
|
|
|
full-stamp : $(ALLOBJ) $(LIBERTY)
|
|
|
|
|
$(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $(FI) $(ALLOBJ) $(LIBERTY)
|
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
|
|
test-stamp : $(TESTOBJ) $(LIBERTY)
|
|
|
|
|
$(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $(FI) $(TESTOBJ) $(LIBERTY)
|
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
|
|
$(AF): $(FIXOBJ) $(LIBERTY)
|
|
|
|
|
$(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $@ $(FIXOBJ) $(LIBERTY)
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
2000-12-13 21:07:46 +01:00
|
|
|
|
$(ALLOBJ) : $(HDR)
|
|
|
|
|
fixincl.o : fixincl.c $(srcdir)/fixincl.x
|
2000-05-11 15:41:12 +02:00
|
|
|
|
fixtests.o : fixtests.c
|
2000-12-13 21:07:46 +01:00
|
|
|
|
fixfixes.o : fixfixes.c $(srcdir)/fixincl.x
|
2000-05-11 15:41:12 +02:00
|
|
|
|
server.o : server.c
|
|
|
|
|
procopen.o : procopen.c
|
|
|
|
|
gnu-regex.o : gnu-regex.c
|
|
|
|
|
fixlib.o : fixlib.c
|
2000-04-26 01:03:49 +02:00
|
|
|
|
|
2000-05-11 15:41:12 +02:00
|
|
|
|
# 'machname.h' is built in the build directory.
|
2000-12-05 15:54:02 +01:00
|
|
|
|
# 'fixincl.x' in the source dir.
|
2000-04-26 01:03:49 +02:00
|
|
|
|
#
|
|
|
|
|
machname.h: ../specs
|
|
|
|
|
$(SHELL) $(srcdir)/genfixes $@
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
2000-11-30 17:30:05 +01:00
|
|
|
|
$(srcdir)/fixincl.x: fixincl.tpl inclhack.def
|
2000-05-11 15:41:12 +02:00
|
|
|
|
cd $(srcdir) ; $(SHELL) ./genfixes $@
|
|
|
|
|
|
1998-10-16 09:00:18 +02:00
|
|
|
|
clean:
|
2000-12-13 21:07:46 +01:00
|
|
|
|
rm -f *.o *-stamp $(AF) $(FI) machname.h *~
|
2000-12-04 19:16:04 +01:00
|
|
|
|
|
|
|
|
|
maintainer-clean : clean
|
|
|
|
|
rm -f $(srcdir)/fixincl.x
|
1998-10-16 09:00:18 +02:00
|
|
|
|
|
2000-05-11 15:41:12 +02:00
|
|
|
|
# Build the executable and copy up into gcc dir.
|
|
|
|
|
# We still copy the script because we still have alternative scripts.
|
1998-10-16 09:00:18 +02:00
|
|
|
|
#
|
2000-12-05 15:54:02 +01:00
|
|
|
|
install-bin : $(TARGETS)
|
2000-12-07 15:42:39 +01:00
|
|
|
|
./fixincl -v
|
2000-04-26 01:03:49 +02:00
|
|
|
|
@if [ -f ../fixinc.sh ] ; then rm -f ../fixinc.sh || \
|
2000-12-27 16:40:02 +01:00
|
|
|
|
mv -f ../fixinc.sh ../fixinc.sh.$$ || exit 1 ; else : ; fi
|
2000-12-13 21:07:46 +01:00
|
|
|
|
@cp $(srcdir)/fixincl.sh ../fixinc.sh
|
2000-04-26 01:03:49 +02:00
|
|
|
|
chmod 755 ../fixinc.sh
|
1999-08-30 21:27:15 +02:00
|
|
|
|
|
|
|
|
|
Makefile: Makefile.in ../config.status
|
|
|
|
|
cd .. \
|
2000-04-26 01:03:49 +02:00
|
|
|
|
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
|
|
|
|
|
$(SHELL) ./config.status
|
2000-05-11 15:41:12 +02:00
|
|
|
|
|
2000-12-07 02:32:11 +01:00
|
|
|
|
check : $(TARGETS)
|
2000-05-11 16:03:04 +02:00
|
|
|
|
autogen -T $(srcdir)/check.tpl $(srcdir)/inclhack.def
|
2000-05-31 17:03:41 +02:00
|
|
|
|
$(SHELL) ./check.sh $(srcdir)/tests/base
|
|
|
|
|
@rm -f ./check.sh
|