###############
#  Makefile   #
#  naveed@cs  #
# Spring 2001 #
###############


#compiler
CC=		gcc

#compiler flags
CFLAGS=		-Wall -ansi -pedantic -O3 -I /usr/X11R6/include

#linker flags
LFLAGS=		-L /usr/X11R6/lib

#stripper
STRIP=		strip

#libraries to link
LIBS=		-lm -lX11 -lXext

#program names
PROGS=		find_light

#include sources
INCS=		

#include objects
INCO=		$(INCS:%.c=%.o)

#all source files
SOURCES=	$(INCS) $(PROGS:%=%.c)

#all object files
OBJECTS=	$(SOURCES:%.c=%.o)


#rule for producing object files
.c.o:
		$(CC) $(CFLAGS) -c $<

#rule for all programs
all:		$(PROGS)
		@echo "[make'd] $(PROGS)"

#link each program
$(PROGS):	$(OBJECTS)
		$(CC) -o $@ $@.o $(INCO) $(LFLAGS) $(LIBS)
		$(STRIP) $@

#clean up objects
clean:
		@rm -f $(OBJECTS) $(PROGS) *.o *~
		@echo "[rm'd] $(OBJECTS) $(PROGS) *.o *~"


#EOF
