# $Cambridge: hermes/src/prayer/templates/xhtml_strict/Makefile,v 1.4 2008/06/09 09:26:13 dpc22 Exp $

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

CFLAGS  = $(BASECFLAGS)
LDFLAGS = $(BASELDFLAGS)

TYPE=xhtml_strict

TARGET=templates.a

O_FILES=_template_index.o \
 abook_add_help.o abook_add.o abook_list_help.o abook_list_nav_1_icons.o \
 abook_list_nav_1_noicons.o abook_list_nav_1.o abook_list_nav_2.o \
 abook_list_search.o abook_list.o abook_list_title.o \
 abook_list_toolbar_bottom.o abook_list_toolbar_top.o abook_lookup_help.o \
 abook_lookup_nav_1_icons.o abook_lookup_nav_1_noicons.o \
 abook_lookup_nav_1.o abook_lookup_search.o abook_lookup.o \
 abook_search_help.o abook_search.o abook_take_help.o abook_take.o \
 abook_transfer_help.o abook_transfer.o abook_update_help.o abook_update.o \
 action_stub.o attachments_help.o attachments.o block_fail.o block_help.o \
 block.o compose_large_help.o compose_large_top.o compose_postponed_help.o \
 compose_postponed.o compose_small_help.o compose_small_top.o compose.o \
 compose_toolbar_left.o compose_toolbar_right.o compose_toolbar.o \
 copy_help.o copy.o copy_toolbar.o dictionary_help.o dictionary.o \
 display_addr.o display_hdrs.o display_help.o display_mime_msg.o \
 display_mime_other.o display_mime.o display_mime_text.o display.o \
 display_tail.o display_toolbar_icons.o display_toolbar_noicons.o \
 display_toolbar.o download_xfer_error.o error.o expunge.o \
 favlist_favourites.o favlist.o favourites_help.o favourites.o \
 favourites_toolbar.o filter_fail.o filter_help.o filter_select_help.o \
 filter_select.o filter_select_toolbar.o filter.o folderlist_folders.o \
 folderlist_icons.o folderlist_nfolders.o folderlist_noicons.o \
 folderlist_select.o folderlist.o folders_help.o folders.o folders_toolbar.o \
 footer.o fullname_help.o fullname.o header.o include_help.o include.o \
 list_help.o list_msgs.o list_nav_1_icons.o list_nav_1_noicons.o \
 list_nav_1.o list_nav_2.o list.o list_title.o list_toolbar_bottom.o \
 list_toolbar_top.o logout.o manage_help.o manage.o passwd_help.o passwd.o \
 prefs_compose1_help.o prefs_compose2_help.o prefs_compose2.o \
 prefs_compose.o prefs_display1_help.o prefs_display_abook_sort.o \
 prefs_display_folder_sort.o prefs_display.o prefs_folder_help.o \
 prefs_folder.o prefs_general_help.o prefs_general.o prefs_option.o \
 quota_help.o quota.o redirect_fail.o redirect_help.o redirect.o \
 rename_help.o rename.o rename_toolbar.o reply_help.o reply.o restart.o rm.o \
 roles_entry_help.o roles_entry.o roles_list_help.o roles_list.o \
 roles_select_help.o roles_select.o search_date_help.o search_date.o \
 search_footer.o search_header.o search_size_help.o search_size.o \
 search_status_help.o search_status.o search_text_help.o search_text.o \
 sieve_error.o sieve_error_tail.o sieve_fail.o sieve_help.o sieve.o \
 spam_fail.o spam_help.o spam.o spell.o status.o tb_icon_form.o tb_icon.o \
 toolbar_help.o toolbar_left.o toolbar_right.o toolbar_stub_help.o toolbar.o \
 transfer_help.o transfer.o transfer_toolbar_bottom.o transfer_toolbar_top.o \
 upload_select_help.o upload_select.o vacation_fail.o vacation_help.o \
 vacation.o vaclog_fail.o vaclog_help.o vaclog.o welcome_help.o welcome.o 

C_FILES=${O_FILES:.o=.c}

.PRECIOUS: $(C_FILES)

HTML=\
 abook_add.html abook_list.html abook_lookup.html \
 abook_search.html abook_take.html abook_transfer.html abook_update.html \
 attachments.html block_fail.html block.html compose_postponed.html \
 compose.html copy.html dictionary.html display.html download_xfer_error.html \
 error.html expunge.html favourites.html filter_fail.html \
 filter_select.html filter.html folders.html fullname.html include.html \
 list.html logout.html manage.html passwd.html \
 prefs_compose2.html prefs_compose.html prefs_display.html prefs_folder.html \
 prefs_general.html quota.html redirect_fail.html \
 redirect.html rename.html reply.html restart.html rm.html roles_entry.html \
 roles_list.html roles_select.html search_date.html \
 search_size.html search_status.html search_text.html sieve_error.html \
 sieve_fail.html sieve.html spam_fail.html spam.html spell.html \
 transfer.html upload_select.html vacation_fail.html vacation.html \
 vaclog_fail.html vaclog.html welcome.html

EXPAND=../src/template_expand
COMPILE=../src/template_compile

all: $(TARGET)

test: $(HTML)

%.html: %.t %.vars common.vars Makefile
	$(EXPAND) $@ $* common.vars $*.vars

templates.a: $(O_FILES)
	rm -f templates.a
	ar q templates.a $(O_FILES)

%.o: %.c Makefile
	$(CC) $(CFLAGS) -I../../lib -c $<

_template_index.c:
	../src/build_index.pl $(TYPE) *.t > _template_index.c

%.c: %.t Makefile
	$(COMPILE) $(TYPE) $@ $*

install:
	$(INSTALL) -o $(RO_USER) -g $(RO_GROUP) -m $(PUBLIC_DIR) -d \
	  $(BROOT)$(PREFIX)/templates/$(TYPE)
	cp *.t $(BROOT)$(PREFIX)/templates/$(TYPE)
	cp *.vars $(BROOT)$(PREFIX)/templates/$(TYPE)

clean:
	rm -f *.html *.o *.c \#*\# *~

include Makefile.deps


