###############################################################################
#
#    AntiRight
#    (c) 2004-2007 Jeffrey Bedard
#    antiright@gmail.com
# 
#    This file is part of AntiRight.
#
#     AntiRight 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.
#
#     AntiRight 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 AntiRight; if not, write to the Free Software
#     Foundation, Inc., 51 Franklin Street, Fifth Floor, 
#     Boston, MA  02110-1301  USA		
#
###############################################################################

include ./config.mk

CFLAGS += $(INCLUDE) $(DEFS) -Wall -W -g

all: 
	cd libantiright && $(MAKE)
	cd gtkshell && $(MAKE)
	cd ACE-desktop && $(MAKE)
	cd xshell && $(MAKE)

ctags:
	ctags -w */*.[ch] ACE-desktop/ACE

clean:
	cd libantiright && $(MAKE) clean
	cd gtkshell && $(MAKE) clean
	cd ACE-desktop && $(MAKE) clean
	cd xshell && $(MAKE) clean

distclean: clean
	rm -rf config.mk tags */.\#* .\#* 

INSTALL=install
INSTALL_PROGRAM=$(INSTALL) -c -s
INSTALL_SCRIPT=$(INSTALL) -c -m 755
INSTALL_DATA=$(INSTALL) -c -m 644
INSTALL_DIR=$(INSTALL) -d
bindir=$(PREFIX)/bin
mandir=$(PREFIX)/man
man1dir=$(mandir)/man1
man5dir=$(mandir)/man5
datadir=$(PREFIX)/share
docdir=$(datadir)/doc
PKGBASE=antiright

install: all
	${INSTALL_DIR} $(PREFIX)
	${INSTALL_DIR} $(bindir)
	${INSTALL_DIR} $(man1dir)
	${INSTALL_DIR} $(docdir)/antiright
	$(INSTALL_DATA) doc/gtkshell.1 $(man1dir)
	$(INSTALL_DATA) doc/gshterm.1 $(man1dir)
	$(INSTALL_DATA) COPYING $(docdir)/antiright
	$(INSTALL_DATA) doc/AUTHORS $(docdir)/antiright
	$(INSTALL_DATA) README $(docdir)/antiright
	$(INSTALL_DATA) doc/TODO $(docdir)/antiright
	$(INSTALL_DATA) doc/INSTALL $(docdir)/antiright
	cd gtkshell && $(MAKE) install
	cd ACE-desktop && $(MAKE) install
	cd xshell && $(MAKE) install

bzball: distclean
	cd .. && cp -R antiright antiright-$(VERSION) \
	&& tar cjf antiright-$(VERSION).tar.bz2 antiright-$(VERSION) \
	&& rm -rf antiright-$(VERSION)

