# # Makefile # # Developed by Lubomir Host 'rajo' # Copyright (c) 2004 Platon SDG, http://platon.sk/ # Licensed under terms of GNU General Public License. # All rights reserved. # # Changelog: # 09/02/2004 - created # # $Platon: scripts/perl/finance-manager/Makefile,v 1.1 2004/02/11 10:52:52 rajo Exp $ # Makefile for creating distribution of test package # Type 'make dist' for create tar-gziped archiv. PACKAGE = finance-manager VERSION = $(shell date '+%Y-%m-%d_%H-%M') export PACKAGE export VERSION # Directories {{{ srcdir = . top_srcdir = . distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) top_builddir = . # }}} Directories # Targets {{{ # if you have subdirectories with Makefiles, # add names of directories here SUBDIRS = PROGRAM = # here add names of your source codes SOURCES = $(srcdir)/index.fcgi \ $(srcdir)/modules/ \ $(srcdir)/modules/Event.pm \ $(srcdir)/modules/Source.pm \ $(srcdir)/modules/db.pm \ $(srcdir)/modules/globals.pm \ $(srcdir)/modules/restart.pm \ $(srcdir)/modules/template.pm TEMPLATES = $(srcdir)/css/ \ $(srcdir)/css/main.css \ $(srcdir)/templates/ \ $(srcdir)/templates/defaults.tt2 \ $(srcdir)/templates/editsource.tt2 \ $(srcdir)/templates/foot.tt2 \ $(srcdir)/templates/head.tt2 \ $(srcdir)/templates/index.tt2 \ $(srcdir)/templates/newsource.tt2 \ $(srcdir)/templates/sources.tt2 SQL = $(srcdir)/sql/ \ $(srcdir)/sql/finance.sql DISTFILES = Makefile \ $(SOURCES) $(TEMPLATES) $(SQL) # }}} Targets # Programs {{{ TAR = tar GZIP_ENV = --best MYSQLDUMP = mysqldump SQL_OPTS = --opt -u finance -h localhost finance # }}} Programs all: $(srcdir)/sql/finance.sql dist $(srcdir)/sql/finance.sql: $(MYSQLDUMP) $(SQL_OPTS) > $@ # # False targets. # .PHONY: dummy $(srcdir)/sql/finance.sql # # A rule to do nothing # dummy: clean: clean-subdirs -rm -f *.o core # # A rule to make subdirectories # subdir-list-all = $(sort $(patsubst %,_subdir_%,$(SUBDIRS))) all-subdirs: dummy $(subdir-list-all) ifdef SUBDIRS $(subdir-list-all) : dummy $(MAKE) -C $(patsubst _subdir_%,%,$@) endif # # A rule to make clean in subdirectories # subdir-list-clean = $(sort $(patsubst %,_subdir_clean_%,$(SUBDIRS))) clean-subdirs: dummy $(subdir-list-clean) ifdef SUBDIRS $(subdir-list-clean) : dummy $(MAKE) -C $(patsubst _subdir_clean_%,%,$@) clean endif # Distribution targets {{{ dist: distdir GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) @here=`cd $(top_builddir) && pwd`; \ top_distdir=`cd $(distdir) && pwd`; \ distdir=`cd $(distdir) && pwd`; @FILES=`echo "$(DISTFILES)" | awk 'BEGIN{RS=" "}{print}' | sort -u`; \ for file in $$FILES; do \ d=$(srcdir); \ if test -d $$d/$$file; then \ mkdir $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done # }}} # vim600: fdm=marker fdc=3