X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Fld-acess_src%2FMakefile;h=b118824e7b3365fd67e28380cb09c158de688265;hb=5b487e31cf5145372e9777e9f82a8cd661d4f1b4;hp=419e47dbaf832cb085b783079716df7c04115c02;hpb=5e2eec749173135a9639e5732f229e002c0b02d0;p=tpg%2Facess2.git diff --git a/AcessNative/ld-acess_src/Makefile b/AcessNative/ld-acess_src/Makefile index 419e47db..b118824e 100644 --- a/AcessNative/ld-acess_src/Makefile +++ b/AcessNative/ld-acess_src/Makefile @@ -11,16 +11,18 @@ 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 CFLAGS += -Wall CFLAGS += -Werror -CFLAGS += -g -O2 +CFLAGS += -g -std=c99 CPPFLAGS += -DARCHDIR_is_x86_64=1 LDFLAGS += -g -Wl,-T,obj-$(PLATFORM)/link.ld @@ -35,7 +37,7 @@ 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 @@ -45,7 +47,13 @@ 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) -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' > $@