# $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

# base settings
bindir	= $(PREFIX)/bin
incdir	= ./inc
srcdir	= ./src
fltkinc	= $(X11BASE)/include
x11lib	= $(X11BASE)/lib

# compiler settings
CXX      ?= g++
CXXFLAGS+= -I$(fltkinc) -I$(incdir) $(PTHREAD_CFLAGS) #-DDEBUG=1 -g3

# linker settings
LD        = $(CXX)
LDFLAGS   = -lGL -lfltk -lXext -lX11 -lm $(PTHREAD_LIBS)
LDDIRS    = -L$(x11lib)

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


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

# 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

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


syntax highlighted by Code2HTML, v. 0.9.1