X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Fld-acess_src%2FMakefile;h=b118824e7b3365fd67e28380cb09c158de688265;hb=3c283c4831c40c14d308a54cefb997832a860bca;hp=805b3a5f0fe3db4aa6f7441277d320d5c77ba36a;hpb=57e4db716b3e7db0be336abd9f256962e3b19aa3;p=tpg%2Facess2.git diff --git a/AcessNative/ld-acess_src/Makefile b/AcessNative/ld-acess_src/Makefile index 805b3a5f..b118824e 100644 --- a/AcessNative/ld-acess_src/Makefile +++ b/AcessNative/ld-acess_src/Makefile @@ -11,6 +11,8 @@ 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 @@ -20,7 +22,7 @@ endif CFLAGS += -Wall CFLAGS += -Werror -CFLAGS += -g +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 @@ -50,5 +52,11 @@ obj-lin/link.ld: Makefile @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' > $@ + -include $(DEPFILES)