[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:37:10 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=0643e35
The following commit has been merged in the master branch:
commit 0643e352825873587a23d5da2276f62c0ad11f35
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sat Jun 18 17:16:51 2005 +0000
Makefile magic: added advanced auto-dependency generation
---
config/config.mk.in | 18 +++++++++++++--
src/Makefile | 63 ++++++++++++++++++++++++++---------------------------
2 files changed, 47 insertions(+), 34 deletions(-)
diff --git a/config/config.mk.in b/config/config.mk.in
index 0ed5cbe..6caf872 100644
--- a/config/config.mk.in
+++ b/config/config.mk.in
@@ -48,9 +48,9 @@ CXX = @CXX@
# Common compiler flags (warnings, symbols [-ggdb], optimization [-O2], etc)
ifeq ($(findstring g++,$(CXX)),g++)
- CXXFLAGS := -Wall -O2
+ CXXFLAGS = -Wall -O2
else
- CXXFLAGS := @CXXFLAGS@
+ CXXFLAGS = @CXXFLAGS@
endif
# Command to run only the preprocessor
@@ -78,6 +78,20 @@ else
endif
# **********************************************************************
+# Advanced auto-dependency generation
+# http://make.paulandlesley.org/autodep.html
+
+# Compiler flags to generate dependency file at the same time as object
+# files (for gcc)
+ifeq ($(findstring g++,$(CXX)),g++)
+ CXXFLAGS += -MMD
+ CFLAGS += -MMD
+else
+# Command to run the compiler or preprocessor to produce dependencies
+ MAKEDEPEND = $(CC) -MM $(CPPFLAGS) -o $*.d $<
+endif
+
+# **********************************************************************
# Global includes, libraries and defines
INCS = -I.
LIBS = @LIBS@
diff --git a/src/Makefile b/src/Makefile
index 341f406..b93a420 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -110,9 +110,12 @@ SRC = $(CCSRC)
HDR = $(CCHDR)
OBJ = $(CCOBJ)
LOBJ = $(CCLOBJ)
-DEP = $(CCSRC:%.cpp=.%.d) $(BINSRC:%.cpp=.%.d) \
- $(EXIV2MAIN:%.cpp=.%.d) $(EXIV2SRC:%.cpp=.%.d) $(EXIVCSRC:%.c=.%.d) \
- $(MCMAIN:%.cpp=.%.d) $(MCSRC:%.cpp=.%.d)
+
+DEPDIR = .deps
+DEP = $(CCSRC:%.cpp=$(DEPDIR)/%.d) $(BINSRC:%.cpp=$(DEPDIR)/%.d) \
+ $(EXIV2MAIN:%.cpp=$(DEPDIR)/%.d) $(EXIV2SRC:%.cpp=$(DEPDIR)/%.d) \
+ $(EXIVCSRC:%.c=$(DEPDIR)/%.d) $(MCMAIN:%.cpp=$(DEPDIR)/%.d) \
+ $(MCSRC:%.cpp=$(DEPDIR)/%.d) $(DEPDIR)/path-test.d
BINOBJ = $(BINSRC:.cpp=.o)
BINARY = $(BINSRC:.cpp=)
@@ -128,44 +131,37 @@ MCBIN = $(MCMAIN:.cpp=)
MCEXE = $(MCMAIN:.cpp=$(EXEEXT))
# ******************************************************************************
-# Include `.*.d' files, but only if we need them,
-# i.e., if no target was given...
-ifeq ($(strip $(MAKECMDGOALS)),)
--include $(DEP)
-else
-# ...or the target is _not_ one in the list of targets below.
-NOINCLUDE = uninstall uninstall-lib check doc ctags mostlyclean clean \
- install-header uninstall-header distclean maintainer-clean exv_conf.h
-ifneq ($(MAKECMDGOALS), $(filter $(MAKECMDGOALS), $(NOINCLUDE)))
+# Include dependency files
-include $(DEP)
-endif
-endif
+
+# Dependency files post-process commands
+POSTDEPEND = cp $*.d $(DEPDIR)/$*.d; \
+ sed -e 's/^\#.*//' -e 's/^[^:]*: *//' -e 's/ *\$$//' \
+ -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $(DEPDIR)/$*.d; \
+ $(RM) $*.d
# ******************************************************************************
# Rules
-$(OBJ): %.o: %.cpp
- @$(LIBTOOL) --mode=compile $(CXX) $(CXXFLAGS) $(CXXDEFS) $(CXXINCS) -c $<
+$(OBJ): %.o: %.cpp | $(DEPDIR)
+ @$(LIBTOOL) --mode=compile $(CXX) $(CXXFLAGS) $(CXXDEFS) $(CXXINCS) -o $@ -c $<
+ @$(MAKEDEPEND)
+ @$(POSTDEPEND)
-$(sort $(BINOBJ) $(EXIV2OBJ) $(MCOBJ)): %.o: %.cpp
- $(CXX) $(CXXFLAGS) $(CXXDEFS) $(CXXINCS) -c $<
+$(sort $(BINOBJ) $(EXIV2OBJ) $(MCOBJ)): %.o: %.cpp | $(DEPDIR)
+ $(CXX) $(CXXFLAGS) $(CXXDEFS) $(CXXINCS) -o $@ -c $<
+ @$(MAKEDEPEND)
+ @$(POSTDEPEND)
-%.o: %.c
- $(CC) $(CFLAGS) $(DEFS) $(INCS) -c $<
+%.o: %.c | $(DEPDIR)
+ $(CC) $(CFLAGS) $(DEFS) $(INCS) -o $@ -c $<
+ @$(MAKEDEPEND)
+ @$(POSTDEPEND)
%.ii: %.cpp
set -e; \
$(CXXCPP) $(CPPFLAGS) $(CXXDEFS) $(CXXINCS) $< \
| sed '/^[ ]*$$/d' > $@
-# generate a makefile with the prerequisites for each source file
-# (see `info make' for details)
-.%.d: %.cpp
- @echo generating $@
- @set -e; \
- $(CXXDEP) $(CPPFLAGS) $(CXXDEFS) $(CXXINCS) $< \
- | sed 's/\($*\)\.o[ :]*/.o $@ : /' > $@; \
- [ -s $@ ] || $(RM) $@
-
# ******************************************************************************
# Targets
.PHONY: all bin check ctags doc \
@@ -173,12 +169,14 @@ $(sort $(BINOBJ) $(EXIV2OBJ) $(MCOBJ)): %.o: %.cpp
install install-header install-lib \
uninstall uninstall-header uninstall-lib
-types.hpp: exv_conf.h
-actions.cpp exiv2.cpp image.cpp utils.cpp: exv_conf.h
+actions.cpp basicio.cpp exif.cpp exiv2.cpp futils.cpp image.cpp jpgimage.cpp utils.cpp: exv_conf.h
exv_conf.h: $(top_srcdir)/config/config.h
sed 's/#define \([A-Z]\)/#define EXV_/; s/#undef \([A-Z]\)/#undef EXV_/' < $< > $@
+$(DEPDIR):
+ mkdir $(DEPDIR)
+
$(LIBTOOL): $(LIBTOOL_DEPS)
$(SHELL) $(top_srcdir)/config.status --recheck
@@ -256,10 +254,11 @@ clean: mostlyclean
# files created by configuring the program.
distclean: clean
$(RM) exv_conf.h
+ $(RM) $(DEP)
+ rmdir $(DEPDIR)
$(RM) tags TAGS
$(RM) *~ *.bak *#
# This command is intended for maintainers to use; it deletes files
# that may need special tools to rebuild.
maintainer-clean: uninstall distclean
- $(RM) $(DEP)
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list