home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / binutils-1.8.x.tar.gz / binutils-1.8.x.tar / binutils / Makefile < prev    next >
Makefile  |  1991-11-27  |  6KB  |  151 lines

  1. # Makefile for GNU binary-file utilities
  2. # select a set of CFLAGS and PROGS, below, depending on the system type
  3. # Copyright (C) 1989, Free Software Foundation, Inc.
  4. #
  5. # This file is part of the GNU binutils.
  6. # The GNU binutils are free software; you can redistribute them and/or modify
  7. # them under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 1, or (at your option)
  9. # any later version.
  10. # The GNU binutils are distributed in the hope that they will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with the GNU binutils; see the file COPYING.  If not, write to
  16. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.  
  19. GNUCC = gcc -O
  20. #CC = gcc -O
  21. bindir=/usr/local/bin
  22.  
  23. # for BSD systems
  24. #CFLAGS = -g
  25. # Don't add robotussin; it won't compile on BSD or GNU systems.
  26. # objdump is not here because it (at least used to) not compile
  27. # on most systems (trouble with N_DATADDR).  I've fixed some of
  28. # those problems, though.
  29. PROGS = $(archpfx)gprof $(archpfx)ld $(archpfx)size \
  30.         $(archpfx)nm $(archpfx)strip $(archpfx)ar $(archpfx)ranlib
  31.  
  32. # for USG systems using COFF_ENCAPSULATE
  33. # also, you will want to make the target libc.a (but it takes a long time)
  34. # Note that you should leave a copy of `ar' in this directory
  35. # after you install it, since `ranlib' will try to run it from here.
  36. CFLAGS = -DWYSE -DUSG -DCOFF_ENCAPSULATE -DPORTAR -DNON_NATIVE -DPIGNAL_MISSING
  37. PROGS = ld size nm strip ar robotussin objdump ranlib gprof
  38. SIGNAME = signame.o
  39. # On ALTOS systems, add -DALTOS to CFLAGS.
  40.  
  41. #it's better to move a copy of alloca into your libc than to risk getting some
  42. #incompatiable functions from -lPW (like index()), but if you
  43. #want to be lazy, uncomment this line
  44. ALLOCALIBS = -lPW
  45.  
  46. # For HP-UX systems
  47. # Don't add robotussin; use hpxt instead.
  48. # Note that you should leave a copy of `ar' in this directory
  49. # after you install it, since `ranlib' will try to run it from here.
  50. #CFLAGS = -g -Ihp-include -DUSG -DNON_NATIVE
  51. #PROGS = ld size nm strip ar ranlib
  52. #ALLOCALIBS = alloca.o
  53.  
  54. # For the NeXT:
  55. # Set GNUCC = cc
  56. # Add -DHAVE_VPRINTF -DMACH_O to CFLAGS.
  57. # Comment out MALLOC below to use the system's malloc().
  58.  
  59. # Sun386:
  60. # After applying these diffs, compile with -DPORTAR -DCOFF_ENCAPSULATE
  61. # Depending on how you configure gcc, you might also want -Dnounderscore,
  62. # though I did not wind up using it.
  63.  
  64. # If you run out of stack space while running GNU ar or GNU ld (this
  65. # manifests itself as a segment violation), you should link in alloca.c
  66. # from the gcc sources, and get rid of the "#define alloca" in ar.c and
  67. # ld.c; or you could try to get Sun to fix this annoying "feature".
  68. #CFLAGS = -g -DCOFF_ENCAPSULATE -DPORTAR
  69. #PROGS = ld size nm strip ar robotussin objdump ranlib gprof
  70.  
  71. # nm tries to malloc enough space for the string table.  The old GNU malloc
  72. # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might 
  73. # fail unnecessarily.  I've also seen some unix malloc's fail, even when
  74. # there is enough memory.  So use the new GNU malloc.
  75. #MALLOC = $(archpfx)gmalloc.o
  76.  
  77. GNU_GETOPT = $(archpfx)getopt.o
  78. GNU_GETOPT_LONG = $(archpfx)getopt.o $(archpfx)getopt1.o
  79.  
  80. # C++ demangler
  81. CPLUS_DEM = $(archpfx)cplus-dem.o
  82.  
  83. LIBS=$(MALLOC) $(ALLOCALIBS) $(SIGNAME)
  84.  
  85. all: $(PROGS)
  86.  
  87. $(archpfx)ld: $(archpfx)ld.o $(GNU_GETOPT_LONG) $(CPLUS_DEM)
  88. # LIBS is used here since ld needs to use alloca.
  89. # Alternatively, compile it with GNU C--then the compiler handles alloca.
  90.     $(CC) $(CFLAGS) -o $(archpfx)ld $(archpfx)ld.o $(GNU_GETOPT_LONG) $(CPLUS_DEM) $(LIBS)
  91.  
  92. $(archpfx)size: $(archpfx)size.o
  93.     $(CC) $(CFLAGS) -o $(archpfx)size $(archpfx)size.o
  94.  
  95. $(archpfx)nm: $(archpfx)nm.o $(GNU_GETOPT_LONG) $(CPLUS_DEM) $(MALLOC)
  96.     $(CC) $(CFLAGS) -o $(archpfx)nm $(archpfx)nm.o \
  97.         $(GNU_GETOPT_LONG) $(CPLUS_DEM) $(LIBS) $(MALLOC)
  98.  
  99. $(archpfx)strip: $(archpfx)strip.o $(GNU_GETOPT_LONG)
  100.     $(CC) $(CFLAGS) -o $(archpfx)strip $(archpfx)strip.o $(GNU_GETOPT_LONG) $(LIBS)
  101.  
  102. $(archpfx)ar: $(archpfx)ar.o
  103.     $(CC) $(CFLAGS) -o $(archpfx)ar $(archpfx)ar.o $(LIBS)
  104.  
  105. $(archpfx)gprof: $(archpfx)gprof.o $(GNU_GETOPT_LONG) $(CPLUS_DEM)
  106.     $(GNUCC) $(CFLAGS) -o $(archpfx)gprof $(archpfx)gprof.o \
  107.         $(GNU_GETOPT_LONG) $(CPLUS_DEM) $(LIBS)
  108. $(archpfx)gprof.o: gprof.c gmon.h 
  109.     $(GNUCC) $(CFLAGS) -c gprof.c $(OUTPUT_OPTION)
  110.  
  111. $(archpfx)ranlib: $(archpfx)ranlib.o $(GNU_GETOPT_LONG)
  112.     $(CC) $(CFLAGS) -o $(archpfx)ranlib $(archpfx)ranlib.o $(GNU_GETOPT_LONG) $(LIBS)
  113. $(archpfx)ranlib.o: ranlib.c
  114.     $(CC) -c $(CFLAGS) -DAR_PROG=\"/usr/local/gnu/binutils/ar\" ranlib.c $(OUTPUT_OPTION)
  115.  
  116. $(archpfx)objdump: $(archpfx)objdump.o $(GNU_GETOPT_LONG) a.out.gnu.h
  117.     $(CC) $(CFLAGS) -o $(archpfx)objdump $(archpfx)objdump.o \
  118.         $(GNU_GETOPT_LONG) $(LIBS)
  119.  
  120. # Robotussin is NOT part of `all'.
  121. $(archpfx)robotussin: $(archpfx)robotussin.o
  122.     $(CC) $(CFLAGS) -o $(archpfx)robotussin $(archpfx)robotussin.o
  123.  
  124. libc.a: $(archpfx)robotussin libconvert $(archpfx)ar
  125.     libconvert /lib/libc.a libc.a
  126.  
  127. # usg-gnulib is the file gcc makes using the usg compiler
  128. gnulib: $(archpfx)robotussin libconvert usg-gnulib $(archpfx)ar
  129.     libconvert usg-gnulib gnulib
  130.  
  131. clean:
  132.     -rm -f *.o core
  133.     -rm -f $(archpfx)*.o
  134.     -rm -f $(PROGS)
  135.  
  136. dist: binutils.tar.Z
  137.  
  138. # Requires GNU tar.
  139. binutils.tar.Z:
  140.     cd ..; tar -cohz -f binutils/binutils.tar.Z -T binutils/ARCHLIST
  141.  
  142. .PHONY: install
  143. install: $(PROGS)
  144.     for file in $(PROGS); do \
  145.     cp $$file $(bindir)/$${file}.new; \
  146.     mv $(bindir)/$${file}.new $(bindir)/$$file; \
  147.     done
  148.