###############################################################################
#
#    AntiRight
#    (c) 2004-2006 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)

clean:
	cd libantiright && $(MAKE) clean
	cd gtkshell && $(MAKE) clean

distclean: clean
	rm config.mk

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

install: all
	$(INSTALL_DIR) $(PREFIX) $(bindir) $(man1dir) $(man2dir) $(docdir)/antiright\
	 $(datadir)/antiright 
	$(INSTALL_DATA) doc/*.1 $(man1dir)
#	$(INSTALL_DATA) doc/*.5 $(man5dir)
	$(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
	$(INSTALL_DATA) doc/HACKING $(docdir)/antiright
	cd gtkshell && $(MAKE) install

tarball: distclean
	cd .. && tar czf antiright-$(VERSION).tar.gz antiright
zip: distclean
	cd .. && find antiright | zip antiright-$(VERSION).zip -@
bzball: distclean
	cd .. && tar cjf antiright-$(VERSION).tar.bz2 antiright
fulldist: tarball zip bzball

jbrel: tarball
	cd .. && mv antiright-$(VERSION).tar.gz www/antiright && cd www/antiright && cvs add antiright-$(VERSION).tar.gz && vi +215 index.html && cvs commit

