# Copyright (c) 2004 Mark Aylett # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. CAT = cat CD = cd DOXYGEN = doxygen ECHO = echo FIND = find GREP = grep GROFF = groff GZIP = gzip INSTALL = install LN = ln MAKE = make MKDIR = mkdir PRINTF = printf RM = rm TAR = tar XARGS = xargs VERSION = 0.5 PACKAGE = mar-$(VERSION) PREFIX = /usr/local MANDIR = $(PREFIX)/man FILES = \ Doxyfile \ Makefile \ changelog.txt \ copying.txt \ readme.html \ manifest.txt \ mar.1.html HEADERS = \ include/mar_c.h \ include/mar_archive_cpp.h \ include/mar_storage_c.h \ include/mar_types_c.h \ include/mar_compat_cpp.h \ include/mar_defs_c.h \ include/mar_defs_cpp.h \ include/mar_exception_cpp.h \ include/mar_index_cpp.h \ include/mar_iterator_cpp.h \ include/mar_key_cpp.h \ include/mar_stream_cpp.h \ include/mar_streambuf_cpp.h \ include/mar_transaction_cpp.h \ include/mar_types_cpp.h \ include/mar_util_cpp.h .PHONY: all check clean dist distclean doc install uninstall all: $(CD) src && $(MAKE) check: $(CD) src && $(MAKE) check clean: $(CD) src && $(MAKE) clean dist: $(PACKAGE)-src.tar.gz distclean: clean $(RM) $(PACKAGE)-src.tar.gz mar.1.html manifest.txt $(RM) -fR doc $(PACKAGE)-src.tar.gz: $(PACKAGE)-src.tar $(GZIP) $(PACKAGE)-src.tar $(PACKAGE)-src.tar: manifest.txt (cd .. && $(LN) -s mar $(PACKAGE)) (cd .. && $(TAR) -cf mar/$(PACKAGE)-src.tar `$(CAT) mar/manifest.txt`) (cd .. && $(RM) $(PACKAGE)) manifest.txt: clean doc $(RM) -f manifest.txt for file in $(FILES); do \ $(ECHO) "$(PACKAGE)/$$file" >> manifest.txt; \ done $(FIND) doc include man msvc sample src -type f \ | $(GREP) -v CVS \ | $(XARGS) $(PRINTF) "$(PACKAGE)/%s\n" >> manifest.txt doc: doc/html/index.html mar.1.html doc/html/index.html: $(HEADERS) $(DOXYGEN) mar.1.html: man/man1/mar.1 $(GROFF) -m man -Thtml man/man1/mar.1 > $@ install: all $(MKDIR) -p $(PREFIX)/bin $(MKDIR) -p $(PREFIX)/lib $(MKDIR) -p $(PREFIX)/include $(MKDIR) -p $(PREFIX)/man $(INSTALL) src/mar $(PREFIX)/bin $(INSTALL) src/libmar.a $(PREFIX)/lib for file in $(HEADERS); do \ $(INSTALL) $$file $(PREFIX)/include; \ done $(INSTALL) man/man1/mar.1 $(MANDIR)/man1/mar.1 uninstall: $(RM) -f $(PREFIX)/bin/mar $(RM) -f $(PREFIX)/lib/libmar.a for file in $(HEADERS); do \ $(RM) -f $(PREFIX)/$$file; \ done $(RM) -f $(MANDIR)/man1/mar.1