#-----------------------------------------------------------------------------
# File Name: makefile
# Description
# -----------
# This is the makefile for the MilanDiag project.
#
#-----------------------------------------------------------------------------
SHELL 		= /bin/sh
EXECUTABLES	= MilanDiag

#-- Release Compiler Flags ---------------------------------------------------

CXXFLAGS		+= -O2 -g0 -Wall -pipe -fomit-frame-pointer -D_GNU_SOURCE \
			   -Wno-invalid-offsetof \
			   `pkg-config --cflags gtk+-2.0 gnome-desktop-2.0 libgnomeui-2.0`
PKGFLAGS		+= `pkg-config --libs gtk+-2.0 gnome-desktop-2.0 libgnomeui-2.0`


#-- Required libraries -------------------------------------------------------

LIBS		 = -lrt -lftdi -laes_access -lstdc++

#-- Dependencies -------------------------------------------------------------

OBJS = data_funcs.o callbacks.o interface.o main.o support.o
DEPS = data_funcs.h callbacks.h interface.h main.h support.h

#-- Compile All --------------------------------------------------------------

.PHONEY: all
all: 	$(EXECUTABLES)

#-- Clean Up -----------------------------------------------------------------

.PHONEY: clean
clean:

	rm -f *.[bo]
	rm -f *.err
	rm -f $(EXECUTABLES)

#-- Install ------------------------------------------------------------------

.PHONEY: install
install:

	cp -fv $(EXECUTABLES) /usr/bin/

#-- Build targets ------------------------------------------------------------
MilanDiag: $(OBJS)
	$(CC) $(OBJS) $(CXXFLAGS) $(PKGFLAGS) $(LIBS) -o $@

#-- Check on headers ---------------------------------------------------------

MilanDiag.o: $(DEPS)

#------------------------------ END OF FILE ----------------------------------

