# makefile for Vectoroids

# (Based on Agendaroids)

# by Bill Kendrick
# bill@newbreedsoftware.com
# http://www.newbreedsoftware.com/

# November 30, 2001 - January 3, 2002


PREFIX=/usr/local
MAN_PREFIX=$(PREFIX)
BIN_PREFIX=$(PREFIX)/bin
DATA_PREFIX=$(PREFIX)/share/vectoroids/
JOY=YES

NOSOUNDFLAG=__SOUND
MIXER=-lSDL_mixer

CFLAGS=-Wall -Wno-long-long -pedantic -ansi -O2 \
	$(shell sdl-config --cflags) -D$(NOSOUNDFLAG) \
	-DDATA_PREFIX=\"$(DATA_PREFIX)\" -DJOY_$(JOY)
LIBS=$(shell sdl-config --libs) $(MIXER) -lSDL_image


all:	vectoroids

nosound:
	make vectoroids MIXER= NOSOUNDFLAG=NOSOUND

install:
	install -d $(DATA_PREFIX)
	cp -R data/* $(DATA_PREFIX)
	chmod -R a+rX,g-w,o-w $(DATA_PREFIX)
	cp vectoroids $(BIN_PREFIX)
	chmod a+rx,g-w,o-w $(BIN_PREFIX)/vectoroids
	install -d $(MAN_PREFIX)/man/man6/
	cp vectoroids.6 $(MAN_PREFIX)/man/man6/
	chmod a+rx,g-w,o-w $(MAN_PREFIX)/man/man6/vectoroids.6


clean:
	-rm vectoroids
	-rm *.o


vectoroids:	vectoroids.o
	$(CC) $(CFLAGS) vectoroids.o -o vectoroids $(LIBS)


vectoroids.o:	vectoroids.c
