#  Copyright 2004 Garth Gillespie, All Right Reserved.
# This makefile is part of Analog Annelid, the creation of Garth Gillespie,
# And may only be used for educational, non-profit purposes.
# For more information, please visit http://www.garthgillespie.com/annelid/ .

# Comment the next line for non-windows.  This is not well tested.
WINDOWS=1

ifdef WINDOWS
NAME=annelid.exe
else
NAME=annelid
endif

OBJS=main.o mixer.o highscore.o texture.o centeredtexture.o fonttexture.o scrolltexture.o targa.o worm.o apple.o powerup.o visual.o

CC=gcc
CCC=g++
CFLAGS=-I. `sdl-config --cflags` -c -Wall -ggdb -fomit-frame-pointer -O3

LD=g++

ifdef WINDOWS
LIBS=-lopengl32 `sdl-config --libs`
else
LIBS=-L/usr/X11R6/lib -lGL `sdl-config --libs`
endif

all: $(NAME)

run: $(NAME)
	./$(NAME)

final: $(NAME)
	strip $<
	upx -9 $<

$(NAME): $(OBJS)
	$(LD) $(OBJS) -o $@ $(LIBS)

.cpp.o:
	$(CCC) $(CFLAGS) $<

.c.o:
	$(CC) $(CFLAGS) $<

clean:
	rm -f *.o $(NAME)

nice: final
	rm -f *.o
