#===========================================================================
#
#   Description:    Makefile for libfg
#
#   Author:         Gavin Baker <gavinb@antonym.org>
#
#   Homepage:       http://www.antonym.org/libfg
#
#   License:        Released under the GPL v2
#
#===========================================================================

.SUFFIXES: .c .o

#---------------------------------------------------------------------------
# Options
#---------------------------------------------------------------------------

# Targets
LIB = libfg.a
EXE = test_capture
OBJS = capture.o frame.o

# Build flags with no gui
INCLUDES = -I.
CFLAGS = -g3 -Wall $(INCLUDES)
LFLAGS = -lm

CC = gcc
MAKEDEP = makedepend


#---------------------------------------------------------------------------
# Build section
#---------------------------------------------------------------------------

%.o : %.c
		${CC} ${CFLAGS} -c $< -o $@

all: 		$(EXE) $(LIB) camview

$(LIB):		$(OBJS)
		ar r $(LIB) $(OBJS)

$(EXE):		$(LIB) test_capture.o
		$(CC) $(LFLAGS) -o $(EXE) test_capture.o $(LIB)

camview:	camview.c
		$(CC) $(CFLAGS) $(LFLAGS) -o camview camview.c \
			libfg.a -lSDL -lpthread

doc:		#
		doxygen libfg.dox

dep:	#
	$(MAKEDEP) $(INCLUDES) -Y -s "# Dependencies (generated by 'make dep')" *.c 2>/dev/null
	$(RM) -f Makefile.bak

clean:
	@rm -f $(EXE) $(LIB) $(OBJS) test_capture.o camview *~

#===========================================================================
# Dependencies (generated by 'make dep')

capture.o: capture.h frame.h
fgmodule.o: capture.h frame.h
frame.o: frame.h
test_capture.o: capture.h frame.h
