]>
Commit | Line | Data |
---|---|---|
71b5d516 | 1 | # Makefile for fixincludes. |
4839149c | 2 | # |
90d04a44 | 3 | # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2009, 2010, 2012 |
ad643a75 | 4 | # Free Software Foundation, Inc. |
0083c904 | 5 | |
71b5d516 | 6 | #This file is part of fixincludes. |
0083c904 | 7 | |
71b5d516 | 8 | #fixincludes is free software; you can redistribute it and/or modify |
0083c904 | 9 | #it under the terms of the GNU General Public License as published by |
748086b7 | 10 | #the Free Software Foundation; either version 3, or (at your option) |
0083c904 BK |
11 | #any later version. |
12 | ||
71b5d516 | 13 | #fixincludes is distributed in the hope that it will be useful, |
0083c904 BK |
14 | #but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | #GNU General Public License for more details. | |
17 | ||
18 | #You should have received a copy of the GNU General Public License | |
748086b7 JJ |
19 | #along with fixincludes; see the file COPYING3. If not see |
20 | #<http://www.gnu.org/licenses/>. | |
0083c904 | 21 | |
b41e09a7 | 22 | SHELL=@SHELL@ |
d577781c | 23 | |
d9835ae8 MM |
24 | # Some versions of `touch' (such as the version on Solaris 2.8) |
25 | # do not correctly set the timestamp due to buggy versions of `utime' | |
26 | # in the kernel. So, we use `echo' instead. | |
27 | STAMP = echo timestamp > | |
28 | ||
71b5d516 PB |
29 | CC = @CC@ |
30 | CFLAGS = @CFLAGS@ | |
87fbb651 | 31 | WARN_CFLAGS = @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@ |
71b5d516 PB |
32 | LDFLAGS = @LDFLAGS@ |
33 | INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include | |
34 | FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES) | |
0083c904 | 35 | |
0083c904 BK |
36 | # Directory where sources are, from where we are. |
37 | srcdir = @srcdir@ | |
4839149c | 38 | VPATH = $(srcdir) |
0083c904 | 39 | |
53c7ffe7 GK |
40 | # Directory in which to put the directories used by the compiler. |
41 | libdir = @libdir@ | |
42 | # Directory in which GCC puts its executables. | |
43 | libexecdir = @libexecdir@ | |
44 | ||
0083c904 BK |
45 | # End of variables for you to override. |
46 | ||
53c7ffe7 GK |
47 | # The target that we're configured for. |
48 | target = @target@ | |
49 | target_noncanonical:=@target_noncanonical@ | |
50 | ||
51 | # The version of GCC in this tree | |
3c36aa6b | 52 | gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER) |
53c7ffe7 GK |
53 | |
54 | # Directory in which the compiler finds libraries etc. | |
90ee1368 | 55 | libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version) |
53c7ffe7 GK |
56 | # Directory in which the compiler finds executables |
57 | libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version) | |
58 | # Where our executable files go | |
59 | itoolsdir = $(libexecsubdir)/install-tools | |
60 | # Where our data files go | |
61 | itoolsdatadir = $(libsubdir)/install-tools | |
62 | ||
63 | # Locate mkinstalldirs. | |
64 | mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs | |
65 | ||
6efbd53f RW |
66 | AUTOCONF = autoconf |
67 | AUTOHEADER = autoheader | |
68 | ACLOCAL = aclocal | |
678abdd9 | 69 | ACLOCAL_AMFLAGS = -I .. -I ../config |
6efbd53f | 70 | |
35dfe415 | 71 | default : all |
0083c904 BK |
72 | |
73 | # Now figure out from those variables how to compile and link. | |
74 | ||
0083c904 | 75 | .c.o: |
b6cb10af | 76 | $(CC) -c $(CFLAGS) $(PICFLAG) $(WARN_CFLAGS) $(CPPFLAGS) $(FIXINC_CFLAGS) $< |
0083c904 BK |
77 | |
78 | # The only suffixes we want for implicit rules are .c and .o. | |
79 | .SUFFIXES: | |
80 | .SUFFIXES: .c .o | |
81 | ||
82 | #\f | |
83 | ||
84 | ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |
85 | ## | |
86 | ## Makefile for constructing the "best" include fixer we can | |
87 | ## | |
0083c904 BK |
88 | ## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # |
89 | ||
b6cb10af | 90 | ifeq ($(PICFLAG),) |
71b5d516 | 91 | LIBIBERTY=../libiberty/libiberty.a |
b6cb10af MP |
92 | else |
93 | LIBIBERTY=../libiberty/pic/libiberty.a | |
94 | endif | |
2629a114 BK |
95 | |
96 | ALLOBJ = fixincl.o fixtests.o fixfixes.o server.o procopen.o \ | |
ad643a75 | 97 | fixlib.o fixopts.o |
5abc1f74 | 98 | |
ad643a75 PB |
99 | TESTOBJ = fixincl.o fixlib.o fixtests.o fixopts.o |
100 | FIXOBJ = fixfixes.o fixlib.o fixopts.o | |
0083c904 | 101 | |
89b8abbf | 102 | HDR = server.h fixlib.h |
71b5d516 PB |
103 | FI = fixincl@EXEEXT@ |
104 | AF = applyfix@EXEEXT@ | |
0083c904 | 105 | |
53c7ffe7 | 106 | all : @TARGET@ fixinc.sh mkheaders |
42cfed37 | 107 | gen : $(srcdir)/fixincl.x |
0083c904 | 108 | |
71b5d516 | 109 | |
2629a114 BK |
110 | oneprocess : full-stamp |
111 | twoprocess : test-stamp $(AF) | |
112 | ||
71b5d516 | 113 | full-stamp : $(ALLOBJ) $(LIBIBERTY) |
b6cb10af | 114 | $(CC) $(CFLAGS) $(PICFLAG) $(LDFLAGS) $(LD_PICFLAG) -o $(FI) $(ALLOBJ) $(LIBIBERTY) |
d9835ae8 | 115 | $(STAMP) $@ |
2629a114 | 116 | |
71b5d516 | 117 | test-stamp : $(TESTOBJ) $(LIBIBERTY) |
b6cb10af | 118 | $(CC) $(CFLAGS) $(PICFLAG) $(LDFLAGS) $(LD_PICFLAG) -o $(FI) $(TESTOBJ) $(LIBIBERTY) |
d9835ae8 | 119 | $(STAMP) $@ |
2629a114 | 120 | |
71b5d516 | 121 | $(AF): $(FIXOBJ) $(LIBIBERTY) |
b6cb10af | 122 | $(CC) $(CFLAGS) $(PICFLAG) $(LDFLAGS) $(LD_PICFLAG) -o $@ $(FIXOBJ) $(LIBIBERTY) |
0083c904 | 123 | |
2629a114 BK |
124 | $(ALLOBJ) : $(HDR) |
125 | fixincl.o : fixincl.c $(srcdir)/fixincl.x | |
35dfe415 | 126 | fixtests.o : fixtests.c |
2629a114 | 127 | fixfixes.o : fixfixes.c $(srcdir)/fixincl.x |
35dfe415 BK |
128 | server.o : server.c |
129 | procopen.o : procopen.c | |
35dfe415 | 130 | fixlib.o : fixlib.c |
7d7f30cf | 131 | |
53c7ffe7 GK |
132 | fixinc.sh : fixinc.in mkfixinc.sh Makefile |
133 | srcdir="$(srcdir)" $(SHELL) $(srcdir)/mkfixinc.sh $(target) | |
134 | ||
86251d81 | 135 | $(srcdir)/fixincl.x: @MAINT@ fixincl.tpl inclhack.def |
89b8abbf | 136 | cd $(srcdir) ; $(SHELL) ./genfixes |
35dfe415 | 137 | |
ea595d4f GK |
138 | mostlyclean : |
139 | rm -f *.o *-stamp $(AF) $(FI) *~ fixinc.sh | |
e1e0c658 | 140 | |
54f88091 | 141 | clean: mostlyclean |
90ee1368 | 142 | rm -f mkheaders mkheaders.almost |
54f88091 PB |
143 | |
144 | distclean: clean | |
145 | rm -f Makefile config.h config.log config.status stamp-h | |
146 | ||
147 | maintainer-clean: distclean | |
e1e0c658 | 148 | rm -f $(srcdir)/fixincl.x |
0083c904 | 149 | |
ea595d4f GK |
150 | distclean : clean |
151 | ||
71b5d516 PB |
152 | Makefile: $(srcdir)/Makefile.in config.status |
153 | $(SHELL) ./config.status Makefile | |
154 | ||
90ee1368 ZW |
155 | mkheaders.almost: $(srcdir)/mkheaders.in config.status |
156 | CONFIG_FILES=mkheaders.almost:mkheaders.in \ | |
157 | CONFIG_HEADERS= ./config.status | |
158 | ||
159 | mkheaders: mkheaders.almost $(srcdir)/../gcc/BASE-VER | |
160 | sed -e 's/@gcc_version@/$(gcc_version)/' < $< > $@T | |
161 | mv -f $@T $@ | |
53c7ffe7 | 162 | |
71b5d516 PB |
163 | config.h: stamp-h |
164 | stamp-h: $(srcdir)/config.h.in config.status | |
165 | $(SHELL) ./config.status config.h | |
166 | ||
167 | config.status: $(srcdir)/configure | |
168 | $(SHELL) ./config.status --recheck | |
169 | ||
deb984e6 | 170 | $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4 |
6efbd53f | 171 | cd $(srcdir) && $(AUTOCONF) |
71b5d516 PB |
172 | |
173 | $(srcdir)/config.h.in: @MAINT@ $(srcdir)/configure.ac | |
6efbd53f | 174 | cd $(srcdir) && $(AUTOHEADER) |
71b5d516 | 175 | |
deb984e6 | 176 | $(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/configure.ac |
6efbd53f | 177 | cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) |
71b5d516 PB |
178 | |
179 | check : all | |
380c5d40 | 180 | autogen -T $(srcdir)/check.tpl $(srcdir)/inclhack.def |
1b813bfe BK |
181 | $(SHELL) ./check.sh $(srcdir)/tests/base |
182 | @rm -f ./check.sh | |
53c7ffe7 GK |
183 | |
184 | install : all | |
185 | -rm -rf $(DESTDIR)$(itoolsdir) | |
5502f40b | 186 | $(mkinstalldirs) $(DESTDIR)$(itoolsdir) |
53c7ffe7 GK |
187 | $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include |
188 | $(INSTALL_DATA) $(srcdir)/README-fixinc \ | |
189 | $(DESTDIR)$(itoolsdatadir)/include/README | |
190 | $(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh | |
5502f40b | 191 | $(INSTALL_PROGRAM) $(FI) $(DESTDIR)$(itoolsdir)/$(FI) |
53c7ffe7 | 192 | $(INSTALL_SCRIPT) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders |
ea595d4f | 193 | |
455c8f48 | 194 | install-strip: install |
5502f40b | 195 | test -z '$(STRIP)' || $(STRIP) $(DESTDIR)$(itoolsdir)/$(FI) |
455c8f48 RW |
196 | |
197 | .PHONY: all check install install-strip | |
07f1ac6d | 198 | .PHONY: dvi pdf info html install-pdf install-info install-html |
ae022d32 | 199 | |
ea595d4f | 200 | dvi : |
b5422ad7 | 201 | pdf : |
ea595d4f | 202 | info : |
251089a0 | 203 | html : |
b31f8484 | 204 | install-pdf : |
07f1ac6d | 205 | install-info : |
ae022d32 | 206 | install-html : |
ea595d4f | 207 | installcheck : |