summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2008-04-29 14:55:25 +0200
committerJay Berkenbilt <ejb@ql.org>2008-04-29 14:55:25 +0200
commit9a0b88bf7777c153dc46ace22db74ef24d51583a (patch)
treef567ac1cf2bf5071a611eb49323a935b6ac938ff /make
downloadqpdf-9a0b88bf7777c153dc46ace22db74ef24d51583a.tar.zst
update release date to actual daterelease-qpdf-2.0
git-svn-id: svn+q:///qpdf/trunk@599 71b93d88-0707-0410-a8cf-f5a4172ac649
Diffstat (limited to 'make')
-rw-r--r--make/proxy.mk10
-rw-r--r--make/rules.mk63
2 files changed, 73 insertions, 0 deletions
diff --git a/make/proxy.mk b/make/proxy.mk
new file mode 100644
index 00000000..16831862
--- /dev/null
+++ b/make/proxy.mk
@@ -0,0 +1,10 @@
+THIS=$(notdir $(abspath .))
+
+all:
+ $(MAKE) -C .. build_$(THIS)
+
+check:
+ $(MAKE) -C .. check_$(THIS)
+
+clean:
+ $(MAKE) -C .. clean_$(THIS)
diff --git a/make/rules.mk b/make/rules.mk
new file mode 100644
index 00000000..901534cd
--- /dev/null
+++ b/make/rules.mk
@@ -0,0 +1,63 @@
+
+# Usage: $(call src_to_obj,srcs)
+define src_to_obj
+$(foreach F,$(1),$(dir $(F))$(OUTPUT_DIR)/$(patsubst %.cc,%.o,$(notdir $(F))))
+endef
+
+# Usage: $(call src_to_lobj,srcs)
+define src_to_lobj
+$(foreach F,$(1),$(dir $(F))$(OUTPUT_DIR)/$(patsubst %.cc,%.lo,$(notdir $(F))))
+endef
+
+# Usage: $(call obj_to_dep,objs)
+define obj_to_dep
+$(patsubst %.o,%.dep,$(1))
+endef
+
+# Usage: $(call lobj_to_dep,objs)
+define lobj_to_dep
+$(patsubst %.lo,%.dep,$(1))
+endef
+
+# Usage: $(call depflags,$(basename obj))
+ifeq ($(GENDEPS),1)
+depflags=-MD -MF $(1).dep -MP
+else
+depflags=
+endif
+
+# 1 2
+# Usage: $(call compile,src,includes)
+define compile
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) \
+ $(call depflags,$(basename $(call src_to_obj,$(1)))) \
+ $(foreach I,$(2),-I$(I)) \
+ -c $(1) -o $(call src_to_obj,$(1))
+endef
+
+# 1 2
+# Usage: $(call libcompile,src,includes)
+define libcompile
+ $(LIBTOOL) --mode=compile \
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) \
+ $(call depflags,$(basename $(call src_to_obj,$(1)))) \
+ $(foreach I,$(2),-I$(I)) \
+ -c $(1) -o $(call src_to_obj,$(1))
+endef
+
+# 1 2 3 4 5
+# Usage: $(call makelib,objs,library,current,revision,age)
+define makelib
+ $(LIBTOOL) --mode=link \
+ $(CXX) $(CXXFLAGS) -o $(2) $(1) $(LDFLAGS) $(LIBS) \
+ -rpath $(libdir) -version-info $(3):$(4):$(5)
+endef
+
+# 1 2
+# Usage: $(call makebin,objs,binary)
+define makebin
+ $(LIBTOOL) --mode=link \
+ $(CXX) $(CXXFLAGS) $(1) -o $(2) $(LDFLAGS) \
+ -Llibqpdf/$(OUTPUT_DIR) -lqpdf $(LIBS)
+endef
+