
# Makefile for
# SPACE GLIDER 0.3 alpha
#
# Recommended:
# -O2 produces faster code than -O3 on Intel-x86 targets, because
# of lack of registers. Normally -O3 would inline small functions,
# but on the Intel machine with their few registers, this causes
# registers to be saved to memory within inner loops, so forget
# about -O3
#
# suggestions for linker-options for other platforms than DOS
# see the out-commented lines that say "LIB=..."

# --------------------------------------------------------------------

.PHONY: clean 

PROGRAM = glider.exe

OFILES  = engine.o \
          game.o \
          gamedraw.o \
          gameinit.o \
          gamemob.o \
          gamepace.o \
          global.o \
          inputs.o \
          main.o \
          special.o \
          synth.o \
          timer.o \
          vector.o

CFLAGS  = -march=pentium \
          -O2 \
          -fno-exceptions \
          -fno-rtti \
          -ffast-math \
          -funroll-loops \
          -fomit-frame-pointer \
          -fstrict-aliasing \
          -Wall \
          -Woverloaded-virtual \
          -DCLIPPING

LFLAGS  = -s

LIB     = -lalleg -lstdcxx
#LIB     = -lalleg -lstdc++
#LIB     = `allegro-config-libs` -lstdc++

# --------------------------------------------------------------------

$(PROGRAM): $(OFILES)
	gcc $(LFLAGS) -o $(PROGRAM) $(OFILES) $(LIB)

clean:
	del *.o
	del *.exe

%.o: %.cc
	gcc $(CFLAGS) -o $@ -c $<

