##########################################################################
# $Id: Makefile,v 1.00 2003/06/16 23:44:51 csiebholz Exp $
#
# Makefile -- for building showpic
#
# Copyright (c) 2001-2004 Carsten Siebholz (c.siebholz AT t-online de>


##########################################################################
# CONFIGURATION (change to your needs before doing "make all")
#

ifndef INSTALLBINDIR
  INSTALLBINDIR=/usr/local/bin
endif

#-------------------------------------------------------------------------
# General settings:
#       Specify install paths and compiler flags

# Compiler/linker settings
CXX      ?= g++
CXXFLAGS ?= -O2 -Wall -Woverloaded-virtual

##########################################################################
# STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP
# You shouldn't need to edit anything beyond this line!
#

#-------------------------------------------------------------------------
# Target configuration

PRGNAME = showpic
VERSION = 0.0.5
ARCHIVE = $(PRGNAME)-$(VERSION)

OBJS = $(PRGNAME).o ../../logo.o ../../setup.o



#-------------------------------------------------------------------------
# Implicit rules:

%.o: %.c
	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<


#-------------------------------------------------------------------------
# Main Targets

all:    $(PRGNAME)
.PHONY: all

$(PRGNAME): $(OBJS)
ifndef STATIC_DRIVERS
	$(CXX) $(CXXFLAGS) -rdynamic $(OBJS) -lgraphlcd -o $(PRGNAME)
else
	$(CXX) $(CXXFLAGS) -rdynamic $(OBJS) ../../drivers/libgraphlcd.a -o $(PRGNAME)
endif

install: $(PRGNAME)
	install -d $(INSTALLBINDIR)
	install -m 755 -o root -g root -s $(PRGNAME) $(INSTALLBINDIR)

uninstall:
	rm -f $(INSTALLBINDIR)/$(PRGNAME)

clean:
	@-rm -f $(PRGNAME) *.o *.tgz core* *~

dist:	clean
	tar -C .. -czf ../$(ARCHIVE).tgz $(ARCHIVE)
	tar -tzf ../$(ARCHIVE).tgz
	@echo Distribution package created as $(ARCHIVE).tgz

##########################################################################
# EOF
#
