1 # Makefile for fixincludes.
3 # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004
4 # Free Software Foundation, Inc.
6 #This file is part of fixincludes.
8 #fixincludes is free software; you can redistribute it and/or modify
9 #it under the terms of the GNU General Public License as published by
10 #the Free Software Foundation; either version 2, or (at your option)
13 #fixincludes is distributed in the hope that it will be useful,
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.
18 #You should have received a copy of the GNU General Public License
19 #along with fixincludes; see the file COPYING. If not, write to
20 #the Free Software Foundation, 59 Temple Place - Suite 330,
21 #Boston, MA 02111-1307, USA.
25 # Some versions of `touch' (such as the version on Solaris 2.8)
26 # do not correctly set the timestamp due to buggy versions of `utime'
27 # in the kernel. So, we use `echo' instead.
28 STAMP = echo timestamp >
33 INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include
34 FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES)
36 # Directory where sources are, from where we are.
40 # End of variables for you to override.
44 # Now figure out from those variables how to compile and link.
47 $(CC) -c $(CFLAGS) $(CPPFLAGS) $(FIXINC_CFLAGS) $<
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 LIBIBERTY=../libiberty/libiberty.a
63 ALLOBJ = fixincl.o fixtests.o fixfixes.o server.o procopen.o \
66 TESTOBJ = fixincl.o fixlib.o fixtests.o fixopts.o
67 FIXOBJ = fixfixes.o fixlib.o fixopts.o
69 HDR = server.h fixlib.h
74 gen : $(srcdir)/fixincl.x
77 oneprocess : full-stamp
78 twoprocess : test-stamp $(AF)
80 full-stamp : $(ALLOBJ) $(LIBIBERTY)
81 $(CC) $(LDFLAGS) -o $(FI) $(ALLOBJ) $(LIBIBERTY)
84 test-stamp : $(TESTOBJ) $(LIBIBERTY)
85 $(CC) $(LDFLAGS) -o $(FI) $(TESTOBJ) $(LIBIBERTY)
88 $(AF): $(FIXOBJ) $(LIBIBERTY)
89 $(CC) $(LDFLAGS) -o $@ $(FIXOBJ) $(LIBIBERTY)
92 fixincl.o : fixincl.c $(srcdir)/fixincl.x
93 fixtests.o : fixtests.c
94 fixfixes.o : fixfixes.c $(srcdir)/fixincl.x
96 procopen.o : procopen.c
99 $(srcdir)/fixincl.x: @MAINT@ fixincl.tpl inclhack.def
100 cd $(srcdir) ; $(SHELL) ./genfixes
103 rm -f *.o *-stamp $(AF) $(FI) *~
105 maintainer-clean : clean
106 rm -f $(srcdir)/fixincl.x
108 Makefile: $(srcdir)/Makefile.in config.status
109 $(SHELL) ./config.status Makefile
112 stamp-h: $(srcdir)/config.h.in config.status
113 $(SHELL) ./config.status config.h
115 config.status: $(srcdir)/configure
116 $(SHELL) ./config.status --recheck
118 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac
121 $(srcdir)/config.h.in: @MAINT@ $(srcdir)/configure.ac
124 $(srcdir)/aclocal.m4: @MAINT@ $(srcdir)/../gcc/aclocal.m4
125 cp $(srcdir)/../gcc/aclocal.m4 .
128 autogen -T $(srcdir)/check.tpl $(srcdir)/inclhack.def
129 $(SHELL) ./check.sh $(srcdir)/tests/base