X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Fld-acess.so_src%2FMakefile;h=4fb6ae281ac53357460cde4c5062d4876dc7e5ab;hb=4726431cb7e0bada749b32f9e51dedadf882d50b;hp=3531f710a65e52fba2500ea3e24edda4923be90b;hpb=824973b161a176419750512e62a3385e4f4419b1;p=tpg%2Facess2.git diff --git a/AcessNative/ld-acess.so_src/Makefile b/AcessNative/ld-acess.so_src/Makefile index 3531f710..4fb6ae28 100644 --- a/AcessNative/ld-acess.so_src/Makefile +++ b/AcessNative/ld-acess.so_src/Makefile @@ -5,16 +5,19 @@ ifeq ($(PLATFORM),) PLATFORM := lin endif -OBJ := syscalls.$(PLATFORM).o request.$(PLATFORM).o +OBJ := main.o syscalls.o request.o binary.o memory.o +OBJ += elf.o +OBJ := $(addsuffix .$(PLATFORM),$(OBJ)) ifeq ($(PLATFORM),win) - BIN := ../libacess.dll + BIN := ../ld-acess.exe endif ifeq ($(PLATFORM),lin) - BIN := ../libacess.so - CFLAGS += -fPIC + BIN := ../ld-acess + LD += -m elf_i386 endif +CFLAGS += -Wall -Werror -g -m32 .PHONY: all clean @@ -23,9 +26,14 @@ all: $(BIN) clean: $(RM) $(BIN) $(OBJ) -$(BIN): $(OBJ) - $(CC) -shared -o $@ $< +$(BIN): link.ld.$(PLATFORM) $(OBJ) +# $(LD) -g -o $@ $(OBJ) -T link.ld.$(PLATFORM) + $(CC) -g -o $@ $(OBJ) -m32 -Wl,-T,link.ld.$(PLATFORM) -%.$(PLATFORM).o: %.c +%.o.$(PLATFORM): %.c $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) +# Modify the default makefile to put the executable at 1MB instead +link.ld.lin: + $(LD) --verbose | awk '{ if( substr($$0,0,5) == "====="){ bPrint = !bPrint; } else { if(bPrint){ print $$0;} } }' | sed 's/\b0x0[08][0-9]*\b/0x00100000/g' > $@ +