summaryrefslogtreecommitdiff
path: root/ld/Makefile
blob: 104a74065395307de49f9cdfbb23da5c8ae03c6d (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
47
48
49
50
51

ifeq ($(VERSION),)
include Version
endif

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

# 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 -DVERSION='"$(VERSION)"'

# 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 objchop catimage objdump86

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

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

clean realclean clobber:
	rm -f *.o ld86 ld86r objchop catimage objdump86

$(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:
	[ -f ar.h ] || \
	{ rm -f ar.h ; ln -s ../libc/include/ar.h . ; } || \
	ln ../libc/include/ar.h .

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

writerel.o: writebin.c

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