aboutsummaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2012-06-22 03:20:35 +0200
committerJay Berkenbilt <ejb@ql.org>2012-06-22 03:24:06 +0200
commit30dbf94f53a3fd9760242883bdc5bddbaa0c9f44 (patch)
treed0a597cd5df5de029f7cbbb4d0c7e9afe9c27644 /make
parent81e8752362eeab80f156eb74d1b523eba20a0366 (diff)
downloadqpdf-30dbf94f53a3fd9760242883bdc5bddbaa0c9f44.tar.zst
Fix order of build flags.
Place user-specified CPPFLAGS and LDFLAGS later so that user-specified non-standard paths that have old versions of qpdf don't cause the build to fail.
Diffstat (limited to 'make')
-rw-r--r--make/libtool.mk16
1 files changed, 10 insertions, 6 deletions
diff --git a/make/libtool.mk b/make/libtool.mk
index 7cc6d435..e3cf7a1a 100644
--- a/make/libtool.mk
+++ b/make/libtool.mk
@@ -40,18 +40,20 @@ endif
# 1 2
# Usage: $(call compile,src,includes)
define compile
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) \
+ $(CXX) $(CXXFLAGS) \
$(call depflags,$(basename $(call src_to_obj,$(1)))) \
$(foreach I,$(2),-I$(I)) \
+ $(CPPFLAGS) \
-c $(1) -o $(call src_to_obj,$(1))
endef
# 1 2
# Usage: $(call c_compile,src,includes)
define c_compile
- $(CC) $(CPPFLAGS) $(CFLAGS) \
+ $(CC) $(CFLAGS) \
$(call depflags,$(basename $(call c_src_to_obj,$(1)))) \
$(foreach I,$(2),-I$(I)) \
+ $(CPPFLAGS) \
-c $(1) -o $(call c_src_to_obj,$(1))
endef
@@ -59,9 +61,10 @@ endef
# Usage: $(call libcompile,src,includes)
define libcompile
$(LIBTOOL) --quiet --mode=compile \
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) \
+ $(CXX) $(CXXFLAGS) \
$(call libdepflags,$(basename $(call src_to_obj,$(1)))) \
$(foreach I,$(2),-I$(I)) \
+ $(CPPFLAGS) \
-c $(1) -o $(call src_to_obj,$(1)); \
$(call fixdeps,$(basename $(call src_to_obj,$(1))))
endef
@@ -70,9 +73,10 @@ endef
# Usage: $(call libcompile,src,includes)
define c_libcompile
$(LIBTOOL) --quiet --mode=compile \
- $(CC) $(CPPFLAGS) $(CXXFLAGS) \
+ $(CC) $(CXXFLAGS) \
$(call libdepflags,$(basename $(call c_src_to_obj,$(1)))) \
$(foreach I,$(2),-I$(I)) \
+ $(CPPFLAGS) \
-c $(1) -o $(call c_src_to_obj,$(1)); \
$(call fixdeps,$(basename $(call src_to_obj,$(1))))
endef
@@ -90,14 +94,14 @@ endef
define makelib
$(LIBTOOL) --mode=link \
$(CXX) $(CXXFLAGS) $(LD_VERSION_FLAGS) \
- -o $(2) $(1) $(3) $(4) \
+ -o $(2) $(1) $(4) $(3) \
-rpath $(libdir) -version-info $(5):$(6):$(7)
endef
# 1 2 3 4
# Usage: $(call makebin,objs,binary,ldflags,libs)
define makebin
- $(LIBTOOL) --mode=link $(CXX) $(CXXFLAGS) $(1) -o $(2) $(3) $(4)
+ $(LIBTOOL) --mode=link $(CXX) $(CXXFLAGS) $(1) -o $(2) $(4) $(3)
endef
# Install target