AcessNative - Changes to allow _compiling_ on windows.
[tpg/acess2.git] / AcessNative / ld-acess_src / Makefile
index 805b3a5..bbaef1d 100644 (file)
@@ -11,6 +11,7 @@ OBJ := $(addprefix obj-$(PLATFORM)/,$(OBJ))
 
 ifeq ($(PLATFORM),win)
        BIN := ../ld-acess.exe
+       LDFLAGS += -lws2_32
 endif
 ifeq ($(PLATFORM),lin)
        BIN := ../ld-acess
@@ -35,7 +36,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 $@ > [email protected]
 
 obj-$(PLATFORM)/%.o: %.c
@@ -50,5 +51,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)
 

UCC git Repository :: git.ucc.asn.au