AS = vasm
LD = vlink
CFLAGS	= -cpu=68030 -O1
# -Felf				Use module elf as output driver.
# -ignore-mult-inc	When the same file is included multiple times with the same path this is silently ignored, causing the file to be processed only once. Note that you can still include the same file twice when using different paths to access it.
# -noesc			No escape character sequences. This will make vasm treat the escape character \ as any other character.
# -nosym			Strips all local symbols from the output file and doesn't include any other symbols than those which are required for external linkage. 
# -x				Show an error message, when referencing an undefined symbol. The default behaviour is to declare this symbol as externally defined.
# -Devpac 			All options initially Devpac compatible (optimizations disabled)
ASFLAGS = -Felf -ignore-mult-inc -noesc -nosym -x -m68030 -devpac -showopt
# -bataritos	Atari-ST TOS file format. Executables only at the moment. The internal linker script defines _LinkerDB for small data and supports
#				vbcc-style constructor/destructor tables in the data section (__CTOR_LIST__ and __DTOR_LIST__).
# -tos-flags	bit 0: fastload, bit 1: load into fast RAM, bit 2: malloc uses fast RAM
LDFLAGS = -bataritos -tos-flags 1

TARGET = NIND
OBJ = $(addsuffix .O,$(TARGET))
EXE = $(addsuffix .PRG,$(TARGET))

%.O: %.S
	$(AS) $(ASFLAGS) $< -o $@

$(EXE): $(OBJ)
	$(LD) $< $(LDFLAGS) -o $@

all:
	$(EXE)

clean:	
	rm $(EXE) $(OBJ)
