1 # Acess Dynamic Linker (ELF) Version 1
5 -include ../Makefile.cfg
7 OBJ := main.o lib.o loadlib.o export.o elf.o pe.o
8 OBJ += arch/$(ARCHDIR).ao_
10 EXTRABIN := libld-acess.so
11 EXTRACLEAN = $(_OBJPREFIX)_stublib.o
14 CFLAGS = -g -Wall -fno-builtin -fno-stack-protector -fPIC
15 # -fno-leading-underscore
16 CFLAGS += $(CPPFLAGS) -Werror
17 LDFLAGS = -g -T arch/$(ARCHDIR).ld -Map map.txt --export-dynamic
20 XBIN := $(addprefix $(OUTPUTDIR)Libs/,$(EXTRABIN))
21 $(XBIN): obj-$(ARCH)/_stublib.o
28 include ../Makefile.tpl
30 # create libld-acess.so
31 $(_XBIN): $(_OBJPREFIX)_stublib.o
32 @echo [LD] -o -shared libld-acess.so
33 $(LD) -shared -o $@ $< $(LDFLAGS)
34 # @$(LD) $(LDFLAGS) -o $@ $(OBJ)
37 # Override .ao to look in the object prefix for the source
38 $(_OBJPREFIX)arch/$(ARCHDIR).ao_: $(_OBJPREFIX)arch/$(ARCHDIR).$(ASSUFFIX)
41 @$(AS) $(ASFLAGS) -o $@ $<
43 #.PRECIOUS: $(OBJ:%.ao=%.asm)
45 # Preprocessing objects if needed
46 $(_OBJPREFIX)arch/$(ARCHDIR).$(ASSUFFIX): arch/$(ARCHDIR).$(ASSUFFIX).h arch/syscalls.s.h
49 @$(CPP) $(CPPFLAGS) -P -D__ASSEMBLER__ $< -o $@
51 $(_OBJPREFIX)_stublib.o: arch/syscalls.s.h