SYSTEM := $(shell uname -s)
AS := vasmm68k_mot
RM := rm -f

ifeq ($(SYSTEM),AmigaOS)
ASFLAGS := -Fbin -pic -devpac -INDK3.9:include/include_i
else
ASFLAGS := -Fbin -pic -devpac -I/NDK3.9/include/include_i
endif

xfd-m68k.c: xfd-m68k.bin
	echo "#include <exec/types.h>" > $@
	echo "" >> $@
	echo "ULONG Xfd68k[] = {" >> $@
	byte2c -e $< 4 >> $@
	echo "};" >> $@

xfd-m68k.bin: xfd-m68k.s slaves/*.s
	$(AS) $(ASFLAGS) -o $@ $< $(LIBS)

clean:
	$(RM) xfd-m68k.c xfd-m68k.bin

