summaryrefslogtreecommitdiff
path: root/ld/Makefile
blob: 2e30d96caadfe06297d3403f243661166ee48c7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

LIBDIR	=/usr/bin
CFLAGS	=-O
LDFLAGS	=-s

# May need some of these if the auto-sense fails.
# -DV7_A_OUT			# a.out.h is like V7
# -DBSD_A_OUT			# a.out.h is like BSD
# -DSTANDARD_GNU_A_OUT		# a.out.h is like GNU normal.
# -DNO_AOUT			# a.out.h is like nothing known!
#
DEFS	=-DREL_OUTPUT -DBUGCOMPAT

# An alternative file for a non-standard a.out.h (eg i386 linux on an Alpha)
#
# NATIVE=  -DA_OUT_INCL='"a_out_local.h"' 

OBJS= dumps.o io.o ld.o readobj.o table.o typeconv.o linksyms.o \
      writex86.o writebin.o writerel.o

all: ld86

ld86: $(OBJS)
	$(CC) $(LDFLAGS) $(OBJS) -o $@

install: ld86
	install -d $(LIBDIR)
	install -m 755 ld86 $(LIBDIR)

clean realclean:
	rm -f $(OBJS) ld86

$(OBJS): align.h ar.h bindef.h byteord.h config.h const.h globvar.h obj.h \
	 syshead.h type.h x86_aout.h

ar.h:
	ln -s ../libc/include/ar.h . || \
	ln ../libc/include/ar.h .

writebin.o: writebin.c
	$(CC) $(CFLAGS) $(DEFS) $(NATIVE) -c writebin.c

writerel.o: writebin.c

.c.o:
	$(CC) $(CFLAGS) $(DEFS) -c $< -o $@