# -*- Mode: Makefile -*-
# $Id: Makefile,v 1.19 2002/03/08 20:55:29 josh Exp $

# Top Level Makefile for IMHO

SUBDIRS		:= apache example experimental lctl 
DOCSUBDIRS	:= doc

LISP		:= lisp
LISPFLAGS	:= -quiet -batch

# prefix applied to all installation
DESTDIR		:=
# base for where to install to, generally /usr/local
prefix		:= /usr/local
# where the lisp goes
lispdest	:= $(prefix)/lib/cmucl/subsystems

# FASL file we produce, defined also in makefile.lisp
FASL		:= imho.fasl
# lisp sources -- FIXME, not right
SRC		:= $(wildcard *.lisp)

# default target; don't build the .fasl by default
.PHONY: default
default:	$(SUBDIRS)

include Makefile.common

.PHONY: build
build: $(FASL)

$(FASL):	$(SRC)
	$(LISP) $(LISPFLAGS) -load makefile

.PHONY: install
install:
	[ ! -d $(lispdir) ] || mkdir -p $(lispdir)
	install -g root -o root -m 0644 $(FASL) $(lispdir)

.PHONY: tags
tags:	TAGS

TAGS:	$(SRC)
	etags $(SRC)

.PHONY: dist
dist:
	./make-dist.sh

.PHONY: wwwdist
wwwdist:
	set -e; for i in $(DOCSUBDIRS); do $(MAKE) -C $$i wwwdist; done

.PHONY: freeze
freeze:
	@echo tagging with frozen tag
	cvs -q rtag -d frozen imho
	cvs -q tag -F frozen .

distclean::
	./debian/rules clean


