# Makefile for Glutton


TARGET=glutton
TARGET_DEF=LINUX


CFLAGS=-Wall -O2 $(SDL_CFLAGS) -DDATA_PREFIX=\"$(DATA_PREFIX)\" \
	-D$(NOSOUNDFLAG) -D$(TARGET_DEF)


# Other definitions:

MIXER=
SDL_LIB=$(SDL_LDFLAGS) $(MIXER)
SDL_CFLAGS := $(shell sdl-config --cflags)
SDL_LDFLAGS := $(shell sdl-config --libs)
NOSOUNDFLAG=NOSOUND

# Make commands:

all:	$(TARGET)

enablesound:
	make glutton MIXER=-lSDL_mixer NOSOUNDFLAG=PLAY_MOD

win32:
	make TARGET_DEF=WIN32 TARGET=glutton.exe \
		DATA_PREFIX=data/
	cp /usr/local/cross-tools/i386-mingw32/lib/SDL*.dll .
	chmod 644 SDL*.dll

clean:
	-rm glutton glutton.exe
	-rm *.o
	-rm SDL*.dll


# Main executable:

$(TARGET):	main.o RS_gfx.o 
	$(CC) $(CFLAGS) RS_gfx.o main.o -o $(TARGET) $(SDL_LIB)


# Main object:

main.o:	main.c
RS_gfx.o: RS_gfx.c