Blame contrib/organize/Makefile

Packit Service 21b5d1
# ************************************************************* -*- Makefile -*-
Packit Service 21b5d1
#
Packit Service 21b5d1
# Copyright (C) 2004-2015 Andreas Huggel <ahuggel@gmx.net>
Packit Service 21b5d1
#
Packit Service 21b5d1
# This Makefile is part of the Exiv2 distribution.
Packit Service 21b5d1
#
Packit Service 21b5d1
# Redistribution and use in source and binary forms, with or without
Packit Service 21b5d1
# modification, are permitted provided that the following conditions
Packit Service 21b5d1
# are met:
Packit Service 21b5d1
#
Packit Service 21b5d1
#    1. Redistributions of source code must retain the above copyright
Packit Service 21b5d1
#       notice, this list of conditions and the following disclaimer.
Packit Service 21b5d1
#    2. Redistributions in binary form must reproduce the above
Packit Service 21b5d1
#       copyright notice, this list of conditions and the following
Packit Service 21b5d1
#       disclaimer in the documentation and/or other materials provided
Packit Service 21b5d1
#       with the distribution.
Packit Service 21b5d1
#    3. The name of the author may not be used to endorse or promote
Packit Service 21b5d1
#       products derived from this software without specific prior
Packit Service 21b5d1
#       written permission.
Packit Service 21b5d1
#
Packit Service 21b5d1
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
Packit Service 21b5d1
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
Packit Service 21b5d1
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit Service 21b5d1
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
Packit Service 21b5d1
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit Service 21b5d1
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
Packit Service 21b5d1
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Packit Service 21b5d1
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
Packit Service 21b5d1
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
Packit Service 21b5d1
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
Packit Service 21b5d1
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit Service 21b5d1
#
Packit Service 21b5d1
# File:      Makefile
Packit Service 21b5d1
# Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
Packit Service 21b5d1
# History:   31-Jan-09, ahu: created
Packit Service 21b5d1
#
Packit Service 21b5d1
# Description:
Packit Service 21b5d1
#  Simple Makefile to build the organize application. Requires installed
Packit Service 21b5d1
#  exiv2 library and headers. Adapted from samples/Makefile.
Packit Service 21b5d1
#
Packit Service 21b5d1
# Restrictions:
Packit Service 21b5d1
#  Requires GNU make.
Packit Service 21b5d1
#
Packit Service 21b5d1
Packit Service 21b5d1
# ******************************************************************************
Packit Service 21b5d1
# Default make target
Packit Service 21b5d1
all: ozbin
Packit Service 21b5d1
Packit Service 21b5d1
# Include system configuration
Packit Service 21b5d1
top_srcdir = ../..
Packit Service 21b5d1
include $(top_srcdir)/config/config.mk
Packit Service 21b5d1
include boost.mk
Packit Service 21b5d1
Packit Service 21b5d1
# ******************************************************************************
Packit Service 21b5d1
# Source files
Packit Service 21b5d1
Packit Service 21b5d1
# Source files for the organize application
Packit Service 21b5d1
OZMAIN = organize.cpp
Packit Service 21b5d1
OZSRC  = helpers.cpp MD5.cpp
Packit Service 21b5d1
Packit Service 21b5d1
# ******************************************************************************
Packit Service 21b5d1
# Initialisations
Packit Service 21b5d1
SHELL = /bin/sh
Packit Service 21b5d1
Packit Service 21b5d1
.SUFFIXES:
Packit Service 21b5d1
.SUFFIXES: .c .cpp .o .so
Packit Service 21b5d1
Packit Service 21b5d1
.PRECIOUS: %.cpp
Packit Service 21b5d1
Packit Service 21b5d1
CPPFLAGS := -I$(BOOST_INC_DIR) `pkg-config exiv2 --cflags`
Packit Service 21b5d1
ifdef HAVE_STDINT
Packit Service 21b5d1
	CPPFLAGS += -DEXV_HAVE_STDINT_H=1
