1 ### Makefile for GNU binary-file utilities
7 ## Configuration options
8 # These should be all you need set before compiling
11 # these two should be the same program
15 # copy and strip should be the same program
19 # These should all be the same program too.
24 PROGS
= $(SIZE_PROG
) $(COPY_PROG
) $(OBJDUMP_PROG
) $(NM_PROG
) $(AR_PROG
) $(STRIP_PROG
) $(RANLIB_PROG
)
28 BASEDIR
= $(srcdir)/..
29 # Let rich do this for now:
30 LIBDIR
= $(srcdir)/..
/bfd
32 #__dgux__#DEFINES=-DHOST_SYS=DGUX_SYS
34 #__sun3__#DEFINES=-DHOST_SYS=SUN3_SYS
35 #__sun3__#LDFLAGS= -Bstatic
37 #__sun4__#DEFINES=-DHOST_SYS=SUN4_SYS
38 #__sun4__#LDFLAGS= -Bstatic
40 #__sun386i__#LDFLAGS = -Bstatic
42 #__rs6000__#DEFINES=-Daix
43 #__rs6000__#ALLOCA = alloca.o
45 #__i386v__#ALLOCA = alloca.o
46 #__i386v__#DEFINES=-DUSG
49 #### host and target dependant Makefile fragments come in here.
52 INCDIR
= $(BASEDIR
)/include-cygnus
54 CFLAGS
= -g
-I
$(INCDIR
) $(DEFINES
) $(CDEFINES
)
59 DISASMS
= m68k-pinsn.o i960-pinsn.o sparc-pinsn.o
62 # Hopefully all these may be flushed once we get configuration down pat.
64 # alloca only needed for systems which don't have it and when cc != gcc.
67 # nm tries to malloc enough space for the string table. The old GNU malloc
68 # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might
69 # fail unnecessarily. I've also seen some Unix malloc's fail, even when
70 # there is enough memory. So use the new GNU malloc.
73 # Use the GNU getopt unless you have problems with it.
74 # The IRIS version could probably benefit from being assembled with
75 # libmalloc rather than the ordinary malloc.
76 GNU_GETOPT
= getopt.o
$(ALLOCA
)
77 GNU_GETOPT_LONG
= getopt1.o
$(GNU_GETOPT
)
82 # Code shared by all the binutils.
83 BULIBS
= bucomm.o version.o filemode.o
85 ADDL_LIBS
= $(GNU_GETOPT_LONG
) $(MALLOC
) $(BULIBS
)
87 BFD
= $(LIBDIR
)/libbfd.a
91 all: $(ADDL_LIBS
) $(PROGS
)
94 #$(BFD):$(LIBDIR)/../common/*.c
95 # (cd $(LIBDIR); make)
97 $(SIZE_PROG
): $(ADDL_LIBS
) size.o
$(BFD
)
98 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(SIZE_PROG
) size.o
$(ADDL_LIBS
) $(BFD
)
100 $(COPY_PROG
): $(ADDL_LIBS
) copy.o
$(BFD
)
101 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(COPY_PROG
) copy.o
$(ADDL_LIBS
) $(BFD
)
103 $(NM_PROG
): $(ADDL_LIBS
) nm.o
$(BFD
)
104 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(NM_PROG
) nm.o
$(MALLOC
) $(ADDL_LIBS
) $(BFD
)
106 $(OBJDUMP_PROG
): $(ADDL_LIBS
) size.o objdump.o
$(DISASMS
) $(BFD
)
107 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(OBJDUMP_PROG
) objdump.o
$(DISASMS
) $(ADDL_LIBS
) $(BFD
)
109 $(AR_PROG
): $(ADDL_LIBS
) ar.o
$(BFD
)
110 $(CC
) $(LDFLAGS
) $(CFLAGS
) -o
$(AR_PROG
) ar.o
$(MALLOC
) $(ADDL_LIBS
) $(BFD
)
112 $(RANLIB_PROG
): $(AR_PROG
)
113 -rm -f
$(RANLIB_PROG
)
114 -ln
$(AR_PROG
) $(RANLIB_PROG
)
116 $(STRIP_PROG
): $(COPY_PROG
)
118 -ln
$(COPY_PROG
) $(STRIP_PROG
)
121 -rm -f
*.o
*~ \
#* core $(PROGS) TAGS
126 etags
$(INCDIR
)/*.h
$(BFDSRC
)/*.
[hc
] *.
[hc
]
132 for prog in
$(PROGS
); do \
133 rm -f
$G960BASE/bin
/$$prog-new
; cp
$$prog $$G960BASE/bin
/$$prog-new
; \
142 m68k-pinsn.o
: m68k-pinsn.c
143 m68k-pinsn.o
: .
/m68k-opcode.h
144 i960-pinsn.o
: i960-pinsn.c
145 sparc-pinsn.o
: sparc-pinsn.c
146 sparc-pinsn.o
: .
/sparc-opcode.h
151 filemode.o
:filemode.c
152 #-----------------------------------------------------------------------------
153 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
155 # 'VERSION' file must be present and contain a string of the form "x.y"
156 #-----------------------------------------------------------------------------
160 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
163 # Dummy target to force execution of dependent targets.
168 # Target to uncomment host-specific lines in this makefile. Such lines must
169 # have the following string beginning in column 1: #__<hostname>__#
170 # Original Makefile is backed up as 'Makefile.old'.
172 # Invoke with: make make HOST=xxx
175 -@if
test $(HOST
)x
= x
; then \
176 echo
'\aSpecify "make make HOST=???"'; \
179 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
180 if
test $$?
= 0 ; then \
181 echo
"\aMakefile has already been processed with 'make make'";\
184 mv
-f Makefile Makefile.old
; \
185 echo
"#The next line was generated by 'make make'" >Makefile
; \
186 echo
"HOST=$(HOST)" >>Makefile
; \
188 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
192 Makefile
: $(srcdir)/Makefile.in
$(srcdir)/configure
193 (cd
$(srcdir) ; .
/configure
-host
=$(host
) $(target
))
195 ### Local Variables: ***
196 ### mode:fundamental ***
197 ### page-delimiter: "^#\f" ***