# $Cambridge: hermes/src/prayer/templates/Makefile,v 1.15 2009/03/19 17:30:03 dpc22 Exp $
# Prayer - a Webmail Interface
#
# Copyright (c) University of Cambridge 2000 - 2008
# See the file NOTICE for conditions of use and distribution.

ifeq ($(strip $(RPM_BUILD)), true)
include ../Config-RPM
else
include ../Config
endif

TEMPLATES = old cam

SUBDIRS = src $(TEMPLATES)

BASECFLAGS = -I../lib
MYCFLAGS  = $(BASECFLAGS)

all: index.o
	for i in $(SUBDIRS); do $(MAKE) -C $$i all; done

install:
	for i in $(SUBDIRS); do $(MAKE) -C $$i install; done

clean:
	for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
	rm -f index.o index.c index_frontend.o index_frontend.c

index.o: index.c
	$(CC) $(MYCFLAGS) -c index.c

index.c: ./src/build_map_index.pl
	./src/build_map_index.pl $(TEMPLATES) > index.c

