# ==============================================================================
#  Makefile  for  C
# ==============================================================================
TARGET       = sdl-sample.exe

CC           = gcc

#CFLAGS       = -O -Wall `./sdl-config --cflags`
CFLAGS       = -O -Wall -I/usr/include/SDL
LDFLAGS      = 
INCLUDES     = 
#LIBS         = `./sdl-config --libs` -lSDL_image -lSDL_mixer -lSDL_ttf
LIBS         = -L/usr/lib -lSDL -lSDLmain -lSDL_image

SOURCES      = $(wildcard src/*.c)
DOCDIR       = docs
OBJS         = $(SOURCES:.c=.o)
BACKUP_FILES = $(SOURCES:.c=.c~)

.SUFFIXES: .c .o

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) -o$(TARGET) $(LDFLAGS) $(OBJS) $(LIBS)

.c.o:
	$(CC) $(CFLAGS) $(INCLUDES) -o$@ -c $(CFLAGS) $<

clean:
	rm -rf $(OBJS) $(BACKUP_FILES) $(TARGET)

