# lcdtest: LCD monitor test pattern generator
# Makefile
# $Id: Makefile 22 2005-05-20 08:01:53Z eric $
# Copyright 2005 Eric Smith <eric@brouhaha.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.  Note that permission is
# not granted to redistribute this program under the terms of any
# other version of the General Public License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111  USA

CFLAGS = -Wall -g
LDLIBS = -lSDL -lSDL_image

# -----------------------------------------------------------------------------
# You shouldn't have to change anything below this point, but if you do please
# let me know why so I can improve this Makefile.
# -----------------------------------------------------------------------------

VERSION = 1.01

PACKAGE = lcdtest

TARGETS = lcdtest

CSRCS = lcdtest.c SFont.c
HDRS = SFont.h

HELPFONT = 14P_Arial_Plain_Red.png

MISC = COPYING README Makefile

DISTFILES = $(MISC) $(HDRS) $(CSRCS) $(HELPFONT)
DISTNAME = $(PACKAGE)-$(VERSION)

all: $(TARGETS)

lcdtest: lcdtest.o helpfont.o SFont.o

helpfont.c: $(HELPFONT)
	pngtopnm $(HELPFONT) | ppmtoxpm -name help_font_xpm -hexonly | sed 's/static //' >helpfont.c

dist: $(DISTFILES)
	-rm -rf $(DISTNAME)
	mkdir $(DISTNAME)
	for f in $(DISTFILES); do ln $$f $(DISTNAME)/$$f; done
	tar --gzip -chf $(DISTNAME).tar.gz $(DISTNAME)
	-rm -rf $(DISTNAME)

DEPENDS = $(CSRCS:.c=.d)

%.d: %.c
	$(CC) -M -MG $(CFLAGS) $< | sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@

include $(DEPENDS)
