megadrive_test1

diff Makefile @ 6:862f8a034cae

expanding the megadrive code
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 11 Feb 2017 08:56:42 +0200
parents e7138066c7ea
children
line diff
     1.1 --- a/Makefile	Wed Feb 01 14:40:19 2017 +0200
     1.2 +++ b/Makefile	Sat Feb 11 08:56:42 2017 +0200
     1.3 @@ -1,4 +1,4 @@
     1.4 -csrc = $(wildcard src/*.c)
     1.5 +csrc = $(wildcard src/*.c) $(wildcard src/libc/*.c)
     1.6  asrc = $(wildcard src/*.s)
     1.7  aSsrc = $(wildcard src/*.S)
     1.8  obj = $(asrc:.s=.o) $(aSsrc:.S=.o) $(csrc:.c=.o)
     1.9 @@ -9,7 +9,8 @@
    1.10  
    1.11  warn = -pedantic -Wall
    1.12  dbg = -g
    1.13 -def = -DGAMENAME=\"testgame\" -DVERSTR=\"01\"
    1.14 +def = -DGAMENAME=\"testgame\" -DVERSTR=\"01\" -D__NO_CTYPE
    1.15 +inc = -Isrc/libc
    1.16  
    1.17  tool_prefix = m68k-linux-gnu-
    1.18  
    1.19 @@ -18,16 +19,17 @@
    1.20  LD = $(tool_prefix)ld
    1.21  OBJCOPY = $(tool_prefix)objcopy
    1.22  
    1.23 -CFLAGS = -m68000 -fno-builtin $(warn) $(dbg) $(opt) $(def)
    1.24 +CFLAGS = -m68000 -ffreestanding -fno-builtin $(warn) $(dbg) $(opt) $(def) $(inc)
    1.25  CPPFLAGS = $(def)
    1.26  ASFLAGS = -m68000
    1.27 -LDFLAGS = -T megadrive.ldscript -print-gc-sections
    1.28 +LDFLAGS = -T megadrive.ldscript -print-gc-sections \
    1.29 +		  -L/usr/lib/gcc-cross/m68k-linux-gnu/6 -lgcc
    1.30  
    1.31  $(bin): $(elf)
    1.32  	$(OBJCOPY) -O binary $< $@
    1.33  
    1.34  $(elf): $(obj)
    1.35 -	$(LD) -o $@ $(LDFLAGS) $(obj) -Map link.map
    1.36 +	$(LD) -o $@ $(obj) -Map link.map $(LDFLAGS)
    1.37  
    1.38  .PHONY: clean
    1.39  clean: