1 # Makefile for GNU binary-file utilities
2 # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
4 # This file is part of GNU binutils.
6 # This program 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 of the License, or
9 # (at your option) any later version.
11 # This program 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.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 program_transform_name
=
25 exec_prefix = $(prefix)
26 bindir = $(exec_prefix)/bin
27 libdir = $(exec_prefix)/lib
28 tooldir
= $(exec_prefix)/$(target_alias
)
30 datadir = $(prefix)/lib
31 mandir = $(prefix)/man
32 man1dir = $(mandir)/man1
33 man2dir = $(mandir)/man2
34 man3dir = $(mandir)/man3
35 man4dir = $(mandir)/man4
36 man5dir = $(mandir)/man5
37 man6dir = $(mandir)/man6
38 man7dir = $(mandir)/man7
39 man8dir = $(mandir)/man8
40 man9dir = $(mandir)/man9
41 infodir = $(prefix)/info
42 includedir = $(prefix)/include
43 docdir
= $(datadir)/doc
47 INSTALL
= `cd $(srcdir)/..;pwd`/install.sh
-c
48 INSTALL_PROGRAM
= $(INSTALL
)
49 INSTALL_DATA
= $(INSTALL
)
50 INSTALL_XFORM
= $(INSTALL
) -t
='$(program_transform_name)'
51 INSTALL_XFORM1
= $(INSTALL_XFORM
) -b
=.1
67 # Comment these out if using lex.
68 # Distribution version
72 # Where to find texinfo.tex to format docn with TeX
73 TEXIDIR
= $(srcdir)/..
/texinfo
78 # These should all be the same program too.
86 DISTSTUFF
= $(PROGS
) $(LIBS
)
88 BASEDIR
= $(srcdir)/..
/..
89 BFDDIR
= $(BASEDIR
)/bfd
90 INCDIR
= $(BASEDIR
)/include
91 GDBDIR
= $(BASEDIR
)/gdb
92 INCLUDES
= -I.
-I
$(srcdir) -I..
/..
/bfd
-I
$(BFDDIR
) -I
$(INCDIR
) -I
$(GDBDIR
)
94 #### host and target dependant Makefile fragments come in here.
97 ALL_CFLAGS
= $(INCLUDES
) $(HDEFINES
) $(TDEFINES
) $(CFLAGS
)
100 $(CC
) -c
$(ALL_CFLAGS
) $<
103 ## Random definitions
104 # Hopefully all these may be flushed once we get configuration down pat.
106 # alloca only needed for systems which don't have it and when cc != gcc.
109 # nm tries to malloc enough space for the string table. The old GNU malloc
110 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
111 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
112 # there is enough memory. So use the new GNU malloc.
114 # Use this if the system malloc is good enough.
117 # Use the GNU getopt unless you have problems with it.
118 # The IRIS version could probably benefit from being assembled with
119 # libmalloc rather than the ordinary malloc.
120 LIBIBERTY
= ..
/..
/libiberty
/libiberty.a
122 BFD
= ..
/..
/bfd
/libbfd.a
123 OPCODES
= ..
/..
/opcodes
/libopcodes.a
130 "RUNTEST=$(RUNTEST)" \
131 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
136 all: $(LIBS
) $(PROGS
)
139 $(RUN_PROG
): $(LIBS
) run.o
$(BFD
)
140 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$(RUN_PROG
) run.o
$(SIM_LIB
) $(BFD
) $(LIBIBERTY
)
142 $(SIM_LIB
): case.o interp.o
144 $(AR
) $(AR_FLAGS
) $(SIM_LIB
) case.o interp.o
148 .
/gencode
-c
>case.c
; \
149 if
[ -x
/usr
/latest
/bin
/indent
] ; then \
150 /usr
/latest
/bin
/indent case.c
; \
155 .
/gencode
-a
>$(srcdir)/..
/..
/opcodes
/w65-opc.h
165 ######################################################################
168 -rm -f
*.o
*~ \
#* core binutils.?? binutils.??? case.c
171 -rm -f
$(PROGS
) *.o
*.a
174 -rm -f Makefile config.status sysdep.h
*.o
*~ \
#* core y.* \
175 binutils.?? binutils.??s binutils.aux binutils.log binutils.toc gencode run
176 -rm -f
$(PROGS
) underscore.c
178 realclean: clean distclean
179 -rm -f
$(DISTSTUFF
) TAGS
184 etags
$(INCDIR
)/*.h
$(srcdir)/*.
[hc
]
187 for i in
$(PROGS
) ; do \
188 $(INSTALL_XFORM
) $$i $(bindir)/`echo $$i | sed -e 's/.new//'` ; \
197 # cvs rtag binutils-x-yy ld+utils
198 # cvs co -r binutils-x-yy ld+utils
200 # cd {HERE}; make dist [-f Makefile.in]
202 dist: $(DIST_NAME
).
tar.z
204 diststuff
: $(DISTSTUFF
)
207 cd ..
/..
; rm -f
$(DIST_NAME
); ln
-s devo
$(DIST_NAME
)
208 make diststuff
-f Makefile.in
209 cd ..
/ld; make diststuff
-f Makefile.in
210 cd ..
/gprof
; make diststuff
-f Makefile.in
211 cd ..
/texinfo
; mv texinfo.
tex ..
; rm -rf
*; mv ..
/texinfo.
tex .
212 # Take out texinfo from configurable dirs
213 mv ..
/configure.in tmp
; \
214 sed
-e
'/^host_tools=/s/texinfo //' <tmp
>..
/configure.in
; rm tmp
215 cd ..
; chmod og
=u
`find . -print`
216 cd ..
/..
; tar chf
- $(DIST_NAME
) | gzip
>$(DIST_NAME
).
tar.z
217 rm -rf ..
/..
/$(DIST_NAME
)
220 # Dummy target to force execution of dependent targets.
224 # Target to uncomment host-specific lines in this makefile. Such lines must
225 # have the following string beginning in column 1: #__<hostname>__#
226 # Original Makefile is backed up as 'Makefile.old'.
228 # Invoke with: make make HOST=xxx
231 -@if
test $(HOST
)x
= x
; then \
232 echo
'\aSpecify "make make HOST=???"'; \
235 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
236 if
test $$?
= 0 ; then \
237 echo
"\aMakefile has already been processed with 'make make'";\
240 mv
-f Makefile Makefile.old
; \
241 echo
"#The next line was generated by 'make make'" >Makefile
; \
242 echo
"HOST=$(HOST)" >>Makefile
; \
244 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
246 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
247 $(SHELL
) .
/config.status
249 ### Local Variables: ***
250 ### mode:fundamental ***
251 ### page-delimiter: "^#\f" ***