X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Fld-acess_src%2FMakefile;h=78e07856c23fb71e91f552da207a15589fa84f7e;hb=96d72268a3a1cfddcbd71353881e8bfadc17db5e;hp=af7f8c865231bb01d68919a8afc89555337503bf;hpb=a41f3e5efdf853726d078dc03550de40e9d63bdd;p=tpg%2Facess2.git diff --git a/AcessNative/ld-acess_src/Makefile b/AcessNative/ld-acess_src/Makefile index af7f8c86..78e07856 100644 --- a/AcessNative/ld-acess_src/Makefile +++ b/AcessNative/ld-acess_src/Makefile @@ -11,10 +11,12 @@ OBJ := $(addprefix obj-$(PLATFORM)/,$(OBJ)) ifeq ($(PLATFORM),win) BIN := ../ld-acess.exe + LINKADDR := 0x70000000 + LDFLAGS += -lws2_32 -Wl,--image-base,$(LINKADDR) endif ifeq ($(PLATFORM),lin) BIN := ../ld-acess - LINKADDR := 0x200000 + LINKADDR := 0x70000000 # LD += -m elf_i386 endif @@ -35,7 +37,8 @@ clean: $(RM) $(BIN) $(OBJ) $(DEPFILES) obj-$(PLATFORM)/link.ld $(BIN): obj-$(PLATFORM)/link.ld $(OBJ) - $(CC) $(LDFLAGS) -o $@ $(OBJ) + $(CC) -o $@ $(OBJ) $(LDFLAGS) + objdump -S $@ > $@.dsm obj-$(PLATFORM)/%.o: %.c @mkdir -p $(dir $@) @@ -44,10 +47,16 @@ obj-$(PLATFORM)/%.o: %.c @$(CC) -M $(CPPFLAGS) -MT $@ -o $@.dep $< # Modify the default makefile to put the executable at 1MB instead -obj-lin/link.ld: +obj-lin/link.ld: Makefile @mkdir -p $(dir $@) @echo "Making Linker Script ($@)" - $(LD) --verbose | awk '{ if( substr($$0,0,5) == "====="){ bPrint = !bPrint; } else { if(bPrint){ print $$0;} } }' | sed 's/\b0x[048][0-9]*\b/$(LINKADDR)/g' | sed 's/CONSTANT (MAXPAGESIZE)/0x1000/g' > $@ + $(LD) -g --verbose | awk '{ if( substr($$1,0,5) == "====="){ bPrint = !bPrint; } else { if(bPrint){ print $$0;} } }' | sed 's/\b0x[048][0-9]*\b/$(LINKADDR)/g' | sed 's/CONSTANT (MAXPAGESIZE)/0x1000/g' > $@ + +# Modify the default makefile to put the executable at 1MB instead +obj-win/link.ld: Makefile + @mkdir -p $(dir $@) + @echo "Making Linker Script ($@)" + $(LD) -g --verbose | awk '{ if( substr($$1,0,5) == "====="){ bPrint = !bPrint; } else { if(bPrint){ print $$0;} } }' | sed 's/\b0x[048][0-9]*\b/$(LINKADDR)/g' | sed 's/CONSTANT (MAXPAGESIZE)/0x1000/g' > $@ -include $(DEPFILES)