# makefile for GalaXa

# A space shoot-em-up game for X-Window

# by Bill Kendrick <bill@newbreedsoftware.com>
# New Breed Software <http://www.newbreedsoftware.com/galaxa/>

# April 6, 1998 - August 6, 2023


CC=gcc
MATHLIB=-lm
OPTFLAG=

POSTPROCESS=ls -l
# POSTPROCESS=strip

XLIB=-L /usr/X11R6/lib -lX11
CFLAGS=-I/usr/X11/include -ggdb


OBJECTS=galaxa.o hints.o randnum.o setup.o text.o soundmgr.o

#-- Makefile commands--#

all:	galaxa
	chmod 755 sounds images
	chmod 644 *.c *.h docs/*.txt sounds/*.au images/*.ppm

clean:
	rm *.o galaxa galaxa-highs.dat


galaxa:	$(OBJECTS)
	$(CC)	$(OBJECTS) $(XLIB) $(MATHLIB) $(CFLAGS) $(OPTFLAG) -o galaxa
	chmod 755 galaxa
	$(POSTPROCESS) galaxa


#-- App object--#

galaxa.o:	galaxa.c hints.h randnum.h setup.h text.h soundmgr.h
	$(CC)	galaxa.c -c $(CFLAGS)


#-- Lib objects--#

hints.o:	hints.c hints.h
	$(CC)	hints.c -c $(CFLAGS)

text.o:	text.c text.h
	$(CC)	text.c -c $(CFLAGS)

soundmgr.o:	soundmgr.c soundmgr.h
	$(CC)	soundmgr.c -c $(CFLAGS)

randnum.o:	randnum.c randnum.h
	$(CC)	randnum.c -c $(CFLAGS)

setup.o:	setup.c setup.h hints.h text.h soundmgr.h randnum.h
	$(CC)	setup.c -c $(CFLAGS)
