OSDN Git Service

Remove dependencies on dead files
[pf3gnuchains/gcc-fork.git] / gcc / fixinc / Makefile.in
1 # Makefile for GNU compilers.
2 #   Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
3
4 #This file is part of GNU CC.
5
6 #GNU CC is free software; you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation; either version 2, or (at your option)
9 #any later version.
10
11 #GNU CC is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #GNU General Public License for more details.
15
16 #You should have received a copy of the GNU General Public License
17 #along with GNU CC; see the file COPYING.  If not, write to
18 #the Free Software Foundation, 59 Temple Place - Suite 330,
19 #Boston, MA 02111-1307, USA.
20
21 # The makefile built from this file lives in the fixinc subdirectory.
22 # Its purpose is to build the any-platforms fixinc.sh script.
23
24 CFLAGS = -g
25 FIXINC_DEFS = -DIN_GCC $(CFLAGS) $(CPPFLAGS) $(INCLUDES)
26
27 CC = @CC@
28 SHELL = /bin/sh
29
30 target=@target@
31 # Directory where sources are, from where we are.
32 srcdir = @srcdir@
33 VPATH = @srcdir@
34 subdir = fixinc
35
36 # End of variables for you to override.
37
38 default : gen
39
40 # Now figure out from those variables how to compile and link.
41
42 # Specify the directories to be searched for header files.
43 # Both . and srcdir are used, in that order.
44 INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
45
46 # Always use -I$(srcdir)/config when compiling.
47 .c.o:
48         $(CC) -c $(FIXINC_DEFS) $<
49
50 # The only suffixes we want for implicit rules are .c and .o.
51 .SUFFIXES:
52 .SUFFIXES: .c .o
53
54 #\f
55
56 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
57 ##
58 ##  Makefile for constructing the "best" include fixer we can
59 ##
60 ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
61
62 LIBERTY = ../../libiberty/libiberty.a
63 LIBOBJ  = gnu-regex.o fixlib.o $(LIBERTY)
64 FIOBJ   = fixincl.o server.o procopen.o $(LIBOBJ)
65
66 HDR = server.h gnu-regex.h fixlib.h machname.h
67
68 BIN_TARGET = fixincl fixfixes fixtests
69
70 TARGETS    = $(BIN_TARGET)
71
72 all : $(TARGETS)
73 gen : fixincl.x
74
75 $(FIOBJ): $(HDR)
76
77 fixincl: $(FIOBJ)
78         @echo $(CC) $(FIXINC_DEFS) -o $@ $(FIOBJ) ; \
79         if $(CC) $(FIXINC_DEFS) -o $@ $(FIOBJ) ; then : ; else \
80         rm -f $@ ; (echo "#! /bin/sh" ; echo exit 1 ) > $@ ; \
81         chmod 777 $@ ; fi
82
83 fixfixes: fixfixes.c $(LIBOBJ)
84         $(CC) -o $@ $(FIXINC_DEFS) -DMAIN \
85                 $(srcdir)/fixfixes.c $(LIBOBJ) $(LIB)
86
87 fixtests: fixtests.c $(LIBOBJ)
88         $(CC) -o $@ $(FIXINC_DEFS) -DMAIN \
89                 $(srcdir)/fixtests.c $(LIBOBJ) $(LIB)
90
91 fixincl.o : fixincl.x fixincl.c fixfixes.c fixtests.c
92 server.o : server.c server.h
93 procopen.o : procopen.c server.h
94 fixlib.o: machname.h
95
96 fixincl.x: fixincl.tpl inclhack.def
97         cd $(srcdir) ; $(SHELL) ./genfixes $@
98
99 ## inclhack.sh: inclhack.def inclhack.tpl hackshell.tpl
100 ##      cd $(srcdir) ; $(SHELL) ./genfixes $@
101 ## 
102 ## # fixinc.sh, unlike the other two, has _no_ dependency on the .def file.
103 ## fixincl.sh: inclhack.tpl
104 ##      cd $(srcdir) ; $(SHELL) ./genfixes $@
105
106 #  This invocation of genfixes is done from the build dir,
107 #  not the source dir (as above)
108 #
109 machname.h: ../specs
110         $(SHELL) $(srcdir)/genfixes $@
111
112 clean:
113         rm -f *.o $(TARGETS) fixincl.x machname.h
114
115 #  Ensure all the targets are built.  If the program "fixincl"
116 #  failed to compile, link or load, then we install the
117 #  "inclhack.sh" script.  Otherwise, we install that program
118 #  plus the wrapper script, "fixincl.sh".
119 #
120 install-bin: fixincl fixincl.sh
121         @if [ -f ../fixincl ] ; then rm -f ../fixincl || \
122             mv -f ../fixincl ../fixincl.$$ || exit 1 ; fi
123         @if [ -f ../fixinc.sh ] ; then rm -f ../fixinc.sh || \
124             mv -f ../fixinc.sh ../fixinc.sh.$$ || exit 1 ; fi
125         ./fixincl -v
126         cp fixincl ..
127         cp $(srcdir)/fixincl.sh ../fixinc.sh
128         chmod 755 ../fixinc.sh ../fixincl
129
130 install-sh: fixfixes fixtests inclhack.sh
131         @if [ -f ../fixinc.sh ] ; then rm -f ../fixinc.sh || \
132             mv -f ../fixinc.sh ../fixinc.sh.$$ || exit 1 ; fi
133         echo Could not install binary fixincludes.  ; \
134         echo Installing shell script instead.
135         @if [ -f ./inclhack.sh ] ; \
136         then echo cp ./inclhack.sh ../fixinc.sh ; \
137                 cp ./inclhack.sh ../fixinc.sh ; \
138         else echo cp $(srcdir)/inclhack.sh ../fixinc.sh ; \
139                 cp $(srcdir)/inclhack.sh ../fixinc.sh ; fi
140         chmod 755 ../fixinc.sh
141
142 Makefile: Makefile.in ../config.status
143         cd .. \
144           && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
145           $(SHELL) ./config.status