# $RCSfile: Makefile,v $
# Makefile for WManager
#
#! author="$Author: M $"
#! revision="$Revision: 1.4 $"
#! date="$Date: 1999/11/14 15:29:24 $"
#! state="$State: Exp $"
#
#
# Copyright (C) 1999  M. Tessmer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.



# make settings
SHELL     = /bin/sh
MAKEFLAGS = --print-directory


# compiler settings
CXX       = g++ 
CXXFLAGS  = -I$(incdir) -O2 -Wall -pedantic #-DDEBUG=1 -g3


# linker settings
LD        = g++
LDFLAGS   = -lfltk -lXext -lX11 -lm
LDDIRS    = -L/usr/X11R6/lib -L/usr/lib -L/usr/local/lib


# install settings
INSTALL       = /usr/bin/install
INSTALL_FLAGS = --strip


# documentation tool
DOCTOOL      = perceps
DOCTOOL_FLAGS = -a -b -f -h -m -r

# base locations
prefix      = /usr/local
exec_prefix = $(prefix)
bindir      = $(exec_prefix)/bin


# include files and sources
incdir      = ./inc
srcdir      = ./src


# documentational files for developer
docdir    = ./doc
templates = $(docdir)/templates


# search paths
vpath %.H    $(incdir)
vpath %.cc   $(srcdir)
vpath %.html $(docdir)

# files
HDR  = Interface.H WManager.H
SRC  = Interface.cc WManager.cc wmanager.cc
MISC = HISTORY README COPYING INSTALL TAGS FAQ LICENSE NEWS TODO Makefile \
	.wmanagerrc .xinitrc
OBJ  = $(patsubst %.cc,%.o,$(SRC)) 


# project version
VERSION = 0.1.1


all: wmanager TAGS

wmanager: $(OBJ)
	$(LD) -o $@ $^ $(LDDIRS) $(LDFLAGS) 

static: $(OBJ)
	$(LD) -o wmanager $^ $(LDDIRS) $(LDFLAGS) -static

install: wmanager
	$(INSTALL) $< $(bindir)/$<

clean:
	@rm -f $(OBJ) wmanager

distclean:
	@rm -f $(OBJ) wmanager TAGS

doc: $(HDR)
	$(DOCTOOL) $(DOCTOOL_FLAGS) -d $(docdir) -t $(templates) $< 

TAGS: $(HDR) $(SRC)
	etags --c++ -o $@ $^

version:
	@-echo -e '\nwmanager - X11 window manager selector'
	@-echo 'v$(VERSION) 1999/09/26 by M. Tessmer'
	@-echo 'Look at README for more information\n'


# phony targets
.PHONY: all clean distclean TAGS version doc