Packit Service 21b5d1
endif
Packit Service 21b5d1
Packit Service 21b5d1
LDFLAGS := $(BOOST_LIBS) `pkg-config exiv2 --libs`
Packit Service 21b5d1
Packit Service 21b5d1
OZOBJ = $(OZSRC:.cpp=.o) $(OZMAIN:.cpp=.o)
Packit Service 21b5d1
OZBIN = $(OZMAIN:.cpp=)
Packit Service 21b5d1
OZEXE = $(OZMAIN:.cpp=$(EXEEXT))
Packit Service 21b5d1
Packit Service 21b5d1
ifdef DEP_TRACKING
Packit Service 21b5d1
DEP = $(OZMAIN:%.cpp=$(DEPDIR)/%.d) $(OZSRC:%.cpp=$(DEPDIR)/%.d)
Packit Service 21b5d1
endif
Packit Service 21b5d1
Packit Service 21b5d1
# ******************************************************************************
Packit Service 21b5d1
# Rules
Packit Service 21b5d1
ozbin: $(OZBIN)
Packit Service 21b5d1
Packit Service 21b5d1
$(OZOBJ): %.o: %.cpp
Packit Service 21b5d1
	$(COMPILE.cc) -o $@ $<
Packit Service 21b5d1
	@$(MAKEDEPEND)
Packit Service 21b5d1
	@$(POSTDEPEND)
Packit Service 21b5d1
Packit Service 21b5d1
%.ii: %.cpp
Packit Service 21b5d1
	set -e; \
Packit Service 21b5d1
	$(CXXCPP) -E $(CPPFLAGS) $< | sed '/^[ 	]*$$/d' > $@
Packit Service 21b5d1
Packit Service 21b5d1
# ******************************************************************************
Packit Service 21b5d1
# Targets
Packit Service 21b5d1
.PHONY: all ozbin relink binclean install uninstall mostlyclean clean distclean maintainer-clean
Packit Service 21b5d1
Packit Service 21b5d1
ifdef DEP_TRACKING
Packit Service 21b5d1
# Include targets from dependency files
Packit Service 21b5d1
-include $(DEP)
Packit Service 21b5d1
endif
Packit Service 21b5d1
Packit Service 21b5d1
$(OZBIN): $(OZOBJ)
Packit Service 21b5d1
	$(LIBTOOL) --mode=link $(LINK.cc) -o $@ $(OZOBJ)
Packit Service 21b5d1
Packit Service 21b5d1
relink: binclean organize
Packit Service 21b5d1
Packit Service 21b5d1
install:
Packit Service 21b5d1
	$(INSTALL_DIRS) $(DESTDIR)$(bindir)
Packit Service 21b5d1
	@$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(OZEXE) $(DESTDIR)$(bindir)/$(OZEXE)
Packit Service 21b5d1
Packit Service 21b5d1
uninstall:
Packit Service 21b5d1
	@$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(bindir)/$(OZEXE)
Packit Service 21b5d1
	-rmdir $(DESTDIR)$(bindir)
Packit Service 21b5d1
Packit Service 21b5d1
# Remove binaries, e.g., to relink them
Packit Service 21b5d1
binclean:
Packit Service 21b5d1
	$(RM) $(OZEXE)
Packit Service 21b5d1
Packit Service 21b5d1
mostlyclean:
Packit Service 21b5d1
	$(RM) core
Packit Service 21b5d1
	$(RM) $(OZMAIN:.cpp=.ii) $(OZSRC:.cpp=.ii)
Packit Service 21b5d1
	$(RM) $(OZMAIN:%.cpp=.libs/%.d) $(OZSRC:%.cpp=.libs/%.d)
Packit Service 21b5d1
	-rmdir .libs
Packit Service 21b5d1
	$(RM) $(OZOBJ)
Packit Service 21b5d1
Packit Service 21b5d1
clean: binclean mostlyclean
Packit Service 21b5d1
Packit Service 21b5d1
# Run `make distclean' from the top source directory to also remove
Packit Service 21b5d1
# files created by configuring the program.
Packit Service 21b5d1
distclean: clean
Packit Service 21b5d1
ifdef DEP_TRACKING
Packit Service 21b5d1
	$(RM) $(DEP)
Packit Service 21b5d1
	-rmdir $(DEPDIR)
Packit Service 21b5d1
endif
Packit Service 21b5d1
	$(RM) *~ *.bak *#
Packit Service 21b5d1
Packit Service 21b5d1
# This command is intended for maintainers to use; it deletes files
Packit Service 21b5d1
# that may need special tools to rebuild.
Packit Service 21b5d1
maintainer-clean: uninstall distclean