THIS=Makefile-i386

SRCOBJS := audio.o hostcall.o keymap.o main.o screen.o shortcut.o input.o
OBJS := fe2.s.o host.o \
	$(addprefix src/,$(SRCOBJS))
TARGET := frontier

CFLAGS := -O3 -fomit-frame-pointer -Wall -Wno-unused -s \
	`sdl-config --cflags` -DOGG_MUSIC

LIBS := -lGL -lGLU -lvorbisfile -lvorbis -logg \
	`sdl-config --libs`

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(CFLAGS) $(LIBS) $(OBJS) -o $@

as68k/as68k:
	$(MAKE) -C as68k/

fe2.s.S: as68k/as68k
	as68k/as68k --output-i386 fe2.s

clean:
	rm -rf fe2.s.bin $(OBJS) fe2.s.S $(TARGET)

allclean: clean
	$(MAKE) -C as68k/ clean

# To make a nice clean tarball
dist:
	$(MAKE) -f Makefile-C dist

audio-dist:
	$(MAKE) -f Makefile-C audio-dist

